/* Sanisphere 1.0.0-alpha.1 – eigenständige, CSP-fähige Oberfläche */
:root {
    color-scheme: light;
    --font-ui: Helvetica, "Helvetica Neue", Arial, sans-serif;
    --color-page: #f2f6f7;
    --color-surface: #ffffff;
    --color-surface-soft: #f7fafb;
    --color-surface-raised: #ffffff;
    --color-text: #172a30;
    --color-text-muted: #53686f;
    --color-border: #d3dfe2;
    --color-border-strong: #afc1c5;
    --color-focus: #006f99;
    --color-accent: #1bbaa5;
    --color-accent-strong: #067168;
    --color-accent-soft: #ddf6f1;
    --color-info: #0098cb;
    --color-info-strong: #006f96;
    --color-info-soft: #e1f4fb;
    --color-danger: #e30613;
    --color-danger-strong: #b8121c;
    --color-danger-soft: #feeaec;
    --color-warning: #a35f00;
    --color-warning-soft: #fff2d9;
    --color-success: #087d56;
    --color-success-soft: #def5e9;
    /* Einsatzbereiche sind keine Erfolgs-/Fehlerzustaende. */
    --role-el: #e58a1f;
    --role-el-on: #26353a;
    --role-el-soft: #fff3e2;
    --role-vehicle: #c93a3a;
    --role-vehicle-on: #ffffff;
    --role-vehicle-soft: #fdecec;
    --role-uhs: #2f8a55;
    --role-uhs-solid: #2d8050;
    --role-uhs-on: #ffffff;
    --role-uhs-soft: #e9f6ee;
    --role-evt: #2b6da8;
    --role-evt-on: #ffffff;
    --role-evt-soft: #eaf2fa;
    /* BOS-Funkstatus: eigene Tokenfamilie, getrennt von Rollen und Meldungsarten. */
    --status-1: #72bf57;
    --status-2: #2e7d32;
    --status-3: #ffca28;
    --status-4: #d62828;
    --status-6: #435260;
    --status-7: #c9718d;
    --sidebar-bg: #26353a;
    --sidebar-bg-deep: #1c292d;
    --sidebar-text: #f4f9fa;
    --sidebar-muted: #b8c9cd;
    --sidebar-border: #3b4c51;
    --shadow-xs: 0 1px 2px rgba(20, 44, 51, 0.08);
    --shadow-sm: 0 6px 20px rgba(20, 44, 51, 0.08);
    --shadow-lg: 0 24px 70px rgba(11, 32, 38, 0.2);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --sidebar-width: 268px;
    --topbar-height: 76px;
    --content-max: 1600px;
    --transition: 160ms ease;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --color-page: #0f191c;
    --color-surface: #172429;
    --color-surface-soft: #1c2b30;
    --color-surface-raised: #1d2d32;
    --color-text: #edf5f6;
    --color-text-muted: #a9bdc1;
    --color-border: #344a50;
    --color-border-strong: #516a70;
    --color-focus: #4dcbea;
    --color-accent: #4bd5c3;
    --color-accent-strong: #58dfcd;
    --color-accent-soft: #153b39;
    --color-info: #47bde4;
    --color-info-strong: #63c9e9;
    --color-info-soft: #163843;
    --color-danger: #ff6570;
    --color-danger-strong: #ff828b;
    --color-danger-soft: #482229;
    --color-warning: #f0bb5a;
    --color-warning-soft: #43341d;
    --color-success: #57d5a4;
    --color-success-soft: #173c30;
    --role-el-soft: #3a2b17;
    --role-vehicle-soft: #402326;
    --role-uhs-soft: #1c3828;
    --role-evt-soft: #1d3144;
    --sidebar-bg: #26353a;
    --sidebar-bg-deep: #1c292d;
    --sidebar-text: #f4f9fa;
    --sidebar-muted: #b8c9cd;
    --sidebar-border: #3b4c51;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]),
    html[data-theme="system"] {
        color-scheme: dark;
        --color-page: #0f191c;
        --color-surface: #172429;
        --color-surface-soft: #1c2b30;
        --color-surface-raised: #1d2d32;
        --color-text: #edf5f6;
        --color-text-muted: #a9bdc1;
        --color-border: #344a50;
        --color-border-strong: #516a70;
        --color-focus: #4dcbea;
        --color-accent: #4bd5c3;
        --color-accent-strong: #58dfcd;
        --color-accent-soft: #153b39;
        --color-info: #47bde4;
        --color-info-strong: #63c9e9;
        --color-info-soft: #163843;
        --color-danger: #ff6570;
        --color-danger-strong: #ff828b;
        --color-danger-soft: #482229;
        --color-warning: #f0bb5a;
        --color-warning-soft: #43341d;
        --color-success: #57d5a4;
        --color-success-soft: #173c30;
        --role-el-soft: #3a2b17;
        --role-vehicle-soft: #402326;
        --role-uhs-soft: #1c3828;
        --role-evt-soft: #1d3144;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-page);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--color-page);
    color: var(--color-text);
}

body.no-scroll {
    overflow: hidden;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

body,
button,
input,
select,
textarea,
table {
    font-family: var(--font-ui);
}

button,
summary,
a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a {
    color: var(--color-info-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--color-accent-strong);
}

button {
    border: 0;
}

img,
svg {
    display: block;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

p {
    color: var(--color-text-muted);
}

:focus {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: 0;
}

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

::selection {
    background: var(--color-accent);
    color: #102428;
}

.icon,
.nav-icon,
.chevron,
.module-arrow,
.construction-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    fill: none;
    color: currentColor;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform var(--transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--color-accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.eyebrow-on-dark {
    color: #60ddcd;
}

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--color-accent-strong);
    color: #ffffff;
}

html[data-theme="dark"] .button-primary {
    background: #27a997;
    color: #071918;
}

.button-primary:hover {
    background: #06685f;
    color: #ffffff;
}

html[data-theme="dark"] .button-primary:hover {
    background: #55d7c5;
    color: #071918;
}

.button-block {
    width: 100%;
}

.icon-button {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.icon-button:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-soft);
    color: var(--color-text);
}

/* App shell */
.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow: hidden;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-right: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
}

