:root {
    color-scheme: light;
    --shell-header-height: 68px;
    --page-bg: #f6f7fb;
    --page-text: #1f2937;
    --surface-bg: #ffffff;
    --surface-soft: #f8fafc;
    --surface-alt: #eef4ff;
    --surface-border: #e5e7eb;
    --surface-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    --header-bg: #111827;
    --header-text: #ffffff;
    --header-muted: #cbd5e1;
    --nav-text: #111827;
    --nav-muted: #64748b;
    --nav-active-bg: #e0ecff;
    --nav-active-border: #93c5fd;
    --nav-accent: #2563eb;
    --nav-accent-soft: #eff6ff;
    --shell-attention-color: var(--nav-accent);
    --statuscake-loader-accent: #2777B5;
    --link-color: #2563eb;
    --dropdown-bg: #ffffff;
    --dropdown-text: #111827;
    --switch-track: #cbd5e1;
    --switch-track-active: #2563eb;
    --switch-knob: #ffffff;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page-bg: #0b1120;
    --page-text: #e2e8f0;
    --surface-bg: #0f172a;
    --surface-soft: #111827;
    --surface-alt: #172036;
    --surface-border: #263248;
    --surface-shadow: 0 18px 38px rgba(2, 6, 23, 0.45);
    --header-bg: #020617;
    --header-text: #f8fafc;
    --header-muted: #94a3b8;
    --nav-text: #e2e8f0;
    --nav-muted: #94a3b8;
    --nav-active-bg: #1e293b;
    --nav-active-border: #3b82f6;
    --nav-accent: #60a5fa;
    --nav-accent-soft: #172036;
    --shell-attention-color: var(--nav-accent);
    --statuscake-loader-accent: #2777B5;
    --link-color: #93c5fd;
    --dropdown-bg: #0f172a;
    --dropdown-text: #e2e8f0;
    --switch-track: #475569;
    --switch-track-active: #2563eb;
    --switch-knob: #f8fafc;
}

html,
body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background: var(--page-bg);
    color: var(--page-text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--link-color);
}

.page-shell {
    min-height: 100vh;
    background: var(--page-bg);
}

.app-toast {
    position: fixed;
    top: calc(var(--shell-header-height) + 20px);
    right: 1.25rem;
    z-index: 1600;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: min(24rem, calc(100vw - 2rem));
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
    box-shadow: var(--surface-shadow);
}

.app-toast.success {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(20, 83, 45, 0.95);
    color: #dcfce7;
}

.app-toast.error {
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.95);
    color: #fee2e2;
}

.app-toast-dismiss {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    font-weight: 700;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--header-bg);
    color: var(--header-text);
    position: sticky;
    top: 0;
    z-index: 1500;
}

.shell-breadcrumbs {
    display: flex;
    align-items: center;
    overflow-x: auto;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--surface-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 92%, var(--surface-soft)), var(--surface-bg));
}

.shell-breadcrumbs-list {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.shell-breadcrumbs-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--nav-muted);
    white-space: nowrap;
    line-height: 1;
}

.shell-breadcrumbs-item:not(:first-child)::before {
    content: "/";
    color: var(--nav-muted);
    opacity: 0.65;
}

