@font-face {
    font-family: "Material Design Icons";
    src: url("/assets/materialdesignicons-webfont.ttf") format("truetype");
    font-style: normal;
    font-weight: normal;
    font-display: block;
}

:root {
    color-scheme: light;
    --navy: #0d5b9d;
    --navy-dark: #0b3f75;
    --blue: #1788d6;
    --blue-soft: #e8f4ff;
    --orange: #ff9f1a;
    --orange-dark: #e98500;
    --orange-soft: #fff1dc;
    --green: #155724;
    --green-soft: #d4edda;
    --red: #721c24;
    --red-soft: #f8d7da;
    --text: #152238;
    --muted: #6b7c93;
    --border: #d8e8f7;
    --surface: #ffffff;
    --surface-alt: #f4f9ff;
    --field: #ffffff;
    --background: #f4f9ff;
    --code-text: #31566f;
    --shadow: 0 20px 50px rgba(13, 91, 157, .14);
    --shadow-sm: 0 8px 24px rgba(13, 91, 157, .1);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
}
.theme-ClassicWhite {
    color-scheme: light;
    --navy: #475569;
    --navy-dark: #334155;
    --blue: #2563eb;
    --blue-soft: #e8eef5;
    --text: #111827;
    --muted: #64748b;
    --border: #e2e8f0;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --field: #ffffff;
    --background: #f8fafc;
    --code-text: #334155;
    --shadow: 0 20px 50px rgba(71, 85, 105, .12);
    --shadow-sm: 0 8px 24px rgba(71, 85, 105, .09);
}
.theme-BlueLight { color-scheme: light; }
.theme-Dark {
    color-scheme: dark;
    --navy: #0d4f80;
    --navy-dark: #08192a;
    --blue: #45b8ff;
    --blue-soft: #163a55;
    --orange: #ffb020;
    --orange-dark: #ffb020;
    --orange-soft: #3e321d;
    --green: #86f7b6;
    --green-soft: #173d2c;
    --red: #ffb4b4;
    --red-soft: #482629;
    --text: #f4faff;
    --muted: #b2c5d7;
    --border: #2a5d78;
    --surface: #0e2033;
    --surface-alt: #0b1726;
    --field: #142a43;
    --background: #0b1726;
    --code-text: #b9dcf5;
    --shadow: 0 20px 50px rgba(0, 0, 0, .35);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--background);
}
button, input, select { font: inherit; }
a { color: inherit; }
.mdi {
    display: inline-block;
    font-family: "Material Design Icons";
    font-size: 1.35em;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    vertical-align: -.12em;
    speak: never;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 10% 15%, rgba(255,159,26,.14), transparent 28%),
        radial-gradient(circle at 90% 85%, rgba(33,101,140,.14), transparent 30%),
        var(--background);
}
.auth-shell {
    width: min(1040px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px;
    overflow: hidden;
    color: white;
    background:
        linear-gradient(145deg, rgba(255,255,255,.04), transparent 45%),
        linear-gradient(135deg, var(--navy-dark), var(--navy) 65%, #1a4c6d);
}
.brand-panel::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -150px;
    bottom: -150px;
    border: 48px solid rgba(255,159,26,.13);
    border-radius: 50%;
}
.brand-mark {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border: 3px solid rgba(255,255,255,.9);
    border-radius: 21px;
    color: white;
    background: linear-gradient(145deg, var(--orange), var(--orange-dark));
    box-shadow: 0 12px 30px rgba(0,0,0,.2);
    font-size: 42px;
    font-weight: 800;
}
.brand-mark.small {
    width: 42px;
    height: 42px;
    border-width: 2px;
    border-radius: 12px;
    font-size: 24px;
}
.brand-logo {
    width: 82px;
    height: 82px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,.18));
}
.brand-logo.small {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,.16));
}
.brand-panel h1 {
    max-width: 500px;
    margin: 14px 0 18px;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.eyebrow {
    margin: 0;
    letter-spacing: .14em;
    font-size: 12px;
    font-weight: 800;
}
.eyebrow.accent { color: var(--orange-dark); }
.brand-copy {
    max-width: 460px;
    margin: 0;
    color: #c9d7e1;
    font-size: 17px;
    line-height: 1.65;
}
.brand-status, .live-badge, .online-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 650;
}
.status-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    background: #37d69c;
    box-shadow: 0 0 0 5px rgba(55,214,156,.14);
}
.auth-card {
    align-self: center;
    padding: 58px 52px;
}
.auth-card h2, .auth-card h1 {
    margin: 10px 0 8px;
    color: var(--navy);
    font-size: 34px;
    line-height: 1.2;
}
.muted { color: var(--muted); line-height: 1.55; }
.mobile-brand { display: none; }
.form-stack {
    display: grid;
    gap: 19px;
    margin-top: 30px;
}
.form-stack label { display: grid; gap: 8px; }
.form-stack label > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.required-fields-note {
    margin: -5px 0 -7px;
    color: var(--muted);
    font-size: 12px;
}
.required-mark {
    color: var(--red);
    font-style: normal;
    font-weight: 850;
}
.form-hint {
    margin: -8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
input {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: var(--field);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus {
    border-color: var(--blue);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(33,101,140,.11);
}
select {
    min-height: 48px;
    padding: 10px 40px 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: var(--field);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
select:focus {
    border-color: var(--blue);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(33,101,140,.11);
}
.primary-button {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    color: white;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    box-shadow: 0 9px 22px rgba(233,133,0,.22);
    cursor: pointer;
    font-weight: 750;
}
.primary-button:hover { filter: brightness(.98); transform: translateY(-1px); }
.security-note {
    margin: 24px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.alert {
    margin: 20px 0;
    padding: 13px 15px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.alert.error { color: #9e242a; border-color: #f0c4c6; background: var(--red-soft); }
.alert.warning { color: #80500b; border-color: #f2d29e; background: var(--orange-soft); }
.alert.success { color: #117552; border-color: #bfe5d6; background: var(--green-soft); }

.topbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 12px clamp(22px, 5vw, 72px);
    color: white;
    background: var(--navy);
    box-shadow: 0 4px 18px rgba(13,34,56,.16);
}
.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.topbar-brand > span:last-child { display: grid; }
.topbar-brand strong { font-size: 16px; }
.topbar-brand small { color: #b9cad6; font-size: 11px; }
.primary-nav {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    gap: 5px;
}
.primary-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.primary-nav a:hover { background: rgba(255,255,255,.12); }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-actions form { margin: 0; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-right: 8px;
    border-radius: 10px;
    text-decoration: none;
}
.user-chip:hover { background: rgba(255,255,255,.08); }
.user-chip > span:last-child { display: grid; }
.user-chip small { color: #bbccd7; font-size: 11px; }
.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--navy);
    background: var(--orange);
    font-weight: 800;
    text-transform: uppercase;
}
.avatar.image {
    display: block;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.55);
}
.ghost-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    color: white;
    background: rgba(255,255,255,.05);
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    gap: 7px;
}
.ghost-button:hover { background: rgba(255,255,255,.12); }
.mobile-nav {
    position: relative;
    display: none;
}
.mobile-nav summary {
    width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 0;
    list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav {
    position: absolute;
    z-index: 20;
    top: calc(100% + 10px);
    right: 0;
    width: min(270px, calc(100vw - 24px));
    display: grid;
    gap: 3px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.mobile-nav nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}
.mobile-nav nav a:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.dashboard {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 56px;
}
.content-page {
    width: min(1380px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 56px;
}
.content-page.narrow { width: min(860px, calc(100% - 40px)); }
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 28px;
}
.page-heading h1 {
    margin: 7px 0 4px;
    color: var(--navy);
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -.025em;
}
.page-heading p { margin: 0; }
.live-badge {
    padding: 10px 14px;
    border: 1px solid #bfe5d6;
    border-radius: 999px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 12px;
}
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}
.metric-card {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 6px 24px rgba(20,50,72,.055);
}
.metric-card > div:last-child { display: grid; gap: 4px; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { color: var(--navy); font-size: 27px; }
.metric-card strong.healthy { color: var(--green); font-size: 20px; }
.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-weight: 900;
    font-family: "Material Design Icons";
    font-size: 23px;
}
.metric-icon.devices { color: var(--blue); background: var(--blue-soft); }
.metric-icon.sessions { color: var(--orange-dark); background: var(--orange-soft); }
.metric-icon.database { color: var(--green); background: var(--green-soft); font-size: 23px; }
.panel {
    margin-top: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 6px 24px rgba(20,50,72,.045);
}
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 23px;
    border-bottom: 1px solid var(--border);
}
.panel-heading h2 { margin: 0 0 3px; color: var(--navy); font-size: 18px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.count-badge {
    min-width: 30px;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}
.count-badge.orange { color: var(--orange-dark); background: var(--orange-soft); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    font-size: 13px;
}
th {
    color: var(--muted);
    background: var(--surface-alt);
    font-size: 11px;
    letter-spacing: .045em;
    text-transform: uppercase;
}
tbody tr:last-child td { border-bottom: 0; }
code {
    padding: 3px 6px;
    border-radius: 5px;
    color: var(--code-text);
    background: var(--surface-alt);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 11px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
    padding: 3px 7px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 10px;
    font-weight: 700;
}
.os-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-weight: 700;
}
.os-badge .mdi {
    color: var(--blue);
    font-size: 18px;
}
.online-state { color: var(--green); font-size: 11px; }
.online-state span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}
.offline-state {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}
.offline-state span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
}
.empty-state {
    display: grid;
    justify-items: center;
    padding: 48px 20px;
    color: var(--muted);
    text-align: center;
}
.empty-state.compact { padding: 27px 20px; }
.empty-state h3 { margin: 11px 0 3px; color: var(--text); }
.empty-state p { margin: 0; }
.empty-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 28px;
    font-family: "Material Design Icons";
}
.session-grid { display: grid; gap: 10px; padding: 18px 22px; }
.session-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-alt);
}
.session-endpoint {
    min-width: 0;
    display: grid;
    gap: 5px;
}
.session-endpoint strong {
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.session-caption {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
}
.session-card code { overflow: hidden; text-overflow: ellipsis; }
.session-link { color: var(--orange-dark); font-weight: 800; }
.session-meta {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 9px 18px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
}
.session-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
footer {
    padding: 20px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
}

.auth-page.simple { align-content: center; }
.password-shell { width: min(520px, 100%); }
.password-page .password-shell {
    margin: 42px auto 56px;
    padding: 0 20px;
}
.topbar-brand.centered {
    justify-content: center;
    margin-bottom: 20px;
    color: var(--navy);
}
.topbar-brand.centered small { color: var(--muted); }
.password-card {
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.password-card h1 { font-size: 29px; }
.confirmation-code {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: .32em;
    text-align: center;
}
.profile-panel { padding: 28px; }
.profile-summary {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}
.profile-summary h2 { margin: 0 0 5px; color: var(--navy); }
.profile-summary p { margin: 0 0 10px; color: var(--muted); }
.profile-avatar {
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    border: 3px solid white;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(20,50,72,.14);
}
.profile-avatar.fallback {
    display: grid;
    place-items: center;
    color: var(--navy);
    background: var(--orange);
    font-size: 44px;
    font-weight: 800;
    text-transform: uppercase;
}
.profile-form { max-width: 620px; }
.check-label {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    cursor: pointer;
}
.check-label input {
    width: 18px;
    min-height: 18px;
    margin: 0;
}
.check-label span { font-weight: 600 !important; }
.role-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 10px;
    font-weight: 800;
}
.action-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 26px;
}
.action-panel h2 { margin: 0 0 5px; color: var(--navy); font-size: 18px; }
.action-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.outline-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 9px 15px;
    border: 1px solid var(--blue);
    border-radius: 9px;
    color: var(--blue);
    background: var(--surface);
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
    gap: 7px;
}
.outline-button:hover { background: var(--blue-soft); }
.admin-layout {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}
.admin-layout .panel { margin-top: 0; }
.create-user-panel .form-stack { padding: 0 22px 24px; }
.users-panel small { color: var(--muted); }
.user-search {
    padding: 0 22px 20px;
}
.user-search > label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.search-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-field {
    position: relative;
    min-width: 0;
    display: flex;
    flex: 1 1 320px;
    align-items: center;
}
.search-field input {
    width: 100%;
    min-width: 0;
    padding-left: 42px;
}
.search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}
.search-clear {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border-radius: 8px;
    text-decoration: none;
    transform: translateY(-50%);
}
.search-clear:hover {
    color: var(--text);
    background: var(--surface-soft);
}
.search-summary {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}
.empty-table {
    padding: 34px 20px;
    color: var(--muted);
    text-align: center;
}
.list-toolbar { padding: 20px 22px; }
.user-search.list-toolbar { padding-top: 0; }
.list-toolbar .search-field { flex: 1 1 320px; }
.themed-select {
    position: relative;
    display: inline-flex;
    flex: 0 1 auto;
}
.themed-select select {
    width: 100%;
    min-width: 140px;
    appearance: none;
}
.themed-select > .mdi {
    position: absolute;
    top: 50%;
    right: 12px;
    color: var(--muted);
    pointer-events: none;
    transform: translateY(-50%);
}
.page-size-control {
    width: 154px;
    min-width: 154px;
    flex: 0 0 154px;
}
.page-size-control select {
    min-width: 0;
    white-space: nowrap;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.async-list { transition: opacity .15s; }
.async-list.loading {
    opacity: .48;
    pointer-events: none;
}
.list-search-summary { padding: 0 22px 10px; }
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px 20px;
    color: var(--muted);
    font-size: 13px;
}
.table-pagination > div {
    display: flex;
    align-items: center;
    gap: 9px;
}
.outline-button.compact {
    min-height: 36px;
    padding: 7px 11px;
}
.page-indicator {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}
.dashboard-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
    align-items: start;
    gap: 20px;
}
.dashboard-preview-grid .panel { margin-top: 0; }
.preview-panel { overflow: hidden; }
.compact-list { display: grid; }
.compact-list-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}
.compact-list-item:last-child { border-bottom: 0; }
.compact-list-item > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.compact-list-item strong, .compact-list-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.compact-list-item small { color: var(--muted); }
.compact-list-item time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}
.compact-list-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--blue);
    background: var(--blue-soft);
}
.compact-list-icon.session { color: var(--orange-dark); background: var(--orange-soft); }
.panel-footer-action {
    display: flex;
    justify-content: flex-end;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
}
.session-list-full { padding: 20px 22px 4px; }
.audit-tabs {
    width: fit-content;
    display: inline-flex;
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(13, 91, 157, .08);
}
.audit-tab {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
    transition: color .15s, background .15s, box-shadow .15s;
}
.audit-tab:hover {
    color: var(--text);
    background: var(--surface-alt);
}
.audit-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    box-shadow: 0 6px 16px rgba(13, 91, 157, .2);
}
.audit-tab .mdi { font-size: 18px; }
.audit-toolbar .search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 154px;
    align-items: center;
    gap: 12px;
}
.audit-toolbar .search-field {
    grid-column: 1;
    grid-row: 1;
}
.audit-toolbar .page-size-control {
    grid-column: 2;
    grid-row: 1;
}
.audit-toolbar .filter-grid {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}
.activity-toolbar .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.filter-field {
    min-width: 0;
    display: grid;
    gap: 6px;
}
.filter-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}
.audit-toolbar .themed-select { width: 100%; }
.date-input-control {
    position: relative;
    display: block;
    width: 100%;
}
.date-filter input[data-date-filter] {
    width: 100%;
    min-height: 48px;
    padding-right: 48px;
    font-variant-numeric: tabular-nums;
}
.date-picker-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 20px;
    pointer-events: none;
}
.date-input-control .date-picker-native {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 48px;
    min-height: 48px;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}
