/* =====================================================================
   TierTek M365 Reset Portal — consolidated design system
   Rewritten 2026-07-04; retoned 2026-07-19 to the reporting-dashboard
   design language (navy + mono eyebrows + tabular figures + reveals).
   Single source of truth, token-driven, no !important warfare.
   Preserves every class name used by the existing templates.
   Light + dark themes (system preference + optional [data-theme] override).
   The sidebar is intentionally a FIXED deep-navy ground in both themes —
   never tie its colors to --tt-blue (which lightens in dark mode).
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
    --tt-blue: #28326f;
    --tt-blue-dark: #1d2557;
    --tt-blue-bright: #4756b0;

    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f0f2f9;
    --surface-3: #e9ecf6;
    --text: #171b30;
    --muted: #626a8d;
    --border: #e0e3f0;
    --border-soft: #eaedf6;
    --brand-wash: #e7e9f5;

    --danger: #b4453c;
    --danger-bg: #f7e4e2;
    --danger-text: #96352d;
    --warning: #b5852a;
    --warning-bg: #f6eeda;
    --warning-text: #8a6317;
    --success: #2e7d5b;
    --success-bg: #e2f0ea;
    --success-text: #226348;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 18px;
    --shadow: 0 1px 2px rgba(23, 27, 48, 0.05), 0 8px 24px -12px rgba(23, 27, 48, 0.12);
    --shadow-lg: 0 2px 4px rgba(23, 27, 48, 0.06), 0 14px 34px -12px rgba(23, 27, 48, 0.18);
    --sidebar-w: 252px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
    --brand-color: #28326f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0f1e;
        --surface: #16192c;
        --surface-2: #1d2138;
        --surface-3: #232849;
        --text: #edeff7;
        --muted: #8b92b3;
        --border: #262a44;
        --border-soft: #20243c;
        --brand-wash: #212545;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
        --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px -14px rgba(0, 0, 0, 0.7);
        --danger: #d9695f; --danger-bg: #371b18; --danger-text: #f0aca4;
        --warning: #d6a84e; --warning-bg: #33290f; --warning-text: #ecd193;
        --success: #4bb285; --success-bg: #17301f; --success-text: #9fdfc0;
        --tt-blue: #4756b0;
        --tt-blue-dark: #343f8f;
        --tt-blue-bright: #98a2ef;
        --brand-color: #98a2ef;
    }
}

:root[data-theme="light"] {
    --bg: #f6f7fb; --surface: #ffffff; --surface-2: #f0f2f9; --surface-3: #e9ecf6;
    --text: #171b30; --muted: #626a8d; --border: #e0e3f0; --border-soft: #eaedf6;
    --brand-wash: #e7e9f5;
    --shadow: 0 1px 2px rgba(23, 27, 48, 0.05), 0 8px 24px -12px rgba(23, 27, 48, 0.12);
    --shadow-lg: 0 2px 4px rgba(23, 27, 48, 0.06), 0 14px 34px -12px rgba(23, 27, 48, 0.18);
    --danger: #b4453c; --danger-bg: #f7e4e2; --danger-text: #96352d;
    --warning: #b5852a; --warning-bg: #f6eeda; --warning-text: #8a6317;
    --success: #2e7d5b; --success-bg: #e2f0ea; --success-text: #226348;
    --tt-blue: #28326f;
    --tt-blue-dark: #1d2557;
    --tt-blue-bright: #4756b0;
    --brand-color: #28326f;
}

:root[data-theme="dark"] {
    --bg: #0d0f1e; --surface: #16192c; --surface-2: #1d2138; --surface-3: #232849;
    --text: #edeff7; --muted: #8b92b3; --border: #262a44; --border-soft: #20243c;
    --brand-wash: #212545;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px -14px rgba(0, 0, 0, 0.7);
    --danger: #d9695f; --danger-bg: #371b18; --danger-text: #f0aca4;
    --warning: #d6a84e; --warning-bg: #33290f; --warning-text: #ecd193;
    --success: #4bb285; --success-bg: #17301f; --success-text: #9fdfc0;
    --tt-blue: #4756b0;
    --tt-blue-dark: #343f8f;
    --tt-blue-bright: #98a2ef;
    --brand-color: #98a2ef;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1 { margin: 0 0 8px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: var(--tt-blue-bright); }
.subtle, .status-muted { color: var(--muted); }
.subtle { margin-top: 4px; }

code {
    font-family: var(--mono);
    font-size: 13px;
    background: var(--surface-3);
    padding: 4px 7px;
    border-radius: 7px;
}

hr, .soft-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ---------- Auth / standalone card pages (login, enroll, consent) ---------- */
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--tt-blue), var(--tt-blue-dark));
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-card.enroll-card { max-width: 520px; }