.shell-breadcrumbs-link {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.shell-breadcrumbs-link:hover {
    background: var(--surface-alt);
}

.shell-breadcrumbs-current {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    color: var(--page-text);
    font-weight: 800;
    line-height: 1;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    line-height: 1;
}

.subtitle {
    display: block;
    font-size: 0.82rem;
    color: var(--header-muted);
}

.shell-toggle-button {
    display: none;
    min-width: 3.5rem;
    height: 2.05rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

html[data-menu-layout="side"] .shell-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.body-layout {
    display: block;
    min-height: calc(100vh - var(--shell-header-height));
    position: relative;
}

.sidebar {
    position: fixed;
    inset: var(--shell-header-height) auto 0 0;
    width: 230px;
    transform: translateX(-100%);
    z-index: 1450;
    background: var(--surface-bg);
    border-right: 1px solid var(--surface-border);
    padding: 0.85rem;
    box-shadow: var(--surface-shadow);
    overflow-y: auto;
    transition: transform 0.2s ease;
}

html[data-menu-layout="top"] .sidebar {
    visibility: hidden;
    pointer-events: none;
}

html[data-sidebar-collapsed="false"] .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

html[data-menu-layout="top"] .sidebar-backdrop {
    display: none;
}

.sidebar-backdrop {
    position: fixed;
    inset: var(--shell-header-height) 0 0 0;
    border: 0;
    background: rgba(15, 23, 42, 0.32);
    z-index: 1400;
    cursor: pointer;
}

.content {
    padding: 2rem;
    min-height: calc(100vh - 72px);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list li {
    margin-bottom: 0.75rem;
}

.nav-list a {
    text-decoration: none;
    color: var(--nav-text);
}

.nav-list > li > a {
    display: block;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface-soft);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-list > li > a:hover,
.nav-sublist a:hover,
.nav-accordion-summary:hover {
    background: var(--surface-alt);
}

.nav-list a.active {
    font-weight: bold;
    background: var(--nav-active-bg);
    border-color: var(--nav-active-border);
}

.nav-accordion-item {
    margin-bottom: 0.75rem;
}

.nav-accordion {
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface-soft);
    overflow: hidden;
}

.nav-accordion.is-active {
    background: var(--nav-active-bg);
    border-color: var(--nav-active-border);
}

.nav-accordion-summary {
    list-style: none;
    cursor: pointer;
    padding: 0.8rem 0.9rem;
    font-weight: 700;
    color: var(--nav-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.nav-accordion-summary::-webkit-details-marker {
    display: none;
}

.nav-accordion.is-active .nav-accordion-summary {
    color: var(--nav-text);
}

.nav-accordion-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: inherit;
    text-decoration: none;
}

.nav-accordion-link.active {
    color: inherit;
}

.nav-accordion-chevron {
    flex: 0 0 auto;
    color: var(--nav-muted);
    transition: transform 0.18s ease;
}

.nav-accordion[open] .nav-accordion-chevron {
    transform: rotate(180deg);
}

.nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--surface-border);
}

.nav-sublist li {
    margin: 0.5rem 0 0;
}

.nav-sublist a {
    display: block;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--surface-bg);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-sublist a.active {
    background: var(--nav-active-bg);
    border-color: var(--nav-active-border);
}

.nav-menu-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.nav-menu-icon {
    width: 1rem;
    min-width: 1rem;
    text-align: center;
    opacity: 0.95;
}

.nav-shell-top {
    display: block;
    padding: 0.6rem 1rem 0.75rem;
    border-bottom: 1px solid var(--surface-border);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 94%, var(--surface-soft)), var(--surface-bg));
    position: relative;
    z-index: 1490;
}

.nav-top-list {
    list-style: none;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.nav-top-item {
    position: relative;
    display: block;
}

.nav-top-item-shell {
    width: 100%;
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

html[data-top-menu-suppressed="true"] .nav-top-item-shell:hover .nav-top-dropdown,
html[data-top-menu-suppressed="true"] .nav-top-item-shell:focus-within .nav-top-dropdown {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem);
    pointer-events: none;
}

.nav-top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    background: var(--surface-soft);
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.nav-top-link:hover,
.nav-top-item-shell:focus-within .nav-top-link:not(.active) {
    background: var(--surface-alt);
    transform: translateY(-1px);
}

.nav-top-link.active {
    background: color-mix(in srgb, var(--nav-active-bg) 84%, var(--surface-soft));
    border-color: var(--nav-active-border);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-active-border) 55%, transparent);
    font-weight: 800;
}

.nav-top-link.active:hover,
.nav-top-item-shell:focus-within .nav-top-link.active {
    background: color-mix(in srgb, var(--nav-active-bg) 84%, var(--surface-soft));
    transform: none;
}

.nav-top-chevron {
    font-size: 0.72rem;
    opacity: 0.75;
}

.nav-top-dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 16rem;
    z-index: 1530;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.nav-top-item-shell:hover .nav-top-dropdown,
