:root {
    --font-sans: Aptos, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --bg: #f4f6fb;
    --bg-panel: rgba(255, 255, 255, 0.92);
    --bg-subtle: #eef2ff;
    --bg-accent: linear-gradient(135deg, #fff5d6 0%, #ffe2eb 48%, #e0f1ff 100%);
    --text: #172033;
    --text-muted: #66738a;
    --border: rgba(113, 126, 161, 0.18);
    --border-strong: rgba(113, 126, 161, 0.32);
    --primary: #7656f0;
    --primary-strong: #5c3ddb;
    --secondary: #1796d2;
    --success: #1f9d63;
    --warning: #cc8a11;
    --danger: #d6455d;
    --shadow-soft: 0 18px 40px rgba(23, 32, 51, 0.08);
    --shadow-card: 0 24px 60px rgba(23, 32, 51, 0.1);
    --coachmark-overlay-background: rgba(15, 23, 42, 0.20);
    --coachmark-chrome-overlay-background: var(--coachmark-overlay-background);
    --z-theme-toggle: 900;
    --z-tutorial-content-backdrop: 1000;
    --z-tutorial-scope: 1100;
    --z-tutorial-chrome: 1200;
    --z-tutorial-chrome-backdrop: 1210;
    --z-tutorial-target: 1250;
    --z-mobile-sidebar-open: 1260;
    --z-tutorial-panel: 1300;
    --z-tutorial-backdrop: var(--z-tutorial-content-backdrop);
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 30px;
    --sidebar-width: 300px;
    --topbar-height: 88px;
    --content-max: 1540px;
}

.theme-toggle-checkbox {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-sans);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(118, 86, 240, 0.08), transparent 26%),
        radial-gradient(circle at top right, rgba(23, 150, 210, 0.08), transparent 22%),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 18px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
}

.app-sidebar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-stage {
    min-width: 0;
}