.brand {
    font-size: 28px;
    font-weight: 900;
    color: var(--brand-color);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.brand-small { font-size: 18px; font-weight: 800; color: #ffffff; }

.enroll-button { width: 100%; height: 48px; margin-top: 20px; }

/* ---------- App shell (admin) ---------- */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
}

/* Fixed deep-navy ground in BOTH themes — high-contrast light text on dark navy.
   Deliberately hard-coded (not --tt-blue), so dark mode can't flip it light. */
.sidebar {
    background: linear-gradient(180deg, #181e44 0%, #10142e 100%);
    color: #d6dbf2;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; color: #ffffff; }
.sidebar-subtitle {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #8f97c4;
    margin: 4px 0 22px;
}

.sidebar-group-label {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7d86b8;
    margin: 18px 12px 6px;
}
.sidebar-group-label:first-of-type { margin-top: 6px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #c3c9e8;
    text-decoration: none;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background 120ms ease, color 120ms ease;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.sidebar-nav a.active {
    background: rgba(139, 147, 212, 0.18);
    color: #ffffff;
    font-weight: 800;
    box-shadow: inset 3px 0 0 #8b93d4;
}
.sidebar-nav a.active svg { opacity: 1; }

.app-main { padding: 26px 30px; min-width: 0; }

.app-header {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.app-header h1 { margin: 0; font-size: 26px; }
.app-header p { margin: 6px 0 0; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Theme toggle */
.theme-toggle {
    width: 42px; height: 42px; min-width: 42px;
    padding: 0; margin: 0;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-3); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Legacy topbar/container layout (still used by a few pages) */
.topbar {
    background: var(--tt-blue);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}
.page-title { font-size: 14px; opacity: 0.9; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-link { color: #ffffff; text-decoration: none; font-weight: 700; }
.container { max-width: 1100px; margin: 26px auto; padding: 0 20px; }
.container.wide { max-width: 1360px; }

/* ---------- Cards / panels ---------- */
.panel, .tile, .page-card, .filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}
.filter-card { padding: 18px; }
.page-card h1, .page-card h2, .panel h2, .tile h2 { margin-top: 0; }
.nested-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}

.page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.panel-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 12px;
}
.panel-heading-row h2 { margin-bottom: 4px; }

/* ---------- Dashboard portal cards + stats ---------- */
.portal-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.portal-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    min-height: 136px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 120ms ease, box-shadow 120ms ease;
}
.portal-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tt-blue), var(--tt-blue-bright));
}
.portal-card::after {
    content: "\2192";
    position: absolute;
    right: 22px; bottom: 18px;
    font-size: 18px;
    color: var(--tt-blue-bright);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 150ms ease, transform 150ms ease;
}
.portal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.portal-card:hover::after { opacity: 0.9; transform: translateX(0); }
.portal-card h2 { margin: 0 0 8px; font-size: 19px; color: var(--tt-blue-bright); }
.portal-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.portal-card.primary {
    background: linear-gradient(135deg, var(--tt-blue), var(--tt-blue-dark));
    color: #ffffff;
    border: none;
}
.portal-card.primary::before { background: rgba(255, 255, 255, 0.5); }
.portal-card.primary h2 { color: #ffffff; }
.portal-card.primary p { color: #e7f1fa; }
.portal-card.primary::after { color: #ffffff; }

.portal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}
.portal-stat, .dashboard-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    border-left: 5px solid var(--tt-blue);
}
.portal-stat span, .dashboard-stat-card span {
    display: block;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.portal-stat strong, .dashboard-stat-card strong {
    display: block;
    margin-top: 8px;
    font-family: var(--mono);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-color);
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}
.portal-stat.success, .dashboard-stat-card.success { background: var(--success-bg); border-left-color: var(--success); }
.portal-stat.success strong, .dashboard-stat-card.success strong { color: var(--success-text); }
.portal-stat.warning, .dashboard-stat-card.warning { background: var(--warning-bg); border-left-color: var(--warning); }
.portal-stat.warning strong, .dashboard-stat-card.warning strong { color: var(--warning-text); }
.portal-stat.danger, .dashboard-stat-card.danger { background: var(--danger-bg); border-left-color: var(--danger); }
.portal-stat.danger strong, .dashboard-stat-card.danger strong { color: var(--danger-text); }

.dashboard-main { display: flex; flex-direction: column; gap: 22px; }
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* ---------- Buttons ---------- */
button, .button-link, .clear-button, .table-button, .compact-button {
    font-family: var(--font);
    border-radius: var(--radius-sm);
    font-weight: 800;
    cursor: pointer;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
button {
    margin-top: 0;
    height: 44px;
    padding: 0 18px;
    background: var(--tt-blue);
    color: #ffffff;
    font-size: 15px;
}
button:hover { background: var(--tt-blue-dark); }

/* Full-width submit inside narrow cards */
.login-card button,
.public-reset-card > form > button,
.enroll-button { width: 100%; }

.button-link {
    background: var(--tt-blue);
    color: #ffffff;
    height: 40px;
    padding: 0 16px;
}
.button-link:hover { background: var(--tt-blue-dark); color: #fff; }

button.secondary, .secondary {
    background: var(--surface);
    color: var(--tt-blue-bright);
    border: 1px solid var(--border);
    width: auto;
}
button.secondary:hover, .secondary:hover { background: var(--surface-2); }

.danger-button, .danger-submit { background: var(--danger); color: #ffffff; }
.danger-button:hover, .danger-submit:hover { background: #7f1712; }

.table-button, .compact-button { height: 40px; min-width: 90px; padding: 0 14px; font-size: 14px; }
.compact-button { height: 36px; min-width: 72px; }

.button-disabled {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 96px; height: 42px;
    border-radius: var(--radius-sm);
    background: var(--border);
    color: var(--muted);
    font-weight: 700;
}

/* Compact inline copy button (next to a value) */
.copy-btn {
    height: 32px; min-width: 0; margin: 0 0 0 8px; padding: 0 12px;
    font-size: 13px; font-weight: 700;
    background: var(--surface-2); color: var(--tt-blue-bright);
    border: 1px solid var(--border);
    vertical-align: middle;
}
.copy-btn:hover { background: var(--surface-3); }
.secret-hidden { letter-spacing: 3px; }

/* Loading state (used by workflow JS pass) */
button.is-loading { position: relative; color: transparent !important; pointer-events: none; }
button.is-loading::after {
    content: ""; position: absolute;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tt-spin 0.6s linear infinite;
}
@keyframes tt-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
label {
    display: block;
    font-weight: 700;
    margin: 16px 0 6px;
    color: var(--text);
}
input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--tt-blue-bright);
    box-shadow: 0 0 0 3px rgba(47, 111, 176, 0.18);
}
::placeholder { color: var(--muted); opacity: 0.7; }

.required-marker { color: var(--danger); font-weight: 900; }

/* Separate a stacked submit button from the field directly above it —
   fixes the login "Continue" / "Sign In" buttons touching the input, and the
   same pattern in every vertically-stacked form. Inline / grid / hidden-input
   forms keep their buttons aligned with the field. */
input + button,
select + button,
textarea + button { margin-top: 20px; }
input[type="hidden"] + button,
.search-form input + button,
.pin-form input + button,
.group-search-row input + button { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.full-width { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-actions form { margin: 0; }
.form-actions a.button-link, .form-actions button {
    min-width: 90px; height: 44px; padding: 0 18px; margin: 0;
}

.user-onboarding-section { margin-top: 30px; }
.user-onboarding-section h2 { margin: 0 0 12px; }

/* Search / filters */
.search-form { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.search-form input { flex: 1; }
.search-form button, .search-form .button-link, .search-form .clear-button {
    height: 44px; min-width: 96px; padding: 0 18px; margin: 0;
}

.filter-grid { display: grid; grid-template-columns: 260px 1fr auto; gap: 14px; align-items: end; }
.audit-filter-grid {
    display: grid;
    grid-template-columns: 240px 220px 160px minmax(280px, 1fr) 250px;
    gap: 14px;
    align-items: end;
}
.audit-filter-grid .form-actions { display: flex; gap: 10px; }
.audit-filter-grid button, .audit-filter-grid a.button-link { width: 120px; height: 44px; }
.verification-filter-grid {
    display: grid;
    grid-template-columns: 280px minmax(320px, 520px) 120px 120px;
    gap: 14px;
    align-items: end;
}
.verification-filter-grid button, .verification-filter-grid a.button-link {
    width: 120px; height: 44px; margin: 0;
}
.filter-card label, .filter-grid label, .audit-filter-grid label, .verification-filter-grid label { margin-top: 0; }

.results-bar {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; margin: 16px 0; font-weight: 700;
}
.letter-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.letter-filter a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px;
    border-radius: 8px; text-decoration: none; font-weight: 700;
    background: var(--surface-3); color: var(--tt-blue-bright);
}
.letter-filter a.active { background: var(--tt-blue); color: #ffffff; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; }
.page-count { font-weight: 700; color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--surface-2);
    font-weight: 600;
}
.table-wrap tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

.table-wrap .form-actions { flex-wrap: nowrap; }
.table-wrap .form-actions a.button-link, .table-wrap .form-actions button {
    width: 90px; min-width: 90px; height: 42px; white-space: nowrap; padding: 0 14px;
}
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 150px; }
.audit-details, .details-cell { max-width: 520px; white-space: normal; line-height: 1.4; color: var(--muted); word-break: break-word; }
.nowrap { white-space: nowrap; }
.add-client-button { height: 44px; min-width: 120px; }

/* ---------- Pills / badges / alerts ---------- */
.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.pill.good { background: var(--success-bg); color: var(--success-text); }
.pill.bad { background: var(--danger-bg); color: var(--danger-text); }
.pill.warning { background: var(--warning-bg); color: var(--warning-text); }

.license-pill, .selected-group-pill {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; padding: 5px 10px;
    font-size: 12px; font-weight: 800; margin: 2px;
}
.license-pill { background: var(--surface-3); color: var(--tt-blue-bright); }
.selected-group-pill { background: var(--tt-blue); color: #ffffff; }
.selected-group-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.report-count-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 34px;
    border-radius: 999px;
    background: var(--surface-3); color: var(--tt-blue-bright);
    font-weight: 900; text-decoration: none;
    border: 1px solid var(--border);
}
.report-count-link:hover { background: var(--surface-2); }

.alert {
    background: var(--danger-bg); color: var(--danger-text);
    padding: 12px 14px; border-radius: var(--radius-sm); margin: 16px 0;
    border: 1px solid rgba(159, 29, 23, 0.25);
    font-weight: 600;
}
.notice { padding: 12px 14px; border-radius: var(--radius-sm); margin: 14px 0; font-weight: 700; }
.notice.good-bg, .good-bg { background: var(--success-bg); color: var(--success-text); }
.notice.bad-bg, .bad-bg { background: var(--danger-bg); color: var(--danger-text); }
.success { color: var(--success-text); font-weight: 700; }
.good { color: var(--success-text); }
.bad { color: var(--danger-text); }
.danger { color: var(--danger); }
.warning { color: var(--warning); }

/* ---------- PIN / verification ---------- */
.masked-pin { font-size: 24px; letter-spacing: 4px; font-weight: 800; }
.revealed-pin {
    display: inline-block;
    font-size: 28px; letter-spacing: 3px; font-weight: 900;
    background: var(--warning-bg); color: var(--warning-text);
    padding: 8px 14px; border-radius: var(--radius-sm);
}
.verification-grid, .security-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px;
}
.pin-form { display: grid; grid-template-columns: 140px 140px 110px; gap: 8px; align-items: center; }
.pin-form input { padding: 9px 10px; }
.pin-form button { height: 42px; min-width: 0; }

.copy-block {
    white-space: pre-line;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin: 14px 0;
    font-family: var(--mono);
    color: var(--text);
}

/* ---------- License / group / security pickers ---------- */
.license-table-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 24px; }
.license-table-row {
    display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
    padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.license-check { display: flex; align-items: flex-start; justify-content: center; padding-top: 3px; }
.license-check input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.license-info { display: block; }

.security-checkbox-list { display: grid; gap: 12px; margin: 14px 0 18px; }
.security-checkbox-row {
    display: grid; grid-template-columns: 24px 1fr; align-items: center; column-gap: 10px;
    font-weight: 700; margin: 0;
}
.security-checkbox-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }

.group-search-row {
    display: grid; grid-template-columns: 1fr 110px 110px; gap: 12px; align-items: center; margin-bottom: 14px;
}
.group-search-row input { height: 44px; margin: 0; }
.group-search-row button { height: 44px; margin: 0; }
.group-result-list {
    display: grid; gap: 10px; margin: 14px 0 24px;
    max-height: 420px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface-2);
}
.group-result-row {
    display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start;
    padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.group-result-row input[type="checkbox"] { width: 18px; height: 18px; margin: 3px 0 0; }
.group-result-row.group-hidden { display: none; }

/* ---------- Public web password reset ---------- */
.public-reset-body {
    margin: 0; min-height: 100vh;
    background: linear-gradient(135deg, var(--tt-blue), var(--tt-blue-dark));
    display: flex; align-items: center; justify-content: center; color: var(--text);
}
.public-reset-shell { width: 100%; max-width: 480px; padding: 24px; }
.public-reset-card {
    background: var(--surface); border-radius: 22px; padding: 34px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
.public-reset-brand { color: var(--brand-color); font-size: 24px; font-weight: 900; margin-bottom: 12px; }
.public-reset-card h1 { margin: 0 0 10px; font-size: 28px; }
.public-reset-card h2 { margin-top: 24px; }
.public-reset-card label { margin-top: 18px; }
.public-reset-help { margin-top: 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.temp-password-box, .password-rules, .public-reset-enroll-box, .reset-success-panel {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 18px;
}
.temp-password-box { font-family: var(--mono); font-size: 18px; word-break: break-all; }
.reset-success-panel { background: var(--surface); }
.reset-success-panel .button-link, .secondary-reset-link { margin-top: 14px; }
.password-rules ul { margin: 8px 0 0 20px; padding: 0; }
.password-rules li { margin: 4px 0; }
.password-rules li.rule-pass { color: var(--success-text); font-weight: 800; }
.password-rules li.rule-pass::marker { content: "✓ "; }
.password-rules li.rule-fail { color: var(--muted); }
.public-reset-enroll-box p { margin: 8px 0 12px; color: var(--muted); line-height: 1.45; }
.public-reset-enroll-box a { font-weight: 900; color: var(--tt-blue-bright); text-decoration: none; }

.password-input-wrap { display: grid; grid-template-columns: 1fr 82px; gap: 10px; align-items: center; }
.password-input-wrap input { margin: 0; }
.password-toggle { width: 82px; min-height: 46px; margin: 0; padding: 0 10px; font-size: 14px; }
.password-strength { margin-top: 10px; }
.password-strength-bar {
    width: 100%; height: 10px; background: var(--surface-3);
    border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
#password-strength-fill { height: 100%; width: 0%; transition: width 160ms ease; }
#password-strength-fill.strength-weak { background: var(--danger); }
#password-strength-fill.strength-fair { background: var(--warning); }
#password-strength-fill.strength-good { background: var(--tt-blue); }
#password-strength-fill.strength-strong { background: var(--success); }
#password-strength-label { margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.password-match-message { margin-top: 8px; font-size: 13px; font-weight: 800; }
.match-good { color: var(--success-text); }
.match-bad { color: var(--danger-text); }

/* ---------- Toast (workflow JS pass) ---------- */
.toast-stack {
    position: fixed; top: 20px; right: 20px; z-index: 1000;
    display: flex; flex-direction: column; gap: 10px;
}
.toast {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-left: 4px solid var(--tt-blue);
    border-radius: var(--radius-sm); padding: 12px 16px;
    box-shadow: var(--shadow-lg); font-weight: 700;
    animation: toast-in 160ms ease;
}
.toast.good { border-left-color: var(--success); }
.toast.bad { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--tt-blue-bright); text-decoration: underline; }
.breadcrumbs .sep { color: var(--muted); opacity: 0.6; }
.breadcrumbs .current { color: var(--text); }

/* ---------- Empty states ---------- */
.empty-state {
    text-align: center;
    padding: 34px 20px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin: 16px 0;
    font-weight: 600;
}
.empty-state .empty-icon { font-size: 26px; display: block; margin-bottom: 6px; opacity: 0.7; }

/* ---------- Selection highlight for pickers ---------- */
.license-table-row:hover, .group-result-row:hover { border-color: var(--tt-blue-bright); }
.license-table-row:has(input:checked),
.group-result-row:has(input:checked),
.security-checkbox-row:has(input:checked) {
    border-color: var(--tt-blue-bright);
    background: color-mix(in srgb, var(--tt-blue-bright) 8%, var(--surface));
    box-shadow: 0 0 0 1px var(--tt-blue-bright) inset;
}
.security-checkbox-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color 120ms ease, background 120ms ease; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar-group-label { grid-column: 1 / -1; }
    .portal-card-grid, .portal-stats-grid, .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .audit-filter-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .filter-grid, .verification-filter-grid, .form-grid, .form-grid-3, .form-grid-two,
    .license-table-list, .verification-grid, .security-detail-grid, .group-search-row { grid-template-columns: 1fr; }
    .results-bar { flex-direction: column; align-items: flex-start; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-form button, .search-form .button-link, .search-form .clear-button { width: 100%; }
    .pin-form { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
    .portal-card-grid, .portal-stats-grid, .dashboard-stats-grid, .audit-filter-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .app-main { padding: 18px; }
    .app-header, .page-heading-row, .panel-heading-row { flex-direction: column; align-items: flex-start; }
    .sidebar-nav { grid-template-columns: 1fr; }
}

/* Mobile tables: opt-in card-style rows with data labels (add class "stack"
   to a .table-wrap whose <td>s carry data-label). Unmarked tables keep their
   horizontal scroll, which is better for wide/many-column tables. */
@media (max-width: 760px) {
    .table-wrap.stack table, .table-wrap.stack thead, .table-wrap.stack tbody,
    .table-wrap.stack tr, .table-wrap.stack th, .table-wrap.stack td { display: block; }
    .table-wrap.stack thead { display: none; }
    .table-wrap.stack tr { border-bottom: 2px solid var(--border); padding: 8px 0; }
    .table-wrap.stack td { border: none; padding: 6px 14px; }
    .table-wrap.stack td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px; font-weight: 800; text-transform: uppercase;
        letter-spacing: 0.04em; color: var(--muted);
    }
}

/* =====================================================================
   2026-07-19 — Command Deck / Users directory / user workspace layer
   ===================================================================== */

/* ---------- Entrance reveals (report-style) ---------- */
@keyframes tt-reveal-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.app-main > .page-card,
.app-main > section,
.deck-grid > *,
.portal-stats-grid > * { animation: tt-reveal-up 0.5s ease both; }
.portal-stats-grid > *:nth-child(2) { animation-delay: 0.05s; }
.portal-stats-grid > *:nth-child(3) { animation-delay: 0.10s; }
.portal-stats-grid > *:nth-child(4) { animation-delay: 0.15s; }
.portal-stats-grid > *:nth-child(5) { animation-delay: 0.20s; }
.portal-stats-grid > *:nth-child(6) { animation-delay: 0.25s; }
.deck-grid > *:nth-child(2) { animation-delay: 0.08s; }
@media (prefers-reduced-motion: reduce) {
    .app-main > .page-card, .app-main > section, .deck-grid > *, .portal-stats-grid > * { animation: none; }
}

/* ---------- Command Deck ---------- */
.deck-eyebrow {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 4px;
}
.deck-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--tt-blue-bright) 34%, var(--border));
    border-radius: var(--radius);
    padding: 4px 16px 4px 18px;
    box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--tt-blue-bright) 7%, transparent);
    margin-bottom: 22px;
}
.deck-search .ds-icon { color: var(--tt-blue-bright); flex: none; }
.deck-search input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 16px;
    color: var(--text);
}
.deck-search input:focus { outline: none; box-shadow: none; border: none; }
.deck-search .ds-key {
    font-family: var(--mono); font-size: 11px; color: var(--muted);
    border: 1px solid var(--border); border-radius: 6px; padding: 2px 9px;
    background: var(--surface-2); flex: none;
}
.deck-search .gs-drop {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; display: none; max-height: 380px; overflow-y: auto;
}
.deck-search.open .gs-drop { display: block; }