.nav-top-item-shell:focus-within .nav-top-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-top-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    display: grid;
    gap: 0.45rem;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
    box-shadow: var(--surface-shadow);
}

.nav-top-dropdown-item .nav-top-link {
    width: 100%;
    justify-content: flex-start;
    background: var(--surface-soft);
}

.nav-top-dropdown-item .nav-top-link:hover,
.nav-top-dropdown-item .nav-top-link:not(.active):focus-visible {
    background: var(--nav-active-bg);
}

.nav-top-dropdown-item .nav-top-link.active {
    background: var(--nav-active-bg);
    border-color: var(--nav-active-border);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nav-active-border) 55%, transparent);
    font-weight: 800;
}

.nav-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.nav-tile {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    min-height: 11rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid var(--surface-border);
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 88%, var(--surface-alt)), var(--surface-bg));
    box-shadow: var(--surface-shadow);
}

.nav-tile-child {
    padding: 0.45rem 0.5rem 0.35rem;
    border-radius: 18px;
    box-shadow: none;
    background: color-mix(in srgb, var(--surface-bg) 84%, var(--surface-soft));
}

.nav-tile-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    align-self: stretch;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, var(--surface-soft), var(--surface-bg));
    color: var(--page-text);
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.nav-tile-link:hover,
.nav-tile-link:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--nav-accent) 28%, var(--surface-border));
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
}

.nav-tile-link.active {
    border-color: var(--nav-active-border);
    background: var(--nav-active-bg);
}

.nav-tile-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 14px;
    background: color-mix(in srgb, var(--nav-accent) 14%, var(--surface-bg));
    color: var(--nav-accent);
    flex: 0 0 auto;
}

.nav-tile-icon {
    font-size: 1.05rem;
}

.nav-tile-copy {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    text-align: left;
}

.nav-tile-copy strong {
    font-size: 1.02rem;
    line-height: 1.2;
}

.nav-tile-copy span {
    color: var(--nav-muted);
    font-size: 0.94rem;
    line-height: 1.35;
}

.nav-tile-arrow {
    margin-left: auto;
    color: var(--nav-muted);
    opacity: 0.85;
}

.nav-tile-details {
    display: grid;
    gap: 0.55rem;
    margin-top: auto;
    padding: 0 0.15rem 0.2rem;
}

.nav-tile-details-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    background: var(--surface-soft);
    font-weight: 700;
    color: var(--nav-text);
}

.nav-tile-details-summary::-webkit-details-marker {
    display: none;
}

.nav-tile-chevron {
    font-size: 0.74rem;
    opacity: 0.8;
}

.nav-tile-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}

.nav-tile-child-item .nav-tile-link {
    padding: 0.75rem 0.85rem;
    box-shadow: none;
}

.nav-tile-child-item .nav-tile-copy strong {
    font-size: 0.96rem;
}

.nav-shell-tiles {
    padding: 0.35rem 0 0;
}

.home-dashboard {
    display: grid;
    gap: 1.25rem;
}

.home-dashboard-hero {
    display: grid;
    gap: 0.65rem;
    padding: 1.25rem 1.4rem;
    border-radius: 24px;
    border: 1px solid var(--surface-border);
    background:
        radial-gradient(circle at top right, rgba(39, 119, 181, 0.14), transparent 18rem),
        linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 86%, var(--surface-soft)), var(--surface-bg));
    box-shadow: var(--surface-shadow);
}

.home-dashboard-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.02;
}

.home-dashboard-hero p {
    margin: 0;
    color: var(--nav-muted);
    max-width: 58rem;
}

.home-dashboard-eyebrow {
    color: var(--nav-accent);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    font-weight: 800;
}

.home-dashboard-user {
    color: var(--page-text);
    font-weight: 600;
}

.nav-shell-sidebar {
    display: block;
}

.auth-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    line-height: 1;
}

.auth-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.auth-menu-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font: inherit;
    padding: 0.4rem 0.1rem;
    line-height: 1;
}

.auth-menu-trigger-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-menu-trigger-alert {
    color: var(--shell-attention-color);
    font-size: 0.78rem;
    line-height: 1;
}