.app-topbar {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 28px;
    background: rgba(244, 246, 251, 0.88);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .app-sidebar,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .app-topbar,
body:has(#tutorial-visual-overlay-root.is-active) .app-sidebar,
body:has(#tutorial-visual-overlay-root.is-active) .app-topbar {
    z-index: var(--z-tutorial-chrome);
    isolation: isolate;
}

body.tutorial-visual-overlay-active .app-sidebar::after,
body.tutorial-visual-overlay-active .app-topbar::after,
body:has(#tutorial-visual-overlay-root.is-active) .app-sidebar::after,
body:has(#tutorial-visual-overlay-root.is-active) .app-topbar::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--coachmark-chrome-overlay-background, var(--coachmark-overlay-background, rgba(15, 23, 42, 0.20)));
    pointer-events: none;
}

body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .coachmark-content-backdrop,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .coachmark-topbar-backdrop,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .coachmark-sidebar-backdrop,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .tutorial-resume-content-backdrop,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .tutorial-resume-topbar-backdrop,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .tutorial-resume-sidebar-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .coachmark-content-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .coachmark-topbar-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .coachmark-sidebar-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .tutorial-resume-content-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .tutorial-resume-topbar-backdrop,
body:has(#tutorial-visual-overlay-root.is-active) .tutorial-resume-sidebar-backdrop {
    display: none !important;
}

body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .app-topbar:has([data-coachmark-active="true"]) {
    z-index: var(--z-tutorial-target);
}

body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .app-sidebar [data-coachmark-active="true"],
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .app-topbar [data-coachmark-active="true"],
body:has(#tutorial-visual-overlay-root.is-active) .app-sidebar [data-coachmark-active="true"],
body:has(#tutorial-visual-overlay-root.is-active) .app-topbar [data-coachmark-active="true"] {
    position: relative;
    z-index: 3;
}

body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-sidebar,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-topbar,
body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-topbar:has([data-coachmark-active="true"]),
body:has(#tutorial-visual-overlay-root.is-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-sidebar,
body:has(#tutorial-visual-overlay-root.is-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-topbar,
body:has(#tutorial-visual-overlay-root.is-active):has(.modal-backdrop, .modal-overlay, .modal.show, .custom-modal, dialog[open]) .app-topbar:has([data-coachmark-active="true"]) {
    z-index: 5;
}

#tutorial-visual-overlay-root {
    position: fixed;
    inset: 0;
    display: none;
    pointer-events: none;
}

#tutorial-visual-overlay-root.is-active {
    display: block;
}

.tutorial-global-content-backdrop {
    position: fixed;
    top: var(--topbar-height, 88px);
    right: 0;
    bottom: 0;
    left: var(--sidebar-width, 300px);
    z-index: var(--z-tutorial-content-backdrop, 1000);
    background: var(--coachmark-overlay-background, rgba(15, 23, 42, 0.20));
    pointer-events: none;
}

.topbar-title {
    margin: 6px 0 0;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.surface-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.surface-link:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.topbar-icon-button,
.profile-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.topbar-icon-button {
    min-width: 46px;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.topbar-icon-button:hover,
.profile-trigger:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.theme-toggle-button {
    position: relative;
    z-index: var(--z-theme-toggle);
}

body.tutorial-overlay-active .theme-toggle-button {
    z-index: 2;
}

body.tutorial-visual-overlay-active .theme-toggle-button,
body:has(#tutorial-visual-overlay-root.is-active) .theme-toggle-button {
    z-index: 2;
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.theme-icon svg,
.profile-chevron svg {
    width: 100%;
    height: 100%;
}

.theme-icon-sun {
    display: none;
}

.profile-menu {
    position: relative;
}

.profile-menu summary {
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-trigger {
    gap: 12px;
    padding: 6px 10px 6px 8px;
    cursor: pointer;
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ec4899);
}

.profile-copy {
    display: grid;
    text-align: left;
    line-height: 1.05;
}

.profile-copy strong {
    font-size: 0.84rem;
}

.profile-copy span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.profile-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.profile-menu[open] .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-card);
    display: grid;
    gap: 4px;
    z-index: 20;
}

.profile-dropdown-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    color: var(--text);
}

.profile-dropdown-link:hover {
    background: #f4f2ff;
    color: var(--primary-strong);
}

.app-main {
    padding: 28px;
}

body.tutorial-overlay-active .app-main {
    padding-bottom: calc(28px + var(--coachmark-bubble-reserved-bottom, 0px));
}

.main-inner {
    width: min(100%, var(--content-max));
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-brand-badge,
.shell-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: var(--shadow-soft);
}

.app-brand-badge {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(118, 86, 240, 0.14);
    box-shadow: 0 12px 28px rgba(36, 28, 74, 0.12);
}

.app-brand-badge-logo {
    display: block;
    width: 110%;
    height: 110%;
    object-fit: contain;
}

.app-brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.app-brand-subtitle {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.sidebar-note,
.page-card,
.metric-card,
.hero-panel,
.auth-card,
.info-card,
.notice-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.sidebar-note {
    padding: 18px;
    border-radius: 24px;
    background-image: var(--bg-accent);
}

.sidebar-note strong,
.page-card h2,
.page-card h3,
.page-card h4,
.page-card h5,
.hero-copy h1,
.auth-card h1,
.app-brand-title,
.page-header h1,
.topbar-title,
.status-item div,
option,
td,
li {
    color: var(--text);
}

.btn-close {
    color: var(--text) !important;
}

/* Bootstrap's .btn-close uses a background SVG, not a text glyph.
   filter: invert() is the only reliable way to make it visible in dark mode. */
.theme-toggle-checkbox:checked ~ .app-shell .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.sidebar-note p,
.hero-copy p,
.section-copy,
.auth-lead,
.metric-copy,
.page-card p,
.page-intro,
.shell-nav-callout,
.validation-message {
    color: var(--text-muted);
}

.shell-nav {
    display: grid;
    gap: 14px;
}

.shell-nav-section,
.eyebrow {
    color: #8d97ab;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.shell-nav-list {
    display: grid;
    gap: 8px;
}

.shell-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.shell-nav-link:hover {
    transform: translateX(2px);
    background: #f4f2ff;
    border-color: rgba(118, 86, 240, 0.12);
    color: var(--text);
}

.shell-nav-link.active {
    background: #f1edff;
    border-color: rgba(118, 86, 240, 0.18);
    color: var(--primary-strong);
}

.shell-nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 0.72rem;
}

.shell-nav-callout {
    padding: 0 4px;
}

.hero-shell,
.page-grid,
.dashboard-grid,
.auth-grid,
.info-grid {
    display: grid;
    gap: 24px;
}

.hero-shell,
.auth-shell {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.hero-panel,
.auth-card,
.info-card {
    border-radius: var(--radius-lg);
}

.hero-panel {
    padding: clamp(24px, 4vw, 40px);
    background-image: var(--bg-accent);
    box-shadow: var(--shadow-card);
}

.hero-copy h1,
.auth-card h1 {
    margin: 10px 0 12px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.hero-copy p,
.auth-lead {
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.7;
}

.hero-illustration {
    display: block;
    width: min(100%, 640px);
    height: auto;
    margin: clamp(24px, 4vw, 40px) auto 0;
}

.hero-actions,
.page-actions,
.auth-actions,
.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn,
.btn-link,
button.btn,
a.btn {
    min-height: 46px;
    border-radius: 16px;
    font-weight: 700;
    padding: 11px 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover,
.btn-link:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
    box-shadow: var(--shadow-soft);
}

.btn,
.btn-secondary,
.btn-outline-secondary,
.btn-light {
    background: var(--bg-panel);
    color: var(--text);
    border-color: var(--border);
}

.btn-success,
.btn-outline-success {
    background: rgba(31, 157, 99, 0.12);
    color: var(--success);
    border-color: rgba(31, 157, 99, 0.25);
}

.btn-danger,
.btn-outline-danger {
    background: rgba(214, 69, 93, 0.1);
    color: var(--danger);
    border-color: rgba(214, 69, 93, 0.22);
}

.btn-link {
    color: var(--primary-strong);
    text-decoration: none;
}

.metric-row,
.dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: span 12;
}

.metric-card,
.page-card,
.info-card,
.notice-card {
    padding: 24px;
    border-radius: var(--radius-md);
}

.metric-card {
    min-height: 148px;
}

.metric-value {
    margin-top: 10px;
    font-size: clamp(1.75rem, 2.5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-copy {
    margin-top: 10px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
}

.page-header h1,
.page-header h2 {
    margin: 8px 0 0;
    font-size: clamp(1.7rem, 2.5vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.page-intro {
    max-width: 70ch;
    line-height: 1.7;
}

.page-stack {
    display: grid;
    gap: 18px;
}

.contact-container,
.auth-form,
.form-layout {
    display: grid;
    gap: 16px;
}

.contact-container > div,
.contact-container .mb-3,
.field-wrap {
    display: grid;
    gap: 8px;
}

label,
.form-label {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.form-control,
.form-select,
input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    background: var(--bg-panel);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(118, 86, 240, 0.5);
    box-shadow: 0 0 0 4px rgba(118, 86, 240, 0.12);
}

.form-control::placeholder,.text-muted-custom {
  color: var(--bs-gray-600) !important;
  opacity: 1;
}

    .form-control:disabled,
    .form-select:disabled {
        background-color: var(--bs-gray-600);
    }

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.alert {
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 14px 16px;
}

.alert-info {
    background: rgba(23, 150, 210, 0.09);
    color: #0e688f;
}

.alert-warning {
    background: rgba(204, 138, 17, 0.1);
    color: #8f6110;
}

.alert-danger {
    background: rgba(214, 69, 93, 0.1);
    color: #a42b46;
}

.alert-success {
    background: rgba(31, 157, 99, 0.1);
    color: #176f48;
}

.validation-message,
.text-danger {
    font-size: 0.82rem;
    font-weight: 600;
}

.table,
table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #8390a8;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card,
.custom-modal,
.modal-content,
.modal-dialog {
    border-radius: 24px;
}

.custom-modal,
.modal-content,
.form-select,
.card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    background: var(--bg-panel);
    color: var(--text);
}

.notice-card {
    background-image: linear-gradient(135deg, rgba(118, 86, 240, 0.08), rgba(23, 150, 210, 0.08));
}

.status-list,
.bullet-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 1.25rem;
}

.bullet-list {
    list-style: disc;
}

.status-item {
    display: flex;
    align-items: start;
    gap: 12px;
}

.status-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 0 6px rgba(118, 86, 240, 0.1);
}

.auth-shell {
    min-height: calc(100vh - 180px);
    align-items: stretch;
}

.auth-card {
    padding: clamp(24px, 4vw, 38px);
}

.auth-side {
    display: grid;
    gap: 18px;
    align-content: start;
}

.auth-metrics {
    display: grid;
    gap: 14px;
}

.auth-metric {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border);
}

.auth-metric strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 8px;
}

.status-page {
    width: min(100%, 780px);
    margin: 0 auto;
}

.theme-toggle-checkbox:checked ~ .app-shell {
    --bg: #0b1220;
    --bg-panel: rgba(16, 24, 40, 0.92);
    --bg-subtle: #111b30;
    --bg-accent: linear-gradient(135deg, rgba(118, 86, 240, 0.22) 0%, rgba(23, 150, 210, 0.2) 100%);
    --text: #edf2ff;
    --text-muted: var(--bs-gray-500);
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(148, 163, 184, 0.36);
    --shadow-soft: 0 20px 44px rgba(0, 0, 0, 0.28);
    --shadow-card: 0 26px 64px rgba(0, 0, 0, 0.34);
    --coachmark-overlay-background: rgba(255, 255, 255, 0.08);
    --coachmark-chrome-overlay-background: rgba(255, 255, 255, 0.05);
    background: radial-gradient(circle at top left, rgba(118, 86, 240, 0.16), transparent 26%), radial-gradient(circle at top right, rgba(23, 150, 210, 0.14), transparent 22%), linear-gradient(180deg, #08101d 0%, #0b1220 100%);
}

.theme-toggle-checkbox:checked ~ .app-shell .app-sidebar,
.theme-toggle-checkbox:checked ~ .app-shell .app-topbar,
.theme-toggle-checkbox:checked ~ .app-shell .surface-link,
.theme-toggle-checkbox:checked ~ .app-shell .topbar-icon-button,
.theme-toggle-checkbox:checked ~ .app-shell .profile-trigger,
.theme-toggle-checkbox:checked ~ .app-shell .profile-dropdown,
.theme-toggle-checkbox:checked ~ .app-shell .auth-metric {
    background: rgba(16, 24, 40, 0.94);
}

.theme-toggle-checkbox:checked ~ .app-shell .theme-icon-moon {
    display: none;
}

.theme-toggle-checkbox:checked ~ .app-shell .theme-icon-sun {
    display: inline-flex;
}

.theme-toggle-checkbox:checked ~ .app-shell .shell-nav-link:hover,
.theme-toggle-checkbox:checked ~ .app-shell .profile-dropdown-link:hover {
    background: rgba(118, 86, 240, 0.16);
}

.theme-toggle-checkbox:checked ~ .app-shell .shell-nav-link.active {
    background: rgba(118, 86, 240, 0.2);
}

input[type="checkbox"], .form-check-input {
    width: 25px !important;
    height: 25px !important;
    min-height: 25px !important;
    cursor: pointer !important;
}


#blazor-error-ui {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    display: none;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(214, 69, 93, 0.24);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-card);
    z-index: 1000;
}

#blazor-error-ui .reload {
    margin-left: 12px;
    color: var(--primary-strong);
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

.content {
    padding-top: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid rgba(31, 157, 99, 0.55);
}

.invalid {
    outline: 1px solid rgba(214, 69, 93, 0.55);
}

.blazor-error-boundary {
    background: rgba(214, 69, 93, 0.92);
    color: #fff;
    border-radius: 20px;
    padding: 16px 18px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.mobile-menu-checkbox {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.44);
    z-index: 900;
}

.menu-toggle {
    display: none;
    margin-right: 12px;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .tutorial-global-content-backdrop {
        top: var(--coachmark-content-top, var(--topbar-height, 88px));
        left: 0;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 1000;
        overflow: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: min(88vw, 320px);
        padding-right: 0;
        border-right: 1px solid var(--border);
        background: var(--bg-panel);
    }

    .app-sidebar-inner {
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 18px;
    }

    .mobile-menu-checkbox:checked ~ .app-shell .app-sidebar {
        transform: translateX(0);
    }

    body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .mobile-menu-checkbox:checked ~ .app-shell .app-sidebar,
    body:has(#tutorial-visual-overlay-root.is-active) .mobile-menu-checkbox:checked ~ .app-shell .app-sidebar {
        z-index: var(--z-mobile-sidebar-open);
    }

    .mobile-menu-checkbox:checked ~ .app-shell .scrim {
        display: block;
    }

    body:is(.tutorial-overlay-active, .tutorial-visual-overlay-active) .mobile-menu-checkbox:checked ~ .app-shell .scrim,
    body:has(#tutorial-visual-overlay-root.is-active) .mobile-menu-checkbox:checked ~ .app-shell .scrim {
        z-index: var(--z-tutorial-chrome-backdrop);
    }

    .menu-toggle {
        display: inline-flex;
    }

    .hero-shell,
    .auth-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .app-topbar,
    .page-header {
        flex-direction: column;
        align-items: start;
    }

    .topbar-actions {
        justify-content: start;
    }

    .profile-dropdown {
        left: 0;
        right: auto;
    }

    .dashboard-grid,
    .metric-row {
        grid-template-columns: 1fr;
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .hero-shell {
        gap: 16px;
    }

    .hero-panel {
        padding: 22px;
    }

    .hero-copy h1 {
        font-size: 2rem;
        line-height: 1.05;
    }

    .hero-copy p {
        line-height: 1.55;
    }

    .hero-illustration {
        width: min(100%, 360px);
        margin-top: 20px;
    }
}