.deck-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; margin-top: 22px; }
.deck-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px 22px 14px;
    min-width: 0;
}
.deck-card > h2 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    margin: 0 0 2px;
    color: var(--text);
}
.deck-card .deck-cap { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }

.attn-row {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
    text-decoration: none;
    color: var(--muted);
}
.attn-row:last-of-type { border-bottom: none; }
.attn-row b { color: var(--text); font-weight: 700; }
.attn-row:hover b { color: var(--tt-blue-bright); }
.attn-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.attn-dot.crit { background: var(--danger); }
.attn-dot.warn { background: var(--warning); }
.attn-dot.good { background: var(--success); }
.attn-go {
    font-family: var(--mono); font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.08em; color: var(--tt-blue-bright); white-space: nowrap;
}
.attn-empty { padding: 18px 0; color: var(--muted); font-size: 13.5px; }

.feed-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 12.8px;
    color: var(--muted);
    min-width: 0;
}
.feed-row:last-of-type { border-bottom: none; }
.feed-time { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.feed-op {
    font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em;
    color: var(--tt-blue-bright); background: var(--brand-wash);
    border-radius: 5px; padding: 1px 7px; white-space: nowrap;
}
.feed-op.bad { color: var(--danger-text); background: var(--danger-bg); }
.feed-what { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-what .feed-detail { color: var(--muted); font-weight: 400; }

.deck-clients { display: flex; flex-direction: column; }
.deck-client-row {
    display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border-soft);
    font-size: 13px; text-decoration: none; color: var(--text); font-weight: 600;
}
.deck-client-row:last-of-type { border-bottom: none; }
.deck-client-row:hover { color: var(--tt-blue-bright); }
.deck-client-row .num { color: var(--brand-color); font-weight: 700; font-size: 13.5px; }

/* ---------- Users directory chips ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 18px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 11.5px; font-weight: 600;
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    color: var(--muted); text-decoration: none;
    transition: border-color 120ms ease, background 120ms ease;
}
.chip .chip-n { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--tt-blue-bright); color: var(--text); }
.chip.active { background: var(--tt-blue); border-color: var(--tt-blue); color: #ffffff; }
.chip.active .chip-n { color: #ffffff; }
:root[data-theme="dark"] .chip.active, .chip.active.chip-darkfix { color: #ffffff; }
.chip.tone-crit { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.chip.tone-crit .chip-n { color: var(--danger-text); }
.chip.tone-warn { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.chip.tone-warn .chip-n { color: var(--warning-text); }
.chip.active.tone-crit { background: var(--danger); border-color: var(--danger); }
.chip.active.tone-crit .chip-n { color: #ffffff; }
.chip.active.tone-warn { background: var(--warning); border-color: var(--warning); }
.chip.active.tone-warn .chip-n { color: #ffffff; }

.dir-upn { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.dir-open {
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    letter-spacing: 0.06em; color: var(--tt-blue-bright); text-decoration: none; white-space: nowrap;
}
.dir-open:hover { text-decoration: underline; }
.dir-pills { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- User workspace (verify-first + action rail) ---------- */
.uw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 22px; align-items: start; }
.uw-rail { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 8px; }
.uw-rail-label {
    font-family: var(--mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
    margin: 0 0 2px 2px;
}
.uw-rail-label + .uw-rail-label { margin-top: 12px; }
.uw-act {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 13.5px;
    font-weight: 700;
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
    height: auto;
    margin: 0;
    box-shadow: var(--shadow);
    transition: border-color 120ms ease, transform 120ms ease;
}
.uw-act:hover { border-color: var(--tt-blue-bright); transform: translateY(-1px); background: var(--surface); }
.uw-act .uw-hint {
    font-family: var(--mono); font-size: 9px; font-weight: 600;
    letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; white-space: nowrap;
}
.uw-act.primary {
    background: linear-gradient(135deg, var(--tt-blue-dark), var(--tt-blue-bright));
    color: #ffffff; border-color: transparent;
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--tt-blue-dark) 70%, transparent);
}
.uw-act.primary:hover { border-color: transparent; filter: brightness(1.08); }
.uw-act.primary .uw-hint { color: rgba(255, 255, 255, 0.7); }
.uw-act.danger { color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-bg); }
.uw-act.danger:hover { border-color: var(--danger); }
.uw-act:disabled { opacity: 0.5; cursor: default; transform: none; }
.uw-rail form { margin: 0; }