.auth-menu-chevron {
    font-size: 0.75rem;
    line-height: 1;
    opacity: 0.9;
    transition: transform 0.15s ease;
}

.auth-menu.is-open .auth-menu-chevron {
    transform: rotate(180deg);
}

.auth-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    min-width: 17rem;
    display: grid;
    gap: 0.6rem;
    padding: 0.65rem;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--dropdown-bg);
    color: var(--dropdown-text);
    box-shadow: var(--surface-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.35rem);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 1510;
}

.auth-menu.is-open .auth-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.auth-menu-settings {
    display: grid;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.auth-menu-settings-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--dropdown-text);
    font-weight: 700;
}

.auth-menu-settings-summary::-webkit-details-marker {
    display: none;
}

.auth-menu-settings-chevron {
    font-size: 0.78rem;
    line-height: 1;
    opacity: 0.85;
    transition: transform 0.15s ease;
}

.auth-menu-settings[open] .auth-menu-settings-chevron {
    transform: rotate(180deg);
}

.auth-menu-settings-content {
    display: grid;
    gap: 0.6rem;
}

.auth-menu-settings-callout {
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--nav-accent) 22%, var(--surface-border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--nav-accent) 12%, var(--surface-bg)), var(--surface-soft));
    color: var(--dropdown-text);
    font-size: 0.84rem;
    line-height: 1.35;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.auth-menu-settings-callout strong {
    color: var(--nav-accent);
}

.theme-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 600;
    pointer-events: none;
}

.shell-preference-row {
    display: grid;
    gap: 0.45rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background: var(--surface-soft);
    font-weight: 600;
    box-sizing: border-box;
}

.shell-preference-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-left: 0.2rem;
    min-width: 0;
    flex: 1 1 auto;
    pointer-events: none;
}

.shell-preference-select {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    background: var(--surface-bg);
    color: var(--dropdown-text);
    font: inherit;
    box-sizing: border-box;
}

.help-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--nav-muted);
    cursor: help;
    line-height: 1;
    flex: 0 0 auto;
    opacity: 0.9;
    pointer-events: auto;
}

.shell-switch {
    pointer-events: auto;
}

.help-hint:hover {
    color: var(--nav-accent);
    opacity: 1;
}

.shell-switch {
    --switch-width: 2.2rem;
    --switch-height: 1.2rem;
    --switch-padding: 0.12rem;
    --switch-knob-size: calc(var(--switch-height) - (var(--switch-padding) * 2));
    --switch-knob-translate: calc(var(--switch-width) - (var(--switch-padding) * 2) - var(--switch-knob-size));
    appearance: none;
    position: relative;
    width: var(--switch-width);
    height: var(--switch-height);
    border-radius: 999px;
    border: 0;
    background: var(--switch-track);
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.12s ease;
}

.shell-switch::after {
    content: "";
    position: absolute;
    top: 50%;
    left: var(--switch-padding);
    width: var(--switch-knob-size);
    height: var(--switch-knob-size);
    border-radius: 50%;
    background: var(--switch-knob);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
    transform: translateY(-50%);
    transition: transform 0.18s ease;
}

.shell-switch:checked {
    background: var(--switch-track-active);
}

.shell-switch:checked::after {
    transform: translate(var(--switch-knob-translate), -50%);
}

.shell-switch:hover {
    transform: translateY(-1px);
}

.shell-switch:active {
    transform: translateY(0);
}

.shell-switch:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--switch-track-active) 20%, transparent);
}

.auth-menu-link {
    display: block;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--dropdown-text);
    background: var(--surface-soft);
    font-weight: 600;
    box-sizing: border-box;
    line-height: 1;
}

.auth-menu-link:hover {
    background: var(--surface-alt);
}

.device-management-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.input {
    min-width: 280px;
    padding: 0.5rem;
}

.todo-list {
    list-style: none;
    padding: 0;
}

.todo-list li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.todo-done {
    text-decoration: line-through;
    color: #6b7280;
}

.link-button {
    background: none;
    border: none;
    color: var(--link-color);
    cursor: pointer;
    padding: 0;
}

.error-text {
    color: #b91c1c;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui;
}

.app-table thead {
    background-color: var(--surface-soft);
}

