/* ============================================================
   ADPR — AD Password Reset Portal
   Design system (theme-aware: dark default + light override)
   ============================================================ */

:root {
    /* ---- CQS brand (sampled from the corporate logo) ----
       navy #3a4f67 · teal #5dafa4 · aqua #8cc5c6 */
    --cqs-navy: #3a4f67;
    --cqs-teal: #5dafa4;
    --cqs-aqua: #8cc5c6;

    --brand-300: #b6e0d8;
    --brand-400: #7ec3b8;
    --brand-500: #5dafa4;
    --brand-600: #4a9488;
    --brand-700: #3b7a70;
    --accent: #8cc5c6;

    /* Filled actions: vivid CQS teal with a deep navy label — the pairing
       stays legible in both themes (contrast ~6:1). */
    --btn-from: #6dbcb0;
    --btn-to: #4f9f93;
    --btn-text: #10242f;
    --link: var(--brand-400);

    /* Semantic */
    --danger: #e05563;
    --danger-soft: rgba(224, 85, 99, 0.14);
    --success: #4aa88a;
    --success-soft: rgba(74, 168, 138, 0.14);
    --warning: #d9a03f;
    --warning-soft: rgba(217, 160, 63, 0.14);

    /* Surfaces (dark — navy family) */
    --bg-0: #131f29;
    --bg-1: #1a2836;
    --bg-grad-a: #2a3f56;
    --bg-grad-b: #131f29;
    --surface: rgba(32, 48, 65, 0.74);
    --surface-2: rgba(255, 255, 255, 0.045);
    --surface-3: rgba(255, 255, 255, 0.08);
    --border: rgba(140, 197, 198, 0.16);
    --border-strong: rgba(140, 197, 198, 0.30);

    /* Text */
    --text: #eaf2f4;
    --text-muted: #9db3bd;
    --text-faint: #6d8492;

    /* Effects */
    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 20px;
    --shadow: 0 22px 48px -22px rgba(6, 16, 24, 0.8);
    --shadow-sm: 0 6px 16px -8px rgba(6, 16, 24, 0.6);
    --ring: 0 0 0 3px rgba(93, 175, 164, 0.35);
    --font: "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Light theme ---- */
:root[data-theme="light"] {
    --link: #35756a;
    --bg-0: #eaf1f2;
    --bg-1: #f7fafb;
    --bg-grad-a: #dcebe9;
    --bg-grad-b: #f2f7f8;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-2: rgba(58, 79, 103, 0.04);
    --surface-3: rgba(58, 79, 103, 0.08);
    --border: rgba(58, 79, 103, 0.15);
    --border-strong: rgba(58, 79, 103, 0.28);
    --text: #22384a;
    --text-muted: #5a7183;
    --text-faint: #8399a8;
    --shadow: 0 18px 40px -22px rgba(58, 79, 103, 0.35);
    --shadow-sm: 0 6px 16px -10px rgba(58, 79, 103, 0.28);
}

/* "Auto" follows the operating system preference. */
@media (prefers-color-scheme: light) {
    :root[data-theme="auto"] {
        --link: #35756a;
        --bg-0: #eaf1f2;
        --bg-1: #f7fafb;
        --bg-grad-a: #dcebe9;
        --bg-grad-b: #f2f7f8;
        --surface: rgba(255, 255, 255, 0.92);
        --surface-2: rgba(58, 79, 103, 0.04);
        --surface-3: rgba(58, 79, 103, 0.08);
        --border: rgba(58, 79, 103, 0.15);
        --border-strong: rgba(58, 79, 103, 0.28);
        --text: #22384a;
        --text-muted: #5a7183;
        --text-faint: #8399a8;
        --shadow: 0 18px 40px -22px rgba(58, 79, 103, 0.35);
        --shadow-sm: 0 6px 16px -10px rgba(58, 79, 103, 0.28);
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(1100px 700px at 85% -10%, var(--bg-grad-a), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(93, 175, 164, 0.13), transparent 55%),
        radial-gradient(700px 500px at 50% 120%, rgba(140, 197, 198, 0.08), transparent 60%),
        var(--bg-0);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.app-main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5.5rem 1.25rem 2rem;
}
.app-main.top { justify-content: flex-start; }

.card {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow);
}
.card.wide { max-width: 1040px; }
.card.narrow { max-width: 400px; }

/* ---------- Top bar ---------- */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    background: color-mix(in srgb, var(--bg-1) 82%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.topbar .brand-link { display: inline-flex; align-items: center; gap: 0.6rem; }
.topbar .brand-link img { height: 30px; display: block; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.brand-mark { display: inline-flex; align-items: center; gap: 0.65rem; }
.brand-mark img { height: 34px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
    color: var(--btn-text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(16, 36, 47, 0.18);
    transition: filter .15s ease, transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 4px 12px -3px rgba(93, 175, 164, 0.45); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(16, 36, 47, 0.18); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.42rem 0.8rem; font-size: 0.83rem; border-radius: 7px; }
.btn-danger { background: linear-gradient(180deg, #e86a76, #cf4553); color: #fff; }
.btn-success { background: linear-gradient(180deg, #57bb9a, #3d9076); color: #fff; }
.btn-ghost {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-3); filter: none; }
.btn-outline-danger {
    background: transparent; border-color: var(--danger); color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger-soft); filter: none; }
.icon-btn {
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }

/* Inline solid icons (always render crisp, follow currentColor) */
.ico { display: block; flex-shrink: 0; width: 1em; height: 1em; }
.icon-btn .ico { width: 18px; height: 18px; }
.timer-chip .ico { width: 14px; height: 14px; }
.menu a .ico { width: 16px; height: 16px; color: var(--text-muted); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { margin: 0 0 0.75rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
.title-brand { color: var(--brand-400); }
.subtitle { color: var(--text-muted); font-size: 0.92rem; margin-top: -0.25rem; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.center { text-align: center; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
label { display: block; margin-bottom: 0.45rem; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }
.hint { font-size: 0.76rem; color: var(--text-faint); margin-top: 0.4rem; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-500); box-shadow: var(--ring); }
select option { background: var(--bg-1); color: var(--text); }
.inline-form { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.inline-form > input { flex: 1; min-width: 160px; }

/* ---------- Badges / pills ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.18rem 0.6rem; border-radius: 999px;
    font-size: 0.74rem; font-weight: 600; line-height: 1.4;
    background: var(--surface-3); color: var(--text-muted);
    border: 1px solid var(--border);
}
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-accent { background: rgba(59, 130, 246, 0.14); color: #60a5fa; border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--success); }
.dot-off { background: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
    text-align: left; padding: 0.8rem 1rem;
    background: var(--surface-2);
    color: var(--text-muted); font-weight: 600; font-size: 0.8rem;
    text-transform: uppercase; letter-spacing: 0.03em;
    position: sticky; top: 0;
}
tbody td { padding: 0.8rem 1rem; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
.cell-strong { font-weight: 600; }
.cell-sub { font-size: 0.78rem; color: var(--text-muted); }
.row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* ---------- Dialog / modal ---------- */
dialog {
    padding: 0; border: none; background: transparent;
    max-width: 520px; width: calc(100% - 2rem);
    color: var(--text);
}
dialog::backdrop { background: rgba(4, 10, 16, 0.6); backdrop-filter: blur(4px); }
.modal-card {
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.modal-close {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0;
}
.modal-close:hover { color: var(--text); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.2rem; margin: 0.5rem 0 1.25rem; font-size: 0.88rem; }
.kv-grid .k { color: var(--text-faint); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; }
.kv-grid .v { color: var(--text); }
.kv-grid .span2 { grid-column: span 2; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.75rem; }
.tab-btn {
    background: transparent; border: none; cursor: pointer;
    padding: 0.75rem 1.15rem; color: var(--text-muted);
    font-family: inherit; font-size: 0.92rem; font-weight: 600;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand-400); border-bottom-color: var(--brand-500); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-box {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* ---------- Alerts ---------- */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; border: 1px solid transparent; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(244, 63, 94, 0.25); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(16, 185, 129, 0.25); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245, 158, 11, 0.25); }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }

/* ---------- Secret reveal ---------- */
.secret-box {
    background: rgba(0, 0, 0, 0.28);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 1.4rem;
    font-family: var(--mono);
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--brand-400);
    user-select: all;
    word-break: break-all;
}
:root[data-theme="light"] .secret-box { background: rgba(15, 30, 45, 0.06); color: var(--brand-700); }

/* ---------- Session timer chip ---------- */
.timer-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; font-weight: 600; font-variant-numeric: tabular-nums;
    padding: 0.35rem 0.7rem; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.timer-chip.warn { color: var(--danger); border-color: rgba(244, 63, 94, 0.4); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.45; } }

/* ---------- Profile dropdown ---------- */
.profile { position: relative; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
    color: #fff; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
}
.menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 210px; background: var(--bg-1);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.profile.open .menu, .profile-pill.open .menu { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-head { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.menu-head strong { color: var(--text); display: block; margin-top: 0.15rem; }
.menu a { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; color: var(--text); font-size: 0.9rem; }
.menu a:hover { background: var(--surface-3); text-decoration: none; }

/* ---------- Toasts ---------- */
#toast-container { position: fixed; top: 74px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    min-width: 220px; max-width: 340px; padding: 0.8rem 1.1rem;
    border-radius: var(--radius-sm); color: #fff; font-weight: 600; font-size: 0.9rem;
    box-shadow: var(--shadow-sm); opacity: 0; transform: translateX(20px);
    transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background: linear-gradient(180deg, #22c58e, var(--success)); }
.toast.error { background: linear-gradient(180deg, #fb5170, var(--danger)); }

/* ---------- Login ---------- */
.login-logo { text-align: center; margin-bottom: 1.6rem; }
.login-logo img { height: 54px; }

/* ---------- Footer ---------- */
.app-footer {
    text-align: center; padding: 1.25rem; color: var(--text-faint);
    font-size: 0.75rem; letter-spacing: 0.02em;
}
.app-footer a { color: var(--text-muted); }

/* ---------- htmx loader ---------- */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---------- Utilities ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 0.75rem; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.grow { flex: 1; }

@media (max-width: 640px) {
    .card { padding: 1.4rem; }
    .kv-grid { grid-template-columns: 1fr; }
    .app-main { padding-top: 4.75rem; }
    thead th, tbody td { padding: 0.65rem 0.7rem; }
}

/* ---------- New Topbar UI ---------- */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar-timer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.2;
}

.timer-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 20px;
}

.timer-value {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--brand-500);
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.95rem;
}

.timer-value .ico {
    width: 14px;
    height: 14px;
    color: var(--brand-500);
}

.topbar-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

.theme-segmented-control {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.25rem;
    gap: 0.2rem;
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 99px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.theme-btn:hover {
    color: var(--text);
}

.theme-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.theme-btn .ico {
    width: 14px;
    height: 14px;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 0.3rem 0.85rem 0.3rem 0.3rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.profile-pill:hover {
    background: var(--surface-3);
}

.profile-pill .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--cqs-teal), var(--cqs-navy));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.profile-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.profile-role {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.profile-pill .chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.logout-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 99px;
    padding: 0.4rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.logout-pill:hover {
    background: var(--danger-soft);
    text-decoration: none;
}

.logout-pill .ico {
    width: 16px;
    height: 16px;
}

/* Ensure menu is positioned correctly under profile-pill */
.profile-pill .menu {
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
}

/* ============================================================
   CQS polish layer
   ============================================================ */

/* Cards carry a subtle brand hairline along the top edge. */
.card {
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cqs-navy), var(--cqs-teal) 45%, var(--cqs-aqua));
    opacity: 0.9;
}
.modal-card {
    position: relative;
    overflow: hidden;
}
.modal-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cqs-navy), var(--cqs-teal) 45%, var(--cqs-aqua));
}

/* Headings pick up the brand teal so the palette reads as intentional. */
h2, h3 { color: var(--text); }
.card > h2:first-of-type { color: var(--brand-500); }
:root[data-theme="light"] .card > h2:first-of-type { color: #35756a; }

/* Inputs settle onto the surface and lift on focus. */
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], select, textarea {
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover:not(:focus), select:hover:not(:focus) { border-color: var(--border-strong); }

/* Table rows respond with a brand tint rather than plain grey. */
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: rgba(93, 175, 164, 0.07); }
thead th { border-bottom: 1px solid var(--border); }

/* Badges: brand-tinted neutral. */
.badge-accent {
    background: rgba(140, 197, 198, 0.18);
    color: var(--cqs-aqua);
    border-color: transparent;
}
:root[data-theme="light"] .badge-accent { color: #3f7f80; }

/* Segmented theme control: active pill in brand teal. */
.theme-btn.active {
    background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
    color: var(--btn-text);
    border-color: transparent;
}
.theme-btn.active .ico { color: var(--btn-text); }

/* Session timer keeps the teal, label picks up aqua. */
.timer-label { color: var(--text-faint); }

/* Login card: give the logo some breathing room and a brand glow. */
.login-logo img {
    filter: drop-shadow(0 6px 18px rgba(93, 175, 164, 0.28));
}

/* Empty states read as calm rather than broken. */
.empty-state {
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* Focus visibility across all interactive elements. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: var(--radius-sm);
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Checkbox rows in settings read as a single control, not a stray box. */
.switch-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0.7rem 0.9rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.switch-row:hover { background: var(--surface-3); }
.switch-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--cqs-teal);
    cursor: pointer;
    flex-shrink: 0;
}