.uw-verify {
    border: 1px solid color-mix(in srgb, var(--success) 38%, transparent);
    background: color-mix(in srgb, var(--success) 5%, var(--surface));
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    margin: 18px 0 4px;
}
.uw-verify h2 {
    font-family: var(--mono); font-size: 11px; font-weight: 700;
    letter-spacing: 0.13em; text-transform: uppercase; margin: 0 0 2px;
}
.uw-verify .uw-vcap { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }
.uw-vgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 22px; }
.uw-vitem { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.uw-vitem .k {
    font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.uw-vitem .v { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.uw-vitem .v .pill { vertical-align: middle; }
.uw-vfoot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.uw-vfoot form { margin: 0; }

.portal-stats-grid.deck-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 0; }
@media (max-width: 1400px) { .portal-stats-grid.deck-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .portal-stats-grid.deck-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 1100px) {
    .deck-grid { grid-template-columns: 1fr; }
    .uw-layout { grid-template-columns: 1fr; }
    .uw-rail { position: static; flex-direction: row; flex-wrap: wrap; }
    .uw-rail-label { width: 100%; }
    .uw-act { width: auto; flex: 1 1 200px; }
}

/* =====================================================================
   2026-07-19b — polish layer: charts, count-up, live pulse, brand
   ===================================================================== */

/* ---------- CSS-only charts (report design language) ---------- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }

.chart-cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 6px; }
.chart-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; }
.chart-cval { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-bar {
    width: 100%; max-width: 34px; height: var(--h, 0%); min-height: 3px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--tt-blue-bright) 0%, var(--tt-blue) 100%);
    transform-origin: bottom;
    animation: tt-grow-y 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.chart-col:hover .chart-bar { filter: brightness(1.15); }
.chart-clabel { font-family: var(--mono); font-size: 9px; color: var(--muted); }
@keyframes tt-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.chart-hbars { display: flex; flex-direction: column; gap: 13px; padding: 4px 0 8px; }
.chart-hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px; gap: 12px; align-items: center; }
.chart-hname { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { position: relative; background: var(--surface-3); border-radius: 5px; height: 20px; overflow: hidden; }
.chart-fill {
    height: 100%; width: var(--w, 0%); border-radius: 5px;
    background: var(--tt-blue-bright); opacity: 0.72;
    transform-origin: left;
    animation: tt-grow-x 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.chart-fill.hot { background: linear-gradient(90deg, var(--tt-blue-dark), var(--tt-blue-bright)); opacity: 1; }
.chart-hbar:hover .chart-fill { filter: brightness(1.12); }
.chart-hv { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
@keyframes tt-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1100px) { .chart-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .chart-bar, .chart-fill { animation: none; } }

/* ---------- Live pulse dot ---------- */
.live-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--success); margin-right: 8px; vertical-align: middle; position: relative;
}
.live-dot::after {
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--success); opacity: 0.6;
    animation: tt-pulse 2s ease-out infinite;
}
@keyframes tt-pulse { 0% { transform: scale(0.5); opacity: 0.7; } 80% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; opacity: 0; } }