.app-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid var(--surface-border);
    font-weight: 600;
}

.app-table td {
    padding: 10px;
    border-bottom: 1px solid var(--surface-border);
}

.app-table tbody tr:hover {
    background-color: var(--surface-soft);
}

.auth-page-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(39, 119, 181, 0.18), transparent 26rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 28rem),
        linear-gradient(180deg, var(--page-bg) 0%, var(--surface-soft) 100%);
}

.auth-page-header {
    padding: 1.5rem 2rem 0;
}

.auth-page-brand {
    display: inline-flex;
    flex-direction: column;
    gap: 0.2rem;
    color: inherit;
    text-decoration: none;
}

.auth-page-brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.auth-page-brand-subtitle {
    color: var(--nav-muted);
    font-size: 0.95rem;
}

.field-label-with-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    line-height: 1.2;
}

.auth-page-content {
    min-height: calc(100vh - 200px);
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    width: min(100%, 28rem);
    display: grid;
    gap: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
    text-align: center;
}

html[data-theme="dark"] .auth-card {
    background: rgba(15, 23, 42, 0.88);
}

.auth-card-wide {
    width: min(100%, 62rem);
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    align-items: start;
}

.auth-card-copy,
.auth-card-form {
    display: grid;
    gap: 1rem;
}

.auth-card-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.02;
}

.auth-card-copy h1:focus,
.auth-card-copy h1:focus-visible {
    outline: none;
    box-shadow: none;
}

.auth-card-copy p {
    margin: 0;
    color: var(--nav-muted);
}

.auth-eyebrow {
    margin: 0;
    color: var(--nav-accent);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    font-weight: 800;
}

.auth-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.auth-feature-list li {
    padding: 0.8rem 1rem;
    border-radius: 14px;
    background: var(--surface-alt);
    border: 1px solid var(--surface-border);
    font-weight: 600;
}

.auth-card-form .e-control-wrapper,
.auth-card-form .e-float-input {
    width: 100%;
}

.auth-card-form .e-input-group,
.auth-card-form .e-float-input {
    border-radius: 16px;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 3rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--surface-bg);
    color: var(--page-text);
    font: inherit;
}

.auth-input::placeholder {
    color: var(--nav-muted);
}

.auth-input:focus,
.auth-input:focus-visible {
    outline: none;
    border-color: var(--nav-accent);
    box-shadow: none;
}

.auth-validation-message {
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-button {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.95rem 1.1rem;
    border-radius: 16px !important;
    font-weight: 800 !important;
    font-size: 0.98rem;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.auth-button:hover {
    transform: translateY(-1px);
}

.auth-button:focus,
.auth-button:focus-visible {
    outline: none;
    box-shadow: none;
    transform: none;
}

.auth-button-primary {
    border: 1px solid rgba(39, 119, 181, 0.5) !important;
    background: linear-gradient(135deg, rgba(39, 119, 181, 1), rgba(29, 78, 216, 1)) !important;
    color: #fff !important;
    box-shadow: 0 14px 28px rgba(39, 119, 181, 0.28);
}

    .auth-button-primary:hover {
        box-shadow: 0 18px 34px rgba(39, 119, 181, 0.35), 0 0 0 1px rgba(39, 119, 181, 0.14);
    }

.auth-button-secondary {
    border: 1px solid var(--surface-border) !important;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 82%, white), var(--surface-soft)) !important;
    color: var(--page-text) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.auth-button-secondary:hover {
    border-color: color-mix(in srgb, var(--nav-accent) 28%, var(--surface-border)) !important;
    box-shadow:
        0 14px 28px rgba(15, 23, 42, 0.12),
        0 0 0 1px color-mix(in srgb, var(--nav-accent) 12%, transparent);
}

.auth-button[aria-disabled="true"],
.auth-button:disabled {
    opacity: 0.65;
    transform: none;
    pointer-events: none;
    box-shadow: none;
}

html[data-theme="dark"] .auth-button-primary {
    border-color: rgba(96, 165, 250, 0.45) !important;
    background:
        linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(29, 78, 216, 0.95)) !important;
    box-shadow: 0 14px 30px rgba(39, 119, 181, 0.32);
}