.sidebar-head {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand {
    display: block;
    min-width: 0;
    flex: 1;
}

.brand img {
    width: 100%;
    max-width: 220px;
    height: auto;
}

.sidebar-close {
    display: none;
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
}

.sidebar :focus-visible {
    outline-color: #6ee7d6;
}

.sidebar-nav {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px 22px;
    scrollbar-color: #536469 transparent;
    scrollbar-width: thin;
}

.nav-group + .nav-group {
    margin-top: 17px;
}

.nav-group-label {
    margin: 0 10px 7px;
    color: var(--sidebar-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.nav-item {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
    padding: 9px 11px;
    border-radius: 9px;
    color: #dfe9eb;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.nav-item.is-active {
    background: rgba(27, 186, 165, 0.19);
    color: #ffffff;
}

.nav-item.is-active::before {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #4ed5c4;
    content: "";
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #aec3c7;
}

.nav-item:hover .nav-icon,
.nav-item.is-active .nav-icon {
    color: #57d7c7;
}

.nav-stage {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: #82969a;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-bg-deep);
    color: var(--sidebar-muted);
    font-size: 0.7rem;
}

.sidebar-footer span:first-child {
    color: #d9e5e7;
    font-weight: 700;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(5, 16, 19, 0.7);
    cursor: pointer;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.main-column {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--sidebar-width);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 10px max(clamp(20px, 2.5vw, 36px), env(safe-area-inset-right, 0px)) 10px max(clamp(20px, 2.5vw, 36px), env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    background: color-mix(in srgb, var(--color-surface) 94%, transparent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.topbar-start,
.topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-start {
    min-width: 0;
    gap: 14px;
}

.topbar-actions {
    flex: 0 0 auto;
    gap: 10px;
}

.sidebar-toggle {
    display: none;
}

.page-identity {
    min-width: 0;
}

.tenant-name {
    display: block;
    overflow: hidden;
    margin-bottom: 2px;
    color: var(--color-text-muted);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.page-identity h1 {
    overflow: hidden;
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 3px 8px 3px 3px;
}

.avatar {
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border-strong);
    border: 1px solid color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
    border-radius: 12px;
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.user-text {
    display: flex;
    max-width: 190px;
    min-width: 0;
    flex-direction: column;
}

.user-text strong,
.user-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-text strong {
    color: var(--color-text);
    font-size: 0.84rem;
}

.user-text small {
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.logout-form {
    display: flex;
}

.content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: clamp(20px, 2.5vw, 36px) max(clamp(20px, 2.5vw, 36px), env(safe-area-inset-right, 0px)) calc(clamp(28px, 3vw, 44px) + env(safe-area-inset-bottom, 0px)) max(clamp(20px, 2.5vw, 36px), env(safe-area-inset-left, 0px));
}

.content.content-wide,
.content.content-full {
    max-width: none;
}

/* Theme selector */
.theme-menu {
    position: relative;
}

.theme-menu > summary {
    list-style: none;
}

.theme-menu > summary::-webkit-details-marker {
    display: none;
}

.theme-menu-trigger {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    user-select: none;
}

.theme-menu-trigger:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.theme-menu[open] .theme-menu-trigger {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.theme-menu[open] .chevron {
    transform: rotate(180deg);
}

.theme-menu-trigger .icon,
.theme-menu-trigger .chevron {
    width: 1.05rem;
    height: 1.05rem;
}

.theme-menu-trigger .chevron {
    transition: transform var(--transition);
}

.theme-popover {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 180;
    width: min(238px, calc(100vw - 24px));
    padding: 7px;
    border: 1px solid var(--color-border);
    border-radius: 13px;
    background: var(--color-surface-raised);
    box-shadow: var(--shadow-lg);
}

.theme-popover button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    text-align: left;
}

.theme-popover button:hover,
.theme-popover button.is-selected {
    background: var(--color-accent-soft);
    color: var(--color-text);
}

.theme-popover button.is-selected::after {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--color-accent-strong);
    content: "";
}

.theme-popover button > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.theme-popover strong {
    font-size: 0.8rem;
}

.theme-popover small {
    color: var(--color-text-muted);
    font-size: 0.68rem;
}

/* Generic feedback */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    color: var(--color-text);
    font-size: 0.88rem;
}

.alert > .icon {
    margin-top: 1px;
}

.alert > span {
    flex: 1;
}

.alert > button {
    padding: 0 3px;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.alert-info {
    border-color: color-mix(in srgb, var(--color-info) 35%, var(--color-border));
    background: var(--color-info-soft);
    color: var(--color-info-strong);
}

.alert-success {
    border-color: color-mix(in srgb, var(--color-success) 35%, var(--color-border));
    background: var(--color-success-soft);
    color: var(--color-success);
}

.alert-warning {
    border-color: color-mix(in srgb, var(--color-warning) 35%, var(--color-border));
    background: var(--color-warning-soft);
    color: var(--color-warning);
}

.alert-danger {
    border-color: color-mix(in srgb, var(--color-danger) 35%, var(--color-border));
    background: var(--color-danger-soft);
    color: var(--color-danger-strong);
}

/* Operational color language. Text and icon labels remain mandatory. */
.role-el,
.role-einsatzleitung,
.duty-section-einsatzleitung,
[data-role-color="el"],
[data-role-color="einsatzleitung"] {
    --role-accent: var(--role-el);
    --role-fill: var(--role-el);
    --role-on-color: var(--role-el-on);
    --role-surface: var(--role-el-soft);
}

.role-vehicle,
.role-rettungsmittel,
.duty-section-rettungsmittel,
[data-role-color="vehicle"],
[data-role-color="rettungsmittel"] {
    --role-accent: var(--role-vehicle);
    --role-fill: var(--role-vehicle);
    --role-on-color: var(--role-vehicle-on);
    --role-surface: var(--role-vehicle-soft);
}

.role-uhs,
.role-unfallhilfestelle,
.duty-section-unfallhilfestelle,
[data-role-color="uhs"],
[data-role-color="unfallhilfestelle"] {
    --role-accent: var(--role-uhs);
    --role-fill: var(--role-uhs-solid);
    --role-on-color: var(--role-uhs-on);
    --role-surface: var(--role-uhs-soft);
}

.role-evt,
.role-erstversorgungsteam,
.duty-section-erstversorgungsteam,
[data-role-color="evt"],
[data-role-color="erstversorgungsteam"] {
    --role-accent: var(--role-evt);
    --role-fill: var(--role-evt);
    --role-on-color: var(--role-evt-on);
    --role-surface: var(--role-evt-soft);
}

.role-panel,
.role-strip {
    border-inline-start: 4px solid var(--role-accent, var(--sidebar-bg));
    background: var(--role-surface, var(--color-surface-soft));
}

.role-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 7px;
    background: var(--role-fill, var(--sidebar-bg));
    color: var(--role-on-color, #ffffff);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

[data-status="1"] { --status-color: var(--status-1); }
[data-status="2"] { --status-color: var(--status-2); }
[data-status="3"] { --status-color: var(--status-3); }
[data-status="4"] { --status-color: var(--status-4); }
[data-status="6"] { --status-color: var(--status-6); }
[data-status="7"] { --status-color: var(--status-7); }

.status-color-rail {
    border-inline-start: 4px solid var(--status-color, var(--color-border-strong));
}

/* Dashboard */
.page-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.page-intro > div {
    max-width: 830px;
}

.page-intro h2 {
    margin-bottom: 9px;
    font-size: clamp(1.65rem, 3vw, 2.2rem);
}

.page-intro p {
    max-width: 760px;
    margin-bottom: 0;
    font-size: 0.96rem;
}

.compact-intro {
    margin-bottom: 30px;
}

.status-badge {
    display: inline-flex;
    min-height: 30px;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-development {
    border-color: color-mix(in srgb, var(--color-info) 38%, var(--color-border));
    background: var(--color-info-soft);
    color: var(--color-info-strong);
}

.status-development > span {
    background: var(--color-info);
}

.status-ready {
    border-color: color-mix(in srgb, var(--color-success) 38%, var(--color-border));
    background: var(--color-success-soft);
    color: var(--color-success);
}

.status-ready > span {
    background: var(--color-success);
}

.notice-panel {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 24px;
    padding: 17px 19px;
    border: 1px solid color-mix(in srgb, var(--color-accent) 35%, var(--color-border));
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
}

.notice-icon {
    display: flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-accent-strong);
    box-shadow: var(--shadow-xs);
}

.notice-panel strong {
    display: block;
    margin-bottom: 2px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.notice-panel p {
    margin: 0;
    font-size: 0.82rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.metric-icon {
    display: flex;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.metric-card > div:last-child {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    column-gap: 10px;
}

.metric-card span {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card strong {
    grid-row: 1 / span 2;
    grid-column: 2;
    color: var(--color-text);
    font-size: 1.8rem;
    line-height: 1;
}

.metric-card small {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 0.67rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-primary .metric-icon {
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
}

.metric-info .metric-icon {
    background: var(--color-info-soft);
    color: var(--color-info-strong);
}

.metric-neutral .metric-icon {
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
}

.metric-danger .metric-icon {
    background: var(--color-danger-soft);
    color: var(--color-danger-strong);
}

.content-card {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.card-padded {
    padding: 22px;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 22px 18px;
    border-bottom: 1px solid var(--color-border);
}

.card-heading h2 {
    margin-bottom: 5px;
    font-size: 1.16rem;
}

.card-heading p {
    margin: 0;
    font-size: 0.8rem;
}

.account-details > summary {
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.account-details > summary::-webkit-details-marker {
    display: none;
}

.account-details > summary > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.account-summary-meta {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.account-disclosure {
    width: 1rem;
    height: 1rem;
    color: var(--color-text-muted);
    transition: transform var(--transition);
}

.account-details[open] .account-disclosure {
    transform: rotate(180deg);
}

.compact-heading {
    padding: 0 0 17px;
}

.compact-heading .eyebrow {
    margin-bottom: 5px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-card {
    position: relative;
    display: grid;
    min-width: 0;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 4px 13px;
    padding: 18px 20px;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    transition: background-color var(--transition);
}

.module-card:nth-child(3n) {
    border-right: 0;
}

.module-card:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.module-card:hover {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.module-icon {
    display: flex;
    width: 42px;
    height: 42px;
    grid-row: 1 / span 2;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
}

.module-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.module-copy strong {
    margin-bottom: 2px;
    font-size: 0.88rem;
}

.module-copy small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.module-stage {
    align-self: end;
    color: var(--color-info-strong);
    font-size: 0.64rem;
    font-weight: 700;
}

.module-arrow {
    width: 1.05rem;
    height: 1.05rem;
    grid-row: 1 / span 2;
    grid-column: 3;
    color: var(--color-text-muted);
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    gap: 18px;
    margin-top: 18px;
}

.status-list {
    display: grid;
    gap: 13px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.status-list li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-list li > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow-wrap: anywhere;
}

.status-list strong {
    color: var(--color-text);
    font-size: 0.82rem;
}

.status-list small {
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.status-check {
    display: flex;
    width: 31px;
    height: 31px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-success-soft);
    color: var(--color-success);
}

.status-check .icon {
    width: 0.95rem;
    height: 0.95rem;
}

.status-check-neutral {
    background: var(--color-info-soft);
    color: var(--color-info-strong);
}

.next-step-card {
    position: relative;
    isolation: isolate;
}

.next-step-card::after {
    position: absolute;
    z-index: -1;
    right: -60px;
    bottom: -80px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: var(--color-info-soft);
    content: "";
}

.next-step-card h2 {
    margin-bottom: 9px;
    font-size: 1.15rem;
}

.next-step-card p {
    font-size: 0.8rem;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-accent-strong);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.text-link .icon {
    width: 1rem;
    height: 1rem;
}

.empty-activity {
    display: flex;
    min-height: 128px;
    align-items: center;
    justify-content: center;
    gap: 13px;
    padding: 20px;
    border: 1px dashed var(--color-border-strong);
    border-radius: 11px;
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
    text-align: left;
}

.empty-activity > .icon {
    width: 1.8rem;
    height: 1.8rem;
    color: var(--color-info-strong);
}

.empty-activity > div {
    display: flex;
    flex-direction: column;
}

.empty-activity strong {
    color: var(--color-text);
    font-size: 0.84rem;
}

.empty-activity small {
    font-size: 0.7rem;
}

.activity-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

.activity-list li:last-child {
    border-bottom: 0;
}

.activity-mark {
    width: 9px;
    height: 9px;
    border: 2px solid var(--color-surface);
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 0 2px var(--color-accent-soft);
}

.activity-list li > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.activity-list strong,
.activity-list small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-list strong {
    color: var(--color-text);
    font-size: 0.78rem;
}

.activity-list small,
.activity-list time {
    color: var(--color-text-muted);
    font-size: 0.67rem;
}

.activity-list time {
    white-space: nowrap;
}

.system-facts {
    display: grid;
    gap: 9px;
    margin: 18px 0 0;
}

.system-facts > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.system-facts > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.system-facts dt,
.system-facts dd {
    margin: 0;
    font-size: 0.74rem;
}

.system-facts dt {
    color: var(--color-text-muted);
}

.system-facts dd {
    min-width: 0;
    color: var(--color-text);
    font-weight: 700;
    overflow-wrap: anywhere;
    text-align: right;
}

/* Module placeholder */
.placeholder-card {
    display: grid;
    min-height: 400px;
    grid-template-columns: minmax(250px, 0.75fr) minmax(340px, 1.25fr);
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.placeholder-illustration {
    position: relative;
    display: flex;
    min-height: 340px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 35%, color-mix(in srgb, var(--color-accent) 30%, transparent) 0 10%, transparent 32%),
        linear-gradient(140deg, var(--color-accent-soft), var(--color-info-soft));
}

.placeholder-illustration::before,
.placeholder-illustration::after {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--color-accent) 28%, transparent);
    border-radius: 50%;
    content: "";
}

.placeholder-illustration::before {
    width: 260px;
    height: 260px;
}

.placeholder-illustration::after {
    width: 350px;
    height: 350px;
}

.placeholder-illustration > span {
    position: relative;
    z-index: 2;
    display: flex;
    width: 112px;
    height: 112px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--color-accent) 45%, var(--color-border));
    border-radius: 31px;
    background: var(--color-surface);
    color: var(--color-accent-strong);
    box-shadow: var(--shadow-lg);
}

.placeholder-illustration > span .icon {
    width: 3.3rem;
    height: 3.3rem;
}

.construction-icon {
    position: absolute;
    z-index: 3;
    right: calc(50% - 75px);
    bottom: calc(50% - 66px);
    width: 42px;
    height: 42px;
    padding: 9px;
    border-radius: 13px;
    background: var(--color-info-strong);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.placeholder-copy {
    display: flex;
    max-width: 650px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(34px, 6vw, 76px);
}

.placeholder-copy h2 {
    margin-bottom: 13px;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.placeholder-copy p {
    margin-bottom: 25px;
}

.placeholder-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.development-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--color-text-muted);
    font-size: 0.72rem;
}

.development-note .icon {
    width: 1rem;
    height: 1rem;
}

/* Forms */
.form-field {
    display: grid;
    gap: 7px;
}

.form-field + .form-field {
    margin-top: 17px;
}

.form-field label,
.label-row {
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 700;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--color-border-strong);
    border-radius: 10px;
    outline: 0;
    background: var(--color-surface-soft);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--color-focus);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 18%, transparent);
}

/* Login */
.auth-page {
    background: var(--color-page);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(380px, 0.92fr) minmax(500px, 1.08fr);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    overflow: hidden;
    padding: clamp(36px, 6vw, 86px);
    background:
        radial-gradient(circle at 15% 12%, rgba(0, 152, 203, 0.26), transparent 27%),
        radial-gradient(circle at 85% 80%, rgba(27, 186, 165, 0.22), transparent 30%),
        linear-gradient(145deg, #26353a 0%, #19272b 72%);
    color: #ffffff;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
    position: absolute;
    border: 1px solid rgba(132, 218, 217, 0.14);
    border-radius: 50%;
    content: "";
}

.auth-brand-panel::before {
    top: -170px;
    right: -210px;
    width: 540px;
    height: 540px;
}

.auth-brand-panel::after {
    right: -90px;
    bottom: -200px;
    width: 480px;
    height: 480px;
}

.auth-logo {
    position: relative;
    z-index: 1;
    width: min(330px, 82%);
    height: auto;
}

.auth-claim {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: auto 0;
    padding: 70px 0;
}

.auth-claim h1 {
    margin-bottom: 22px;
    color: #ffffff;
    font-size: clamp(2.2rem, 4.6vw, 4.4rem);
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.auth-claim p {
    max-width: 590px;
    margin-bottom: 0;
    color: #c7d7da;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.auth-trust-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 13px 24px;
    color: #d3e0e2;
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-trust-list span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-trust-list .icon {
    width: 1.08rem;
    height: 1.08rem;
    color: #51d6c5;
}

.auth-version {
    position: absolute;
    right: clamp(28px, 5vw, 68px);
    bottom: clamp(34px, 6vw, 82px);
    z-index: 1;
    margin: 0;
    color: #93a8ad;
    font-size: 0.68rem;
}

.auth-form-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: clamp(34px, 7vw, 100px);
}

.auth-theme-position {
    position: absolute;
    top: 25px;
    right: 27px;
}

.auth-card {
    width: min(100%, 440px);
}

.auth-card-heading {
    margin-bottom: 28px;
}

.auth-card-heading h2 {
    margin-bottom: 8px;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.auth-card-heading p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.auth-card .button {
    margin-top: 23px;
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    margin: 17px 0 0;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    text-align: center;
}

.privacy-note .icon {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--color-accent-strong);
}

/* Update and error */
.utility-page {
    background:
        radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--color-info) 12%, transparent), transparent 26%),
        radial-gradient(circle at 92% 92%, color-mix(in srgb, var(--color-accent) 11%, transparent), transparent 28%),
        var(--color-page);
}

.utility-shell {
    width: min(100% - 32px, 820px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding: 30px 0 60px;
}

.utility-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--sidebar-bg);
    box-shadow: var(--shadow-sm);
}

.utility-head > img {
    width: 230px;
    max-width: calc(100% - 100px);
    height: auto;
}

.theme-menu-on-dark .theme-menu-trigger {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #e8f1f2;
}

.utility-card {
    position: relative;
    overflow: hidden;
    padding: clamp(34px, 7vw, 68px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.utility-icon {
    display: flex;
    width: 70px;
    height: 70px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 23px;
    border-radius: 20px;
}

.utility-icon .icon {
    width: 2rem;
    height: 2rem;
}

.utility-icon-idle {
    background: var(--color-info-soft);
    color: var(--color-info-strong);
}

.utility-icon-success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.utility-icon-error {
    background: var(--color-danger-soft);
    color: var(--color-danger-strong);
}

.utility-card h1 {
    margin-bottom: 12px;
    font-size: clamp(1.7rem, 4vw, 2.45rem);
}

.utility-card > p {
    max-width: 590px;
    margin-right: auto;
    margin-bottom: 25px;
    margin-left: auto;
}

.update-summary {
    margin: 26px 0;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface-soft);
    text-align: left;
}

.update-summary > strong {
    display: block;
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 0.84rem;
}

.update-summary ul {
    display: grid;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.update-summary li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.update-summary li .icon {
    width: 1rem;
    height: 1rem;
    color: var(--color-info-strong);
}

.status-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 24px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-line-success {
    background: var(--color-success-soft);
    color: var(--color-success);
}

.status-line .icon {
    width: 1rem;
    height: 1rem;
}

.utility-back {
    justify-content: center;
    margin-top: 24px;
}

.utility-back .icon-back {
    transform: rotate(180deg);
}

.error-code {
    position: absolute;
    top: -30px;
    right: 15px;
    color: var(--color-surface-soft);
    font-size: 9rem;
    font-weight: 700;
    letter-spacing: -0.08em;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.error-card > *:not(.error-code) {
    position: relative;
}

.reference-box {
    display: inline-grid;
    gap: 3px;
    margin: 0 auto 26px;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface-soft);
}

.reference-box span {
    color: var(--color-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reference-box code {
    color: var(--color-text);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.utility-footnote {
    margin-top: 20px;
    margin-bottom: 0 !important;
    font-size: 0.7rem;
}

/* Installation */
.installer-page {
    background:
        radial-gradient(circle at 0 0, color-mix(in srgb, var(--color-info) 11%, transparent), transparent 27%),
        radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 30%),
        var(--color-page);
}

.installer-shell {
    width: min(100% - 36px, 1120px);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) 0 80px;
}

.installer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.installer-header h1 {
    margin-bottom: 8px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.installer-header p:last-child {
    margin-bottom: 0;
}

.theme-options {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 11px;
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.theme-options button {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 7px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.theme-options button:hover,
.theme-options button.is-selected,
.theme-options button[aria-pressed="true"] {
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
}

.theme-options-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    box-shadow: var(--shadow-xs);
}

.card-body {
    padding: clamp(20px, 3.5vw, 32px);
}

.card-body > h1,
.card-body > h2 {
    margin-bottom: 18px;
}

.installer-form {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.form-section {
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 19px;
    border-bottom: 1px solid var(--color-border);
}

.section-heading h2 {
    margin-bottom: 4px;
    font-size: 1.15rem;
}

.section-heading p {
    margin-bottom: 0;
    font-size: 0.78rem;
}

.step-number {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.field-wide {
    grid-column: 1 / -1;
}

.field > span {
    color: var(--color-text);
    font-size: 0.77rem;
    font-weight: 700;
}

.field > small {
    color: var(--color-text-muted);
    font-size: 0.67rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 47px;
    padding: 10px 13px;
    border: 1px solid var(--color-border-strong);
    border-radius: 9px;
    outline: 0;
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--color-focus);
    background: var(--color-surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 18%, transparent);
}

.field input[readonly] {
    border-style: dashed;
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.requirement-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.requirement {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface-soft);
    font-size: 0.73rem;
}

.requirement span {
    overflow: hidden;
    color: var(--color-text-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.requirement strong {
    font-size: 0.7rem;
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger-strong);
}

.installer-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}

.installer-page .alert ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.installer-page .alert {
    display: block;
}

.technical-reference {
    display: inline-block;
    padding: 8px 11px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-soft);
    color: var(--color-text-muted);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
    overflow-wrap: anywhere;
}

.auth-shell > .auth-card:only-child {
    width: min(100% - 36px, 560px);
    align-self: center;
    justify-self: center;
    grid-column: 1 / -1;
    padding: clamp(30px, 6vw, 58px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
}

.auth-shell > .auth-card:only-child .button {
    background: var(--color-accent-strong);
    color: #ffffff;
}

html[data-theme="dark"] .auth-shell > .auth-card:only-child .button {
    background: #27a997;
    color: #071918;
}

/* Responsive behavior */
@media (max-width: 1280px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .module-card:nth-child(3n) {
        border-right: 1px solid var(--color-border);
    }

    .module-card:nth-child(2n) {
        border-right: 0;
    }

    .module-card:nth-last-child(-n + 3) {
        border-bottom: 1px solid var(--color-border);
    }

    .module-card:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .auth-shell {
        grid-template-columns: minmax(360px, 0.86fr) minmax(450px, 1.14fr);
    }

    .auth-brand-panel {
        padding: 48px;
    }
}

@media (max-width: 1099px) {
    .sidebar {
        width: min(88vw, var(--sidebar-width));
        box-shadow: var(--shadow-lg);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }

    .sidebar-is-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-close,
    .sidebar-toggle {
        display: inline-flex;
    }

    .main-column {
        margin-left: 0;
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        grid-template-columns: minmax(320px, 0.72fr) minmax(420px, 1fr);
    }

    .auth-brand-panel {
        padding: 38px;
    }

    .auth-claim h1 {
        font-size: clamp(2rem, 5vw, 3.4rem);
    }

    .auth-trust-list {
        flex-direction: column;
    }

    .auth-version {
        display: none;
    }
}

@media (max-width: 820px) {
    .topbar {
        min-height: 72px;
        padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    }

    .content {
        padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(38px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    }

    .user-text,
    .theme-label {
        display: none;
    }

    .user-summary {
        padding-right: 0;
    }

    .theme-menu-trigger {
        width: 44px;
        justify-content: center;
        padding: 8px;
    }

    .theme-menu-trigger .chevron {
        display: none;
    }

    .page-intro {
        flex-direction: column;
        gap: 15px;
    }

    .placeholder-card {
        grid-template-columns: 1fr;
    }

    .placeholder-illustration {
        min-height: 260px;
    }

    .placeholder-copy {
        max-width: none;
    }

    .auth-shell {
        display: block;
    }

    .auth-brand-panel {
        min-height: 340px;
        padding: 30px 28px;
    }

    .auth-logo {
        width: min(280px, 78%);
    }

    .auth-claim {
        margin: auto 0 0;
        padding: 50px 0 8px;
    }

    .auth-claim h1 {
        max-width: 580px;
        margin-bottom: 12px;
        font-size: clamp(2rem, 8vw, 3.1rem);
    }

    .auth-claim p {
        font-size: 0.9rem;
    }

    .auth-trust-list {
        display: none;
    }

    .auth-form-panel {
        min-height: 0;
        padding: 70px 24px 52px;
    }

    .auth-theme-position {
        top: 18px;
        right: 20px;
    }

    .installer-header {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-options {
        align-self: flex-start;
    }

    .requirement-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .topbar-actions {
        gap: 5px;
    }

    .avatar {
        width: 38px;
        height: 38px;
    }

    .logout-form .icon-button {
        width: 44px;
        height: 44px;
    }

    .metrics-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 16px;
    }

    .module-card,
    .module-card:nth-child(2n),
    .module-card:nth-child(3n),
    .module-card:nth-last-child(-n + 2),
    .module-card:nth-last-child(-n + 3) {
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .module-card:last-child {
        border-bottom: 0;
    }

    .module-stage {
        display: none;
    }

    .card-heading {
        padding: 18px;
    }

    .placeholder-copy {
        padding: 30px 24px 36px;
    }

    .placeholder-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .utility-shell {
        width: min(100% - 22px, 820px);
        padding-top: 12px;
    }

    .utility-head {
        margin-bottom: 12px;
        padding: 8px 11px;
    }

    .utility-card {
        padding: 34px 20px;
    }

    .error-code {
        top: -14px;
        font-size: 6.2rem;
    }

    .installer-shell {
        width: min(100% - 22px, 1120px);
        padding-top: 24px;
    }

    .form-grid,
    .requirement-grid {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .installer-actions .button {
        width: 100%;
    }

    .theme-options-floating {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 430px) {
    .tenant-name {
        max-width: 150px;
    }

    .page-identity h1 {
        max-width: 160px;
    }

    .user-summary {
        display: none;
    }

    .auth-brand-panel {
        min-height: 305px;
        padding: 24px 22px;
    }

    .auth-form-panel {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --color-border: #8ca0a5;
        --color-border-strong: #60777d;
    }

    html[data-theme="dark"] {
        --color-border: #6f858a;
        --color-border-strong: #9bb0b4;
    }

    .nav-item.is-active {
        box-shadow: inset 0 0 0 2px #6ee7d6;
    }
}

@media (forced-colors: active) {
    .nav-item.is-active,
    .role-badge,
    .status-badge,
    .button-primary {
        border: 2px solid currentColor;
    }

    .nav-item.is-active::before,
    .nav-stage,
    .status-badge > span {
        forced-color-adjust: none;
    }
}

@media print {
    .sidebar,
    .topbar,
    .theme-menu,
    .sidebar-overlay,
    .button,
    .nav-stage {
        display: none !important;
    }

    .main-column {
        margin: 0;
    }

    .content {
        max-width: none;
        padding: 0;
    }

    body,
    .content-card,
    .metric-card {
        background: #ffffff;
        color: #000000;
        box-shadow: none;
    }

    .role-badge,
    .role-panel,
    .role-strip,
    .status-color-rail {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