.date-input-control:focus-within .date-picker-icon {
    color: var(--blue);
}
.activity-table time { white-space: nowrap; }
.application-badge {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--border));
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
}
.activity-category {
    color: var(--muted);
    text-transform: capitalize;
}
.activity-session-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 700;
}
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
    gap: 12px;
    padding: 20px 22px;
}
.history-toolbar .search-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 154px;
    align-items: center;
    gap: 12px;
}
.history-toolbar .search-field {
    grid-column: 1;
    grid-row: 1;
}
.history-toolbar .page-size-control {
    grid-column: 2;
    grid-row: 1;
}
.history-toolbar .filter-grid {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}
.history-toolbar .themed-select { width: 100%; }
.history-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}
.history-card > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}
.history-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-card code, .history-card time {
    color: var(--muted);
    font-size: 12px;
}
.history-card time { white-space: nowrap; }
.history-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--blue);
    background: var(--blue-soft);
}
.audit-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    color: var(--muted);
}
.state-badge.closed {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
}
.audit-detail { overflow: hidden; }
.audit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px;
    background: var(--border);
}
.audit-summary-grid > div {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    background: var(--surface);
}
.audit-summary-grid span, .audit-summary-grid small {
    color: var(--muted);
    font-size: 11px;
}
.audit-summary-grid strong {
    overflow-wrap: anywhere;
}
.audit-timeline { padding: 10px 22px 22px; }
.audit-event {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.audit-event:last-child { border-bottom: 0; }
.audit-event-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--blue);
    background: var(--blue-soft);
}
.audit-event.file .audit-event-icon { color: var(--orange-dark); background: var(--orange-soft); }
.audit-event-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.audit-event-heading time, .audit-direction {
    color: var(--muted);
    font-size: 11px;
}
.audit-direction { margin: 3px 0 8px; }
.audit-message, .audit-file { margin: 0; overflow-wrap: anywhere; }
.audit-file { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.remember-check { margin-top: -4px; }
.file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.file-picker-control {
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--field);
    cursor: pointer;
}
.file-picker-button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 7px;
    color: white !important;
    background: var(--blue);
    font-size: 12px !important;
    white-space: nowrap;
}
.file-picker-name {
    min-width: 0;
    overflow: hidden;
    color: var(--muted) !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500 !important;
}
.theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}
.theme-selector legend {
    margin-bottom: 9px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.theme-option {
    position: relative;
    min-height: 82px;
    display: flex !important;
    align-items: flex-end;
    padding: 11px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 11px;
    cursor: pointer;
}
.theme-option.classic { color: #111827; background: linear-gradient(145deg, #fff, #e2e8f0); }
.theme-option.blue { color: #152238; background: linear-gradient(145deg, #fff, #d8e8f7); }
.theme-option.dark { color: #f4faff; background: linear-gradient(145deg, #0e2033, #0b3f67); }
.form-stack .theme-option.classic > span { color: #111827; }
.form-stack .theme-option.blue > span { color: #152238; }
.form-stack .theme-option.dark > span { color: #f4faff; }
.theme-option input {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 18px;
    min-height: 18px;
}
.theme-option > span { display: grid; gap: 2px; }
.theme-option strong { font-size: 12px; }
.theme-option small { opacity: .72; font-size: 10px; }
.theme-option:has(input:checked) {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,159,26,.15);
}
.crop-editor {
    display: grid;
    gap: 14px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt);
}
.crop-editor[hidden], .crop-result[hidden] { display: none; }
.crop-instructions {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.crop-canvas-frame {
    width: min(100%, 340px);
    aspect-ratio: 1;
    justify-self: center;
    overflow: hidden;
    border: 2px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(45deg, var(--surface) 25%, transparent 25%),
        linear-gradient(-45deg, var(--surface) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--surface) 75%),
        linear-gradient(-45deg, transparent 75%, var(--surface) 75%),
        var(--surface-alt);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}
.crop-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}
.crop-canvas.dragging { cursor: grabbing; }
.crop-zoom {
    width: min(100%, 340px);
    justify-self: center;
}
.crop-zoom-input { min-height: 28px; padding: 0; }
.crop-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.crop-actions .primary-button { min-height: 42px; }
.crop-result {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-alt);
}
.crop-preview {
    width: 62px;
    height: 62px;
    display: block;
    border-radius: 16px;
    object-fit: cover;
}
.crop-result > div { display: grid; gap: 3px; }
.crop-result strong { color: var(--text); font-size: 13px; }
.crop-result small { color: var(--muted); font-size: 11px; }
.table-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--blue);
    text-decoration: none;
    font-size: 11px;
    font-weight: 750;
}
.edit-user-panel { padding: 25px; }
.form-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.danger-zone p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
}
.danger-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--red);
    border-radius: 9px;
    color: var(--red);
    background: var(--red-soft);
    cursor: pointer;
    font-weight: 750;
}
.confirm-dialog {
    width: min(460px, calc(100% - 32px));
    max-width: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    outline: none;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(4, 20, 36, .35);
}
.confirm-dialog::backdrop {
    background: rgba(5, 22, 38, .58);
    backdrop-filter: blur(3px);
}
.confirm-dialog-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    color: white;
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
}
.confirm-dialog-heading .eyebrow {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .72);
    font-size: 10px;
}
.confirm-dialog-heading h2 {
    margin: 0;
    color: white;
    font-size: 22px;
}
.confirm-dialog-icon {
    width: 46px;
    height: 46px;
    display: grid;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
    color: white;
    background: rgba(255, 255, 255, .1);
    font-size: 25px;
}
.confirm-dialog-body {
    padding: 24px 24px 18px;
}
.confirm-dialog-message {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
    line-height: 1.5;
}
.confirm-dialog-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}
.confirm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 24px 24px;
}
.confirm-dialog-actions .outline-button,
.confirm-dialog-actions .danger-button {
    width: 100%;
    min-height: 46px;
    justify-content: center;
}
.download-page { max-width: 1180px; }
.version-badge {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--blue);
    background: var(--surface);
    font-size: 12px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}