html[data-theme="dark"] .auth-button-secondary {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.98)) !important;
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.28);
}

.auth-divider {
    position: relative;
    text-align: center;
    color: var(--nav-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.auth-divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--surface-border);
}

.auth-divider span {
    position: relative;
    padding: 0 0.8rem;
}

.auth-form-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    text-align: center;
}

.auth-form-footer a {
    display: inline-flex;
    justify-content: center;
}

.auth-alert {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 600;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.2);
    color: #047857;
}

html[data-theme="dark"] .auth-alert-error {
    color: #fecaca;
}

html[data-theme="dark"] .auth-alert-success {
    color: #a7f3d0;
}

.feature-management-page {
    display: grid;
    gap: 1rem;
    width: 100%;
}

.feature-management-hero,
.feature-management-card {
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--surface-shadow);
    backdrop-filter: blur(14px);
}

html[data-theme="dark"] .feature-management-hero,
html[data-theme="dark"] .feature-management-card {
    background: rgba(15, 23, 42, 0.88);
}

.feature-management-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    flex-wrap: wrap;
}

.feature-management-hero-copy {
    display: grid;
    gap: 0.6rem;
    min-width: min(100%, 26rem);
    max-width: 44rem;
}

.feature-management-hero-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.02;
}

.feature-management-hero-copy p {
    margin: 0;
    color: var(--nav-muted);
}

.feature-management-eyebrow {
    margin: 0;
    color: var(--nav-accent);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    font-weight: 800;
}

.feature-management-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.feature-management-card-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-management-note {
    color: var(--nav-muted);
    font-size: 0.95rem;
}

.feature-management-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.feature-management-action-button {
    padding: 0.65rem 0.9rem !important;
    min-height: 2.25rem !important;
    font-size: 0.92rem !important;
    line-height: 1 !important;
}

.feature-management-input,
.feature-management-number {
    width: 100%;
    box-sizing: border-box;
    min-width: 7rem;
}

.feature-management-route,
.feature-management-policy {
    display: block;
}

.feature-management-file-input {
    display: none !important;
}

.feature-management-button-disabled {
    opacity: 0.65;
}

.auth-captcha-shell {
    display: grid;
    place-items: center;
    padding: 0.8rem;
    border-radius: 16px;
    border: 1px dashed var(--surface-border);
}

.auth-captcha-shell .frc-captcha {
    justify-self: center;
}

.auth-button-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.auth-button-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.auth-inline-actions {
    display: grid;
    gap: 0.75rem;
}

.auth-setup-block,
.auth-qr-block,
.auth-manual-key {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid var(--surface-border);
    background: var(--surface-soft);
}

.auth-section-title {
    margin: 0;
    font-weight: 800;
}

.auth-section-copy {
    margin: 0;
    color: var(--nav-muted);
}

.auth-manual-key span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--nav-muted);
}

.auth-manual-key strong {
    font-size: 1.05rem;
    word-break: break-all;
}

.auth-qr-image {
    width: min(100%, 16rem);
    border-radius: 16px;
    background: white;
    padding: 0.8rem;
    justify-self: center;
}

.ticket-page {
    display: grid;
    gap: 1rem;
}

.ticket-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 28px;
    border: 1px solid var(--surface-border);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 18rem),
        linear-gradient(180deg, color-mix(in srgb, var(--surface-bg) 90%, var(--surface-soft)), var(--surface-bg));
    box-shadow: var(--surface-shadow);
}

.ticket-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.ticket-eyebrow {
    margin: 0 0 0.4rem;
    color: var(--nav-accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 800;
}

.ticket-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.ticket-lead {
    margin: 0.6rem 0 0;
    color: var(--nav-muted);
    max-width: 56rem;
}

.ticket-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--nav-accent) 24%, var(--surface-border));
    background: var(--nav-active-bg);
    color: var(--nav-text);
    font-weight: 800;
    white-space: nowrap;
}

.ticket-alert {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px solid var(--surface-border);
    background: var(--surface-bg);
    box-shadow: var(--surface-shadow);
}