/* ---------- Card hover lift ---------- */
.deck-card { transition: transform 140ms ease, box-shadow 140ms ease; }
.deck-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ---------- Brand (logo is navy #28326F on transparent PNG) ---------- */
.sidebar-logo { display: block; height: 30px; width: auto; filter: brightness(0) invert(1); }
.brand-logo { display: block; height: 46px; width: auto; margin: 0 0 16px; }
.public-reset-brand-logo { display: block; height: 40px; width: auto; margin: 0 0 14px; }
@media (prefers-color-scheme: dark) {
    .brand-logo, .public-reset-brand-logo { filter: brightness(0) invert(1); }
}
:root[data-theme="dark"] .brand-logo, :root[data-theme="dark"] .public-reset-brand-logo { filter: brightness(0) invert(1); }
:root[data-theme="light"] .brand-logo, :root[data-theme="light"] .public-reset-brand-logo { filter: none; }

/* ---------- Ambient animated gradient on the public/auth pages ----------
   Hard-coded deep navy (like the sidebar) so dark mode can't flip it light. */
.login-body, .public-reset-body {
    background: linear-gradient(160deg, #181e44, #10142e, #1d2557, #131735);
    background-size: 300% 300%;
    animation: tt-grad 20s ease infinite;
}
@keyframes tt-grad { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@media (prefers-reduced-motion: reduce) { .login-body, .public-reset-body { animation: none; } }