.download-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}
.download-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.download-card-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: white;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    font-size: 28px;
}
.download-card:nth-child(3) .download-card-icon {
    background: linear-gradient(135deg, #166a3c, #2aa866);
}
.download-card-body { flex: 1; }
.download-platform {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.download-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}
.download-card-body > p:not(.download-platform, .download-unavailable) {
    min-height: 58px;
    margin: 10px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.download-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--muted);
    font-size: 11px;
}
.download-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.download-unavailable {
    margin: 14px 0 0;
    color: var(--orange);
    font-size: 12px;
    font-weight: 700;
}
.download-button {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    text-decoration: none;
}
.download-button.disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: grayscale(.35);
}
.download-card.unavailable { border-style: dashed; }
.download-note {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 20px;
    padding: 18px 20px;
}
.download-note > .mdi {
    color: var(--blue);
    font-size: 24px;
}
.download-note strong { color: var(--text); }
.download-note p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 1180px) {
    .primary-nav { display: none; }
    .mobile-nav { display: block; }
    .user-chip > span:last-child { display: none; }
    .audit-toolbar .filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .activity-toolbar .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .brand-panel { display: none; }
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: 34px;
        color: var(--navy);
    }
    .auth-card { padding: 45px clamp(25px, 7vw, 55px); }
    .metric-grid { grid-template-columns: 1fr; }
    .topbar { align-items: center; }
    .admin-layout { grid-template-columns: 1fr; }
    .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .auth-page { padding: 0; background: var(--surface); }
    .auth-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
    .auth-card { padding: 35px 24px; }
    .topbar {
        align-items: center;
        padding: 11px 15px;
    }
    .topbar-brand small { display: none; }
    .topbar-actions { gap: 5px; }
    .user-chip { margin-right: 0; }
    .topbar-actions > a:not(.user-chip, .mobile-icon-action) { display: none; }
    .mobile-icon-action {
        display: inline-flex;
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
    }
    .mobile-icon-action .action-label { display: none; }
    .ghost-button { padding: 7px 10px; }
    .topbar-actions form .ghost-button {
        width: 40px;
        height: 40px;
        justify-content: center;
        padding: 0;
        overflow: hidden;
        font-size: 0;
    }
    .topbar-actions form .ghost-button .mdi { font-size: 18px; }
    .dashboard { width: min(100% - 24px, 1380px); padding-top: 28px; }
    .content-page { width: min(100% - 24px, 1380px); padding-top: 28px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .panel-heading { align-items: flex-start; }
    .password-shell { min-height: 100vh; display: grid; align-content: center; padding: 20px; }
    .password-page .password-shell {
        min-height: calc(100vh - 70px);
        margin: 0 auto;
    }
    .password-card { padding: 27px 22px; box-shadow: none; }
    .profile-panel { padding: 20px; }
    .profile-summary { align-items: flex-start; }
    .profile-avatar { width: 78px; height: 78px; flex-basis: 78px; border-radius: 21px; }
    .user-search { padding-inline: 16px; }
    .list-toolbar { padding-inline: 16px; }
    .list-toolbar .search-control { flex-wrap: wrap; }
    .list-toolbar .search-field { flex: 1 1 100%; }
    .list-toolbar .themed-select { flex: 1 1 150px; }
    .list-toolbar .page-size-control {
        width: 132px;
        min-width: 132px;
        flex: 0 0 132px;
    }
    .audit-toolbar .search-control,
    .history-toolbar .search-control {
        grid-template-columns: minmax(0, 1fr) 132px;
    }
    .audit-toolbar .filter-grid,
    .activity-toolbar .filter-grid,
    .history-toolbar .filter-grid {
        grid-template-columns: 1fr;
    }
    .audit-tabs { width: 100%; }
    .audit-tab {
        flex: 1 1 0;
        justify-content: center;
        text-align: center;
    }
    .history-card {
        grid-template-columns: 40px minmax(0, 1fr);
    }
    .history-card time {
        grid-column: 2;
    }
    .table-pagination {
        align-items: flex-start;
        flex-direction: column;
        padding-inline: 16px;
    }
    .table-pagination > div {
        width: 100%;
        justify-content: space-between;
    }
    .compact-list-item {
        grid-template-columns: 36px minmax(0, 1fr);
        padding-inline: 14px;
    }
    .compact-list-item time {
        grid-column: 2;
    }
    .audit-event-heading { flex-direction: column; gap: 3px; }
    .action-panel { align-items: stretch; flex-direction: column; }
    .outline-button { width: 100%; }
    .theme-selector { grid-template-columns: 1fr; }
    .crop-actions, .crop-result {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .crop-actions { flex-direction: column; }
    .crop-result { justify-items: center; text-align: center; }
    .form-columns { grid-template-columns: 1fr; }
    .form-actions, .danger-zone {
        align-items: stretch;
        flex-direction: column;
    }
    .download-grid { grid-template-columns: 1fr; }
    .download-card-body > p:not(.download-platform, .download-unavailable) {
        min-height: auto;
    }
}

@media (max-width: 420px) {
    .topbar { gap: 12px; }
    .topbar-brand > span:last-child { display: none; }
}