.ticket-alert.error {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(254, 242, 242, 0.92);
    color: #b91c1c;
}

.ticket-alert.success {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(240, 253, 244, 0.94);
    color: #166534;
}

html[data-theme="dark"] .ticket-alert.error {
    background: rgba(127, 29, 29, 0.72);
    color: #fecaca;
}

html[data-theme="dark"] .ticket-alert.success {
    background: rgba(20, 83, 45, 0.72);
    color: #dcfce7;
}

.ticket-empty {
    padding: 1.2rem 0.25rem;
    color: var(--nav-muted);
    font-weight: 600;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.1rem;
}

.ticket-field {
    display: grid;
    gap: 0.35rem;
}

.ticket-field > span,
.ticket-static-label {
    font-weight: 700;
    color: var(--page-text);
}

.ticket-input,
.ticket-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 2.85rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--surface-bg);
    color: var(--page-text);
    font: inherit;
}

.ticket-textarea {
    min-height: 10rem;
    resize: vertical;
}

.ticket-input:focus,
.ticket-input:focus-visible,
.ticket-textarea:focus,
.ticket-textarea:focus-visible {
    outline: none;
    border-color: var(--nav-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-accent) 14%, transparent);
}

.ticket-static-field {
    display: grid;
    gap: 0.35rem;
    padding: 0.2rem 0;
}

.ticket-static-value {
    min-height: 2.85rem;
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.ticket-help {
    font-size: 0.9rem;
    color: var(--nav-muted);
}

.ticket-attachment-list {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.35rem;
}

.ticket-attachment-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ticket-link-button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--nav-accent);
    font: inherit;
    padding: 0;
    cursor: pointer;
}

.ticket-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    background: var(--surface-soft);
    font-weight: 700;
}

.ticket-limited-note {
    padding: 0.9rem 1rem;
    border-radius: 18px;
    border: 1px dashed color-mix(in srgb, var(--nav-accent) 30%, var(--surface-border));
    background: color-mix(in srgb, var(--nav-accent) 8%, var(--surface-bg));
    color: var(--nav-muted);
}

.ticket-span-2 {
    grid-column: span 2;
}

.ticket-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.35rem;
}

.ticket-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ticket-button:hover {
    transform: translateY(-1px);
}

.ticket-button-secondary {
    background: var(--surface-soft);
    color: var(--page-text);
}

.ticket-button-primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 1), rgba(29, 78, 216, 1));
    color: #fff;
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
}

.ticket-button-primary:hover {
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

@media (max-width: 900px) {
    .sidebar {
        width: min(88vw, 280px);
    }

    .shell-toggle-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .top-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-bar-brand {
        width: 100%;
    }

    .shell-top-menu {
        display: none;
    }

    html[data-menu-layout="top"] .sidebar-backdrop {
        display: block;
    }

    .auth-menu-dropdown {
        right: auto;
        left: 0;
    }

    .auth-card-wide {
        grid-template-columns: 1fr;
    }

    .nav-tile-grid {
        grid-template-columns: 1fr;
    }

    .nav-tile {
        height: auto;
    }

    .nav-tile-link {
        min-height: 4.5rem;
    }

    .nav-tile-details {
        margin-top: 0;
    }

    .ticket-hero {
        grid-template-columns: 1fr;
    }

    .ticket-badge {
        justify-self: start;
    }

    .ticket-grid {
        grid-template-columns: 1fr;
    }

    .ticket-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .auth-page-header,
    .auth-page-content,
    .content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .shell-breadcrumbs {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .auth-card {
        text-align: center;
        padding: 1.4rem;
        border-radius: 22px;
    }

    .nav-shell-tiles {
        padding-top: 0;
    }

    .nav-tile-grid {
        gap: 0.8rem;
    }

    .nav-tile {
        padding: 0.85rem;
        border-radius: 20px;
    }

    .nav-tile-link {
        padding: 0.85rem 0.9rem;
    }

    .ticket-card {
        padding: 1rem;
        border-radius: 22px;
    }

    .ticket-actions {
        justify-content: stretch;
    }

    .ticket-button {
        width: 100%;
    }
}
