/* ═══════════════════════════════════════════════════════════
   Montefiore Urology — Reimbursement Portal
   Styles — Redesigned 2026-03-21
   Design system: Inter · Indigo · Tailwind palette
   ═══════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ── */
:root {
    /* Brand — indigo accent (matches reference design) */
    --indigo-50: #eef2ff;
    --indigo-100: #e0e7ff;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --indigo-700: #4338ca;

    /* Gray scale — maps to Tailwind gray */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gray-950: #030712;

    /* Semantic — status colors */
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --rose-50: #fff1f2;
    --rose-100: #ffe4e6;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --purple-50: #faf5ff;
    --purple-100: #f3e8ff;
    --purple-600: #9333ea;
    --purple-700: #7e22ce;
    --pink-50: #fdf2f8;
    --pink-100: #fce7f3;
    --pink-600: #db2777;
    --pink-700: #be185d;
    --cyan-50: #ecfeff;
    --cyan-100: #cffafe;
    --cyan-600: #0891b2;
    --cyan-700: #0e7490;
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-600: #0284c7;

    /* Aliases — keep existing semantic names working */
    --navy: #030712;
    --navy2: #1f2937;
    --blue: #4f46e5;
    --green: #059669;
    --green-bg: #d1fae5;
    --amber: #d97706;
    --amber-bg: #fef3c7;
    --red: #e11d48;
    --red-bg: #ffe4e6;
    --purple: #9333ea;
    --purple-bg: #f3e8ff;
    --orange: #ea580c;
    --orange-bg: #ffedd5;
    --pink: #db2777;
    --pink-bg: #fce7f3;
    --sky: #0284c7;
    --sky-bg: #e0f2fe;
    --stipend: #9333ea;
    --stipend-bg: #f3e8ff;
    --chair: #d97706;
    --chair-bg: #fef3c7;
    --sleep: #0891b2;
    --sleep-bg: #cffafe;

    /* Old slate scale — mapped to new gray scale */
    --slate-50: var(--gray-50);
    --slate-100: var(--gray-100);
    --slate-200: var(--gray-200);
    --slate-300: var(--gray-300);
    --slate-400: var(--gray-400);
    --slate-500: var(--gray-500);
    --slate-600: var(--gray-600);
    --slate-700: var(--gray-700);
    --slate-800: var(--gray-900);

    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Cascadia Code', monospace;

    /* Spacing scale */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;

    /* Font-size scale */
    --text-xs: 10px;
    --text-sm: 11px;
    --text-2sm: 12px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 15px;
    --text-xl: 18px;
    --text-2xl: 22px;
    --text-3xl: 30px;

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;
}

/* ── RESET ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── BASE ── */
body {
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.5;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── UTILITIES ── */
.hidden {
    display: none !important;
}

.text-eyebrow {
    font-size: var(--text-xs);
    font-weight: 800;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.text-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
    line-height: 1.45;
}

.text-body-strong {
    font-size: var(--text-2sm);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
}

.text-body-heavy {
    font-size: var(--text-base);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.text-section-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.25;
}

.text-stat {
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.02em;
}

.text-stat-xl {
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.03em;
}

/* ── BADGE ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    ring: 1px;
}

/* Status badges — ring style matching reference */
.s-pending {
    background: var(--amber-50);
    color: var(--amber-600);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .2);
}

.s-approved {
    background: var(--emerald-50);
    color: var(--emerald-700);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .2);
}

.s-rejected {
    background: var(--rose-50);
    color: var(--rose-600);
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .2);
}

.s-complete {
    background: var(--indigo-50);
    color: var(--indigo-700);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .2);
}

/* Account badges */
.a-gme {
    background: var(--emerald-50);
    color: var(--emerald-700);
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, .2);
}

.a-dept {
    background: var(--blue-50);
    color: var(--blue-700);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .2);
}

.a-stipend {
    background: var(--purple-50);
    color: var(--purple-700);
    box-shadow: inset 0 0 0 1px rgba(147, 51, 234, .2);
}

.a-teaching {
    background: var(--orange-50);
    color: var(--orange-700);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, .2);
}

.a-donation {
    background: var(--pink-50);
    color: var(--pink-700);
    box-shadow: inset 0 0 0 1px rgba(219, 39, 119, .2);
}

.a-chair {
    background: var(--amber-50);
    color: var(--amber-600);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .2);
}

.a-sleep {
    background: var(--cyan-50);
    color: var(--cyan-700);
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, .2);
}

/* ── CARD ── */
.card {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    overflow: hidden;
}

.card-hdr {
    padding: var(--sp-4) 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    background: #fff;
}

.card-hdr .title {
    font-weight: 600;
    font-size: var(--text-md);
    color: var(--gray-900);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.card-hdr .sub {
    font-size: var(--text-sm);
    color: var(--gray-400);
    margin-top: 1px;
}

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: var(--text-md);
    font-weight: 500;
    font-family: var(--font);
    border: none;
    line-height: 1;
    white-space: nowrap;
    transition: all .15s;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: scale(.98);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: var(--radius-md);
}

.btn-xs {
    padding: 3px 9px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--gray-900);
    color: #fff;
}

.btn-primary:hover {
    background: var(--gray-800);
}

.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-200) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.btn-danger {
    background: #fff;
    color: var(--red);
    border: 1px solid #fecaca !important;
}

.btn-danger:hover {
    background: var(--rose-50);
}

.btn-success {
    background: var(--emerald-600);
    color: #fff;
}

.btn-success:hover {
    background: var(--emerald-700);
}

.btn-warning {
    background: var(--amber-500);
    color: #fff;
}

.btn-warning:hover {
    background: var(--amber-600);
}

/* ── FORM INPUTS ── */
.inp {
    width: 100%;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    font-size: var(--text-md);
    font-family: var(--font);
    background: #fff;
    color: var(--gray-900);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.inp:focus {
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}

.inp::placeholder {
    color: var(--gray-400);
}

textarea.inp {
    resize: vertical;
}

select.inp {
    cursor: pointer;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 5px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.field label .req {
    color: var(--red);
}

/* ── PILL TOGGLE BUTTONS ── */
.pill-btn {
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    line-height: 1;
    white-space: nowrap;
    transition: all .15s;
    background: #fff;
}

.pill-btn.active {
    background: var(--gray-900);
    color: #fff;
    border-color: var(--gray-900);
}

.pill-btn.inactive {
    background: #fff;
    color: var(--gray-600);
    border-color: var(--gray-200);
}

.pill-btn.inactive:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

/* ── TOP BAR (System Nav — dark) ── */
.topbar {
    background: var(--gray-950);
    border-bottom: 1px solid var(--gray-800);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 24px;
    gap: 12px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--indigo-600);
    flex-shrink: 0;
}

.topbar-org {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.topbar-portal {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
}

.topbar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-user {
    font-size: 13px;
    color: var(--gray-400);
    white-space: nowrap;
}

.topbar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background: var(--gray-800);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.topbar-select {
    appearance: none;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-family: var(--font);
    padding: 5px 26px 5px 10px;
    cursor: pointer;
    outline: none;
}

.topbar-select:focus {
    border-color: var(--indigo-500);
}

.topbar-select option {
    background: #1f2937;
    color: #fff;
}

.topbar-search {
    width: 100%;
    padding: 6px 12px 6px 32px;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s;
}

.topbar-search:focus {
    border-color: var(--indigo-500);
}

.topbar-search::placeholder {
    color: var(--gray-500);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 20px;
    border-left: 1px solid var(--gray-800);
}

.topbar-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 6px;
    transition: color .15s, background .15s;
    position: relative;
}

.topbar-icon-btn:hover {
    color: #fff;
    background: var(--gray-800);
}

.topbar-signout {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 6px;
    color: var(--gray-300);
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font);
    font-weight: 500;
    white-space: nowrap;
    transition: all .15s;
}

.topbar-signout:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* ── APP NAV (Tab Bar — light) ── */
.topbar-nav {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 52px;
    z-index: 29;
}

.tab-bar {
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 2px;
    overflow: visible;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-btn-group {
    display: flex;
    gap: 2px;
}

.tab-dropdown {
    display: none;
    margin: 6px 12px;
    width: calc(100% - 24px);
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    font-size: 13px;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    appearance: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    background: transparent;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s, background .15s;
    flex-shrink: 0;
    border-radius: 6px 6px 0 0;
    letter-spacing: -0.01em;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--gray-900);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--indigo-600);
    border-bottom-color: var(--indigo-600);
    border-bottom-width: 3px;
    background: var(--indigo-50);
    font-weight: 700;
}

/* ── TAB DROPDOWN PANELS ── */
.tab-ddwrap {
    position: relative;
}

.tab-ddpanel {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
    z-index: 9999;
    min-width: 180px;
    padding: 4px 0;
}

.tab-dditem {
    display: block;
    width: 100%;
    padding: 9px 16px;
    border: none;
    border-left: 3px solid transparent;
    background: none;
    text-align: left;
    font-size: 13px;
    font-family: var(--font);
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-left-color .12s;
}

.tab-dditem:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    border-left-color: var(--gray-300);
}

.tab-dditem.active {
    background: var(--indigo-50);
    color: var(--indigo-700);
    font-weight: 600;
    border-left-color: var(--indigo-500);
}

/* ── STICKY FILTER BAR ── */
.filter-bar {
    position: sticky;
    top: 92px;
    /* topbar (52px) + topbar-nav (~40px) */
    z-index: 27;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── NOTIFICATION DOT ── */
.notif-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    background: var(--rose-500);
    color: #fff;
    border-radius: var(--radius-full);
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    vertical-align: middle;
    min-width: 16px;
}

/* ── MAIN CONTENT ── */
.main {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* ── LOGIN ── */
#login-page {
    min-height: 100vh;
    background: var(--gray-950);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}

.login-box {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-2xl);
    padding: 44px 48px;
    width: 380px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, .5);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--indigo-600);
    margin-bottom: 16px;
}

.login-logo-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-logo-sub {
    color: rgba(255, 255, 255, .3);
    font-size: 10px;
    margin-top: 4px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.login-field-label {
    color: rgba(255, 255, 255, .4);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.login-inp {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.login-inp::placeholder {
    color: rgba(255, 255, 255, .25);
}

.login-inp:focus {
    border-color: var(--indigo-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.login-pw-wrap {
    position: relative;
}

.login-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, .3);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.login-err {
    background: rgba(225, 29, 72, .15);
    border: 1px solid rgba(225, 29, 72, .3);
    border-radius: var(--radius-md);
    padding: var(--sp-2) var(--sp-3);
    color: #fca5a5;
    font-size: 12px;
    margin-bottom: 14px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    border: none;
    background: var(--indigo-600);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s;
    letter-spacing: -0.01em;
}

.login-btn:hover {
    background: var(--indigo-700);
}

/* ── SECTION HEADER ── */
.sec-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
    gap: 10px;
}

.sec-hdr h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.sec-hdr p {
    font-size: var(--text-base);
    color: var(--gray-500);
    margin-top: 2px;
}

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.stat-card .lbl {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.stat-card .val {
    font-size: 22px;
    font-weight: 700;
    margin-top: 6px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

button.stat-card {
    appearance: none;
    font: inherit;
    width: 100%;
}

/* ── PROGRESS BAR ── */
.prog-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
    height: 6px;
    overflow: hidden;
}

.prog-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width .5s;
}

/* ── DATA TABLE ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 10px 16px;
    text-align: left;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    user-select: none;
    white-space: nowrap;
    cursor: pointer;
}

.data-table th.amt-col {
    text-align: right;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-600);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--gray-50) !important;
}

.data-table tfoot td {
    padding: 10px 16px;
}

.tfoot-dark {
    background: var(--gray-900);
}

.tfoot-dark td {
    color: rgba(255, 255, 255, .85);
    font-weight: 600;
    font-size: 13px;
}

/* ── STEP WIZARD ── */
.step-row {
    display: flex;
    gap: var(--sp-1);
    margin-bottom: var(--sp-6);
    align-items: center;
}

.step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-circle.done {
    background: var(--emerald-500);
    color: #fff;
}

.step-circle.current {
    background: var(--gray-900);
    color: #fff;
}

.step-circle.todo {
    background: var(--gray-200);
    color: var(--gray-400);
}

.step-label {
    font-size: 13px;
    font-weight: 500;
}

.step-label.current {
    color: var(--gray-900);
}

.step-label.other {
    color: var(--gray-400);
}

.step-line {
    flex: 1;
    height: 2px;
    border-radius: 1px;
}

.step-line.done {
    background: var(--emerald-500);
}

.step-line.todo {
    background: var(--gray-200);
}

/* ── SUBMIT UPLOAD CHOICE ── */
.sf-upload-choice {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.sf-upload-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 10px;
    border-radius: 16px;
    border: 1.5px solid var(--gray-200);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.15s;
    min-height: 88px;
}

.sf-upload-btn:hover {
    border-color: var(--indigo-300);
    background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.sf-upload-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

.sf-upload-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

.sf-upload-icon {
    font-size: 26px;
    line-height: 1;
}

.sf-upload-label {
    font-size: 13px;
    font-weight: 700;
    color: #0f2942;
    text-align: center;
    line-height: 1.2;
}

.sf-upload-hint {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 500;
    text-align: center;
}

/* ── SUBMIT STEP FOOTER ── */
.sf-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.sf-step-footer-end {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── DROP ZONE ── */
.drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 32px var(--sp-5);
    text-align: center;
    cursor: pointer;
    background: var(--gray-50);
    margin-bottom: var(--sp-4);
    transition: all .2s;
}

.drop-zone:hover,
.drop-zone.hover {
    border-color: var(--indigo-500);
    background: var(--indigo-50);
}

.drop-zone .dz-icon {
    font-size: 30px;
    margin-bottom: var(--sp-2);
}

.drop-zone .dz-title {
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--text-md);
}

.drop-zone .dz-sub {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: var(--sp-1);
}

.receipt-insights {
    margin-bottom: 16px;
    border-radius: 18px;
    border: 1px solid #f5b942;
    background:
        radial-gradient(circle at top right, rgba(250, 204, 21, .18), transparent 32%),
        linear-gradient(180deg, #fffdf6 0%, #fff6d7 100%);
    box-shadow: 0 18px 40px rgba(217, 119, 6, .08);
    overflow: hidden;
}

.receipt-insights-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 18px 14px;
}

.receipt-insights-title {
    font-size: 15px;
    font-weight: 800;
    color: #8a4b07;
    letter-spacing: -.01em;
}

.receipt-insights-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #9a5b13;
    max-width: 470px;
    line-height: 1.45;
}

.receipt-insights-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.receipt-insights-status.parsed {
    color: #166534;
    background: #dcfce7;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .2);
}

.receipt-insights-status.review {
    color: #92400e;
    background: #fef3c7;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .28);
}

.receipt-insights-body {
    padding: 0 18px 18px;
}

.receipt-insights-callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.receipt-insights-callout.match {
    color: #166534;
    background: rgba(240, 253, 244, .95);
    border: 1px solid #bbf7d0;
}

.receipt-insights-callout.review {
    color: #92400e;
    background: rgba(255, 251, 235, .95);
    border: 1px solid #fcd34d;
}

.receipt-insights-callout.error {
    color: #b91c1c;
    background: rgba(254, 242, 242, .98);
    border: 1px solid #fecaca;
}

.receipt-insights-callout-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    background: rgba(255, 255, 255, .7);
}

.receipt-insights-grid {
    display: grid;
    gap: 10px;
}

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

.receipt-insights-grid.secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
}

.receipt-insight-card {
    position: relative;
    padding: 14px 14px 13px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.receipt-insight-card.primary {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(255, 250, 235, .95) 100%);
    border-color: #fcd34d;
}

.receipt-insight-card.emphasis {
    border-width: 2px;
    border-color: #f59e0b;
    box-shadow: 0 8px 22px rgba(245, 158, 11, .12);
}

.receipt-insight-card.ok {
    border-color: #86efac;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(240, 253, 244, .95) 100%);
}

.receipt-insight-card.missing {
    border-color: #f59e0b;
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(255, 251, 235, .98) 100%);
}

.receipt-insight-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 6px;
}

.receipt-insight-value {
    font-size: 13px;
    line-height: 1.45;
    color: #0f2942;
    font-weight: 700;
}

.receipt-insight-card.primary .receipt-insight-value {
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.receipt-insight-card.secondary .receipt-insight-value {
    font-size: 14px;
}

.receipt-insight-card.missing .receipt-insight-value {
    color: #9a3412;
}

.receipt-insight-note {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: #64748b;
}

.receipt-insight-card.missing .receipt-insight-note {
    color: #b45309;
}

.receipt-insights-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.receipt-insights-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: rgba(255, 255, 255, .82);
    border: 1px solid #e2e8f0;
}

.receipt-insights-notes {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.receipt-insights-note {
    font-size: 11px;
    line-height: 1.45;
    color: #475569;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 12px;
    padding: 9px 11px;
}

.receipt-edit-strip {
    margin: 2px 0 16px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.receipt-edit-strip-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.receipt-edit-strip-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f2942;
    letter-spacing: -.01em;
}

.receipt-edit-strip-subtitle {
    margin-top: 3px;
    font-size: 11px;
    color: #64748b;
    line-height: 1.45;
}

.receipt-edit-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.receipt-edit-static {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 12px 13px;
}

.receipt-edit-static.ok {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.receipt-edit-static.warn {
    border-color: #fcd34d;
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}

.receipt-edit-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.receipt-edit-static-value {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f2942;
}

.receipt-edit-static-note {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
    color: #64748b;
}

.receipt-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.receipt-edit-guidance {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11px;
    line-height: 1.5;
    font-weight: 600;
}

.receipt-person-field {
    border-radius: 14px;
    transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.receipt-person-pulse {
    background: rgba(255, 251, 235, .9);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18), 0 18px 35px rgba(245, 158, 11, .12);
    animation: receiptPersonPulse 1.5s ease-out 1;
}

@keyframes receiptPersonPulse {
    0% {
        transform: translateY(0);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, .35);
    }

    35% {
        transform: translateY(-1px);
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        transform: translateY(0);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* ── FILE LIST ── */
.file-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    font-size: 12px;
}

.file-item .fi-name {
    font-weight: 600;
    color: var(--emerald-700);
}

.file-item .fi-path {
    color: var(--gray-400);
    font-size: 10px;
    font-family: var(--mono);
}

.file-item .fi-rm {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--red);
    font-size: 16px;
    margin-left: auto;
}

/* ── QUEUE ── */
.queue-row {
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    cursor: pointer;
    transition: background .1s;
}

.queue-row:hover {
    background: var(--gray-50);
}

.queue-row:nth-child(even) {
    background: #fafafa;
}

.queue-row:nth-child(even):hover {
    background: var(--gray-100);
}

/* ── QUEUE DETAIL STICKY PANEL ── */
.queue-detail-sticky {
    position: sticky;
    top: 100px;
    align-self: start;
}

/* ── ADMIN HUB KPI CARDS ── */
.admin-hub-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.kpi-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: 18px 20px;
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
    user-select: none;
}

.kpi-card:hover {
    box-shadow: 0 4px 16px rgba(15, 41, 66, .12);
    transform: translateY(-1px);
}

.kpi-card:active {
    transform: translateY(0);
    box-shadow: none;
}

.kpi-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.kpi-lbl {
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.kpi-val {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

@media (max-width: 900px) {
    .admin-hub-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-hub-kpis {
        grid-template-columns: 1fr;
    }

    .queue-detail-sticky {
        position: static;
    }
}

/* ── RESIDENT / PERSON CARD ── */
.res-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    transition: all .15s;
}

.res-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    border-color: var(--gray-300);
}

.res-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--sp-3);
}

/* ── NOTIFICATION PANEL ── */
.notif-item {
    padding: 10px 14px;
    font-size: 13px;
    border-left: 3px solid;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: var(--sp-2);
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    line-height: 1.4;
}

.notif-item.unread {
    border-color: var(--indigo-600);
    font-weight: 500;
    color: var(--gray-900);
    background: var(--indigo-50);
}

.notif-item.read {
    border-color: var(--gray-200);
    color: var(--gray-600);
}

.notif-date {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}

/* ── FOLDER TREE ── */
.folder-node {
    padding-left: 14px;
}

.folder-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--gray-700);
    font-size: 12px;
    font-family: var(--mono);
    transition: background .1s;
}

.folder-row:hover,
.folder-row.open {
    background: var(--indigo-50);
    color: var(--indigo-700);
}

/* ── GME CARDS ── */
.gme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--sp-3);
}

.gme-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 16px 18px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

/* ── AY CARDS ── */
.ay-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px;
    margin-bottom: var(--sp-4);
}

.ay-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 14px 16px;
    cursor: pointer;
    border: 1.5px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    transition: all .15s;
}

.ay-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.ay-card.selected {
    border-color: var(--indigo-500);
    background: var(--indigo-50);
}

.ay-card .ay-lbl {
    font-size: 11px;
    font-weight: 500;
    color: var(--gray-400);
    letter-spacing: .3px;
    text-transform: uppercase;
}

.ay-card.selected .ay-lbl {
    color: var(--indigo-600);
}

.ay-card .ay-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 3px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.ay-card .ay-cnt {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

.ay-card-total {
    background: var(--gray-900);
    border-radius: var(--radius-xl);
    padding: 14px 16px;
    color: #fff;
    cursor: pointer;
    border: 1.5px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}

/* ── AUTOMATION STEPS ── */
.auto-step {
    display: flex;
    gap: var(--sp-4);
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    border-left: 4px solid;
    margin-bottom: var(--sp-3);
}

.auto-step .as-icon {
    font-size: 26px;
    min-width: 40px;
    line-height: 1;
}

/* ── PROFILE DETAIL LAYOUT ── */
.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
}

.mobile-profile-note,
.mobile-chart-summary {
    display: none;
}

.mobile-chart-graphics {
    display: block;
}

.mobile-chart-summary-note {
    font-size: 12px;
    color: #1e3a8a;
    line-height: 1.5;
    margin-bottom: 10px;
}

.mobile-chart-summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-chart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.mobile-chart-summary-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mobile-chart-summary-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--gray-400);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.mobile-chart-summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    text-align: right;
    line-height: 1.4;
}

/* ── SUMMARY ROW ── */
.sum-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    gap: var(--sp-2);
}

.sum-row:last-child {
    border-bottom: none;
}

.sum-row .sr-lbl {
    color: var(--gray-500);
}

.sum-row .sr-val {
    font-weight: 600;
    color: var(--gray-900);
    text-align: right;
}

/* ── CONFIRM MODAL ── */
#confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(79, 70, 229, .16), transparent 36%), rgba(2, 6, 23, .52);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    animation: fadeIn .12s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#confirm-modal-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .96) 100%);
    border-radius: 24px;
    padding: 26px 28px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    animation: slideUp .15s ease;
    border: 1px solid rgba(255, 255, 255, .72);
}

@keyframes slideUp {
    from {
        transform: translateY(12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#confirm-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.confirm-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirm-modal-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--indigo-100) 100%);
    box-shadow: inset 0 0 0 1px rgba(79, 70, 229, .12);
    font-size: 17px;
}

#confirm-modal-body {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 22px;
    white-space: pre-wrap;
}

#confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

#confirm-modal-box.confirm-modal-variant-submission {
    max-width: 560px;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

#confirm-modal-box.confirm-modal-variant-submission #confirm-modal-title {
    padding: 22px 24px 8px;
    margin-bottom: 0;
}

#confirm-modal-box.confirm-modal-variant-submission #confirm-modal-body {
    padding: 0 24px 18px;
    margin-bottom: 0;
}

#confirm-modal-box.confirm-modal-variant-submission #confirm-modal-actions {
    padding: 0 24px 24px;
}

.confirm-submit-review {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.confirm-submit-kicker {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--blue-50) 0%, var(--indigo-100) 100%);
    color: var(--indigo-700);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.confirm-submit-intro {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.55;
}

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

.confirm-submit-metric {
    border-radius: 16px;
    padding: 14px 14px 13px;
    border: 1px solid var(--gray-200);
    background: #fff;
}

.confirm-submit-metric-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.confirm-submit-metric-value {
    font-size: 22px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--gray-900);
}

.confirm-submit-metric.tone-requested {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.confirm-submit-metric.tone-payable {
    background: linear-gradient(180deg, var(--emerald-50) 0%, #ffffff 100%);
    border-color: rgba(5, 150, 105, .18);
}

.confirm-submit-metric.tone-payable .confirm-submit-metric-value {
    color: var(--emerald-700);
}

.confirm-submit-metric.tone-info {
    background: linear-gradient(180deg, var(--blue-50) 0%, #ffffff 100%);
    border-color: rgba(37, 99, 235, .16);
}

.confirm-submit-metric.tone-info .confirm-submit-metric-value {
    color: var(--blue-700);
}

.confirm-submit-metric.tone-unpaid {
    background: linear-gradient(180deg, var(--rose-50) 0%, #ffffff 100%);
    border-color: rgba(225, 29, 72, .16);
}

.confirm-submit-metric.tone-unpaid .confirm-submit-metric-value {
    color: var(--rose-600);
}

.confirm-submit-metric.tone-covered {
    background: linear-gradient(180deg, var(--cyan-50) 0%, #ffffff 100%);
    border-color: rgba(8, 145, 178, .16);
}

.confirm-submit-metric.tone-covered .confirm-submit-metric-value {
    color: var(--cyan-700);
    font-size: 16px;
    letter-spacing: -.01em;
}

.confirm-submit-details {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--gray-200);
    border-radius: 18px;
}

.confirm-submit-row {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.confirm-submit-row-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-500);
    padding-top: 2px;
}

.confirm-submit-row-value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.5;
    word-break: break-word;
}

.confirm-submit-callout {
    border-radius: 16px;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    background: #fff;
    font-size: 13px;
    line-height: 1.55;
}

.confirm-submit-callout-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.confirm-submit-callout.tone-warning {
    background: linear-gradient(180deg, var(--orange-50) 0%, #ffffff 100%);
    border-color: rgba(234, 88, 12, .18);
    color: var(--orange-700);
}

.confirm-submit-callout.tone-warning .confirm-submit-callout-title {
    color: var(--orange-700);
}

.confirm-submit-callout.tone-info {
    background: linear-gradient(180deg, var(--blue-50) 0%, #ffffff 100%);
    border-color: rgba(37, 99, 235, .18);
    color: var(--blue-700);
}

.confirm-submit-callout.tone-info .confirm-submit-callout-title {
    color: var(--blue-700);
}

.confirm-submit-callout.tone-policy {
    background: linear-gradient(180deg, var(--gray-50) 0%, #ffffff 100%);
    color: var(--gray-700);
}

.confirm-submit-callout.tone-policy .confirm-submit-callout-title {
    color: var(--gray-700);
}

@media (max-width: 640px) {
    #confirm-modal-box.confirm-modal-variant-submission {
        max-width: 100%;
    }

    .confirm-submit-metrics {
        grid-template-columns: 1fr;
    }

    .confirm-submit-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ── AY SWITCHER ── */
#ay-switcher option {
    background: var(--gray-800);
    color: #fff;
}

/* ── UPLOAD PROGRESS ── */
.upload-progress-bar {
    background: var(--sky-50);
    border: 1px solid var(--sky-100);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 10px;
}

.upb-label {
    font-size: 12px;
    color: var(--sky-600);
    margin-bottom: 6px;
    font-weight: 500;
}

.upb-label em {
    font-style: normal;
    font-weight: 600;
}

.upb-track {
    height: 5px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.upb-fill {
    height: 5px;
    background: var(--sky-600);
    border-radius: 3px;
    transition: width .4s ease;
}

/* ── DESC CHIPS ── */
.desc-chip {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 3px 10px;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all .15s;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.desc-chip:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

/* ── GLOBAL SEARCH ── */
#global-search-inp::placeholder {
    color: var(--gray-500);
}

.gs-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background .1s;
}

.gs-result-item:last-child {
    border-bottom: none;
}

.gs-result-item:hover {
    background: var(--gray-50);
}

.gs-result-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.gs-result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

.gs-result-sub {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 1px;
}

.gs-section-hdr {
    padding: 8px 14px 4px;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════ */

body.dark-mode {
    --gray-50: #1a1f2e;
    --gray-100: #1f2535;
    --gray-200: #28304a;
    --gray-300: #374160;
    --gray-400: #6b7fa8;
    --gray-500: #8b9dc0;
    --gray-600: #a8b8d4;
    --gray-700: #c8d4e8;
    --gray-800: #1a1f2e;
    --gray-900: #e2e8f0;
    background: #13171f;
    color: #e2e8f0;
}

/* Remap slate to gray in dark mode */
body.dark-mode {
    --slate-50: var(--gray-50);
    --slate-100: var(--gray-100);
    --slate-200: var(--gray-200);
    --slate-300: var(--gray-300);
    --slate-400: var(--gray-400);
    --slate-500: var(--gray-500);
    --slate-600: var(--gray-600);
    --slate-700: var(--gray-700);
    --slate-800: var(--gray-900);
}

body.dark-mode .card {
    background: #1f2535;
    border-color: #28304a;
}

body.dark-mode .card-hdr {
    background: #1f2535;
    border-bottom-color: #28304a;
}

body.dark-mode .inp {
    background: #1a1f2e;
    border-color: #28304a;
    color: #e2e8f0;
}

body.dark-mode .inp::placeholder {
    color: #6b7fa8;
}

body.dark-mode .btn-secondary {
    background: #1f2535;
    color: #a8b8d4;
    border-color: #28304a !important;
}

body.dark-mode .pill-btn.inactive {
    background: #1f2535;
    color: #a8b8d4;
    border-color: #28304a;
}

body.dark-mode .pill-btn.active {
    background: #e2e8f0;
    color: #13171f;
    border-color: #e2e8f0;
}

body.dark-mode .topbar-nav {
    background: #1f2535;
    border-bottom-color: #28304a;
}

body.dark-mode .filter-bar {
    background: #1f2535;
    border-bottom-color: #28304a;
}

body.dark-mode .tab-btn {
    color: #6b7fa8;
}

body.dark-mode .tab-btn:hover {
    color: #e2e8f0;
    background: #28304a;
}

body.dark-mode .tab-btn.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
    background: rgba(99, 102, 241, .1);
}

body.dark-mode .tab-ddpanel {
    background: #1f2535;
    border-color: #28304a;
}

body.dark-mode .tab-dditem {
    color: #a8b8d4;
}

body.dark-mode .tab-dditem:hover {
    background: #28304a;
    color: #e2e8f0;
}

body.dark-mode .tab-dditem.active {
    background: rgba(99, 102, 241, .15);
    color: #818cf8;
}

body.dark-mode .data-table th {
    background: #1a1f2e;
    color: #6b7fa8;
    border-bottom-color: #28304a;
}

body.dark-mode .data-table td {
    border-bottom-color: #1f2535;
    color: #c8d4e8;
}

body.dark-mode .data-table tbody tr:hover {
    background: #1f2535 !important;
}

body.dark-mode .tfoot-dark {
    background: #0c1120;
}

body.dark-mode .res-card,
body.dark-mode .gme-card,
body.dark-mode .ay-card {
    background: #1f2535;
    border-color: #28304a;
}

body.dark-mode .stat-card {
    background: #1f2535;
    border-color: #28304a;
}

body.dark-mode .auto-step {
    background: #1f2535;
    border-color: #28304a;
}

body.dark-mode .queue-row {
    border-bottom-color: #1f2535;
}

body.dark-mode .queue-row:hover {
    background: #1f2535;
}

body.dark-mode .queue-row:nth-child(even) {
    background: #1a1e2c;
}

body.dark-mode .queue-row:nth-child(even):hover {
    background: #1f2535;
}

body.dark-mode .prog-track {
    background: #28304a;
}

body.dark-mode .drop-zone {
    background: #1f2535;
    border-color: #374160;
}

body.dark-mode .receipt-insights {
    border-color: rgba(245, 158, 11, .35);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, .12), transparent 32%),
        linear-gradient(180deg, rgba(41, 37, 36, .96) 0%, rgba(28, 25, 23, .98) 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .25);
}

body.dark-mode .receipt-insights-title {
    color: #fbbf24;
}

body.dark-mode .receipt-insights-subtitle {
    color: #fed7aa;
}

body.dark-mode .receipt-insight-card {
    background: rgba(15, 23, 42, .72);
    border-color: rgba(71, 85, 105, .8);
}

body.dark-mode .receipt-insight-card.primary {
    background: linear-gradient(180deg, rgba(41, 37, 36, .82) 0%, rgba(68, 64, 60, .78) 100%);
    border-color: rgba(245, 158, 11, .45);
}

body.dark-mode .receipt-insight-card.ok {
    border-color: rgba(34, 197, 94, .45);
    background: linear-gradient(180deg, rgba(20, 83, 45, .28) 0%, rgba(15, 23, 42, .7) 100%);
}

body.dark-mode .receipt-insight-card.missing {
    border-color: rgba(245, 158, 11, .5);
    background: linear-gradient(180deg, rgba(120, 53, 15, .2) 0%, rgba(41, 37, 36, .82) 100%);
}

body.dark-mode .receipt-insight-value {
    color: #f8fafc;
}

body.dark-mode .receipt-insight-label {
    color: #cbd5e1;
}

body.dark-mode .receipt-insight-note,
body.dark-mode .receipt-insights-note,
body.dark-mode .receipt-insights-chip {
    color: #cbd5e1;
    background: rgba(15, 23, 42, .7);
    border-color: rgba(71, 85, 105, .8);
}

body.dark-mode .receipt-insights-callout.match {
    color: #bbf7d0;
    background: rgba(20, 83, 45, .28);
    border-color: rgba(34, 197, 94, .35);
}

body.dark-mode .receipt-insights-callout.review {
    color: #fde68a;
    background: rgba(120, 53, 15, .28);
    border-color: rgba(245, 158, 11, .35);
}

body.dark-mode .receipt-insights-callout.error {
    color: #fecaca;
    background: rgba(127, 29, 29, .28);
    border-color: rgba(239, 68, 68, .35);
}

body.dark-mode .receipt-edit-strip {
    border-color: rgba(71, 85, 105, .85);
    background: linear-gradient(180deg, rgba(15, 23, 42, .85) 0%, rgba(15, 23, 42, .72) 100%);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .22);
}

body.dark-mode .receipt-edit-strip-title,
body.dark-mode .receipt-edit-static-value {
    color: #f8fafc;
}

body.dark-mode .receipt-edit-strip-subtitle,
body.dark-mode .receipt-edit-static-note {
    color: #cbd5e1;
}

body.dark-mode .receipt-edit-static {
    background: rgba(15, 23, 42, .72);
    border-color: rgba(71, 85, 105, .8);
}

body.dark-mode .receipt-edit-static.ok {
    border-color: rgba(34, 197, 94, .35);
    background: linear-gradient(180deg, rgba(20, 83, 45, .3) 0%, rgba(15, 23, 42, .75) 100%);
}

body.dark-mode .receipt-edit-static.warn {
    border-color: rgba(245, 158, 11, .35);
    background: linear-gradient(180deg, rgba(120, 53, 15, .28) 0%, rgba(15, 23, 42, .75) 100%);
}

body.dark-mode .receipt-edit-label {
    color: #cbd5e1;
}

body.dark-mode .receipt-edit-guidance {
    border-color: rgba(37, 99, 235, .35);
    background: rgba(30, 64, 175, .2);
    color: #bfdbfe;
}

body.dark-mode .receipt-person-pulse {
    background: rgba(120, 53, 15, .18);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .16), 0 18px 35px rgba(245, 158, 11, .08);
}

body.dark-mode .sf-upload-btn {
    background: linear-gradient(180deg, #1a2744 0%, #111827 100%);
    border-color: rgba(71, 85, 105, .8);
}

body.dark-mode .sf-upload-btn:hover {
    border-color: rgba(99, 102, 241, .6);
    background: linear-gradient(180deg, #1e1b4b 0%, #1a1533 100%);
}

body.dark-mode .sf-upload-label {
    color: #f8fafc;
}

body.dark-mode .sf-upload-hint {
    color: #94a3b8;
}

body.dark-mode .file-item {
    background: #0d2b1a;
    border-color: #14532d;
}

body.dark-mode .notif-item.read {
    background: #1f2535;
}

body.dark-mode .notif-item.unread {
    background: rgba(99, 102, 241, .08);
}

body.dark-mode .folder-row:hover,
body.dark-mode .folder-row.open {
    background: rgba(99, 102, 241, .1);
    color: #818cf8;
}

body.dark-mode .sec-hdr h2,
body.dark-mode .card-hdr .title {
    color: #e2e8f0;
}

body.dark-mode .upload-progress-bar {
    background: #0c1a2e;
    border-color: #1e3a5f;
}

body.dark-mode .upb-track {
    background: #1e293b;
}

body.dark-mode .desc-chip {
    background: #1f2535;
    border-color: #28304a;
    color: #8b9dc0;
}

body.dark-mode .desc-chip:hover {
    background: #28304a;
    color: #e2e8f0;
}

body.dark-mode .gs-result-item:hover {
    background: #1f2535;
}

body.dark-mode .gs-result-title {
    color: #e2e8f0;
}

/* Badge backgrounds soften in dark mode */
body.dark-mode .s-pending {
    background: rgba(217, 119, 6, .15);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .3);
}

body.dark-mode .s-approved {
    background: rgba(16, 185, 129, .15);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .3);
}

body.dark-mode .s-rejected {
    background: rgba(225, 29, 72, .15);
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .3);
}

body.dark-mode .s-complete {
    background: rgba(99, 102, 241, .15);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .3);
}

body.dark-mode .a-gme {
    background: rgba(16, 185, 129, .15);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .3);
}

body.dark-mode .a-dept {
    background: rgba(37, 99, 235, .15);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .3);
}

body.dark-mode .a-stipend {
    background: rgba(147, 51, 234, .15);
    box-shadow: inset 0 0 0 1px rgba(147, 51, 234, .3);
}

body.dark-mode .a-teaching {
    background: rgba(234, 88, 12, .15);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, .3);
}

body.dark-mode .a-donation {
    background: rgba(219, 39, 119, .15);
    box-shadow: inset 0 0 0 1px rgba(219, 39, 119, .3);
}

body.dark-mode .a-chair {
    background: rgba(217, 119, 6, .15);
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .3);
}

body.dark-mode .a-sleep {
    background: rgba(8, 145, 178, .15);
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, .3);
}

/* ── BADGE: INFO / DRILLDOWN ── */
.badge-info {
    background: var(--blue-100);
    color: var(--blue-700);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .2);
}

body.dark-mode .badge-info {
    background: rgba(37, 99, 235, .15);
    color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .3);
}

@media (max-width: 720px) {
    .receipt-insights-header {
        flex-direction: column;
        align-items: stretch;
    }

    .receipt-insights-grid.primary,
    .receipt-insights-grid.secondary {
        grid-template-columns: 1fr;
    }

    .receipt-edit-strip-header {
        flex-direction: column;
    }

    .receipt-edit-grid {
        grid-template-columns: 1fr;
    }

    /* Upload choice: equal-width cards, slightly reduced padding */
    .sf-upload-btn {
        padding: 14px 8px;
        min-height: 76px;
    }

    .sf-upload-icon {
        font-size: 22px;
    }

    .sf-upload-label {
        font-size: 12px;
    }

    /* Drop zone: reduce padding on smaller screens */
    .drop-zone {
        padding: 22px var(--sp-4);
    }

    /* File item: allow name and path to wrap */
    .file-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .file-item .fi-name {
        word-break: break-all;
    }

    .file-item .fi-path {
        word-break: break-all;
    }
}

@media (max-width: 600px) {

    /* Upload choice: collapse to single column so each action is full-width */
    .sf-upload-choice {
        grid-template-columns: 1fr;
    }

    .sf-upload-btn {
        flex-direction: row;
        justify-content: flex-start;
        gap: 14px;
        padding: 14px 16px;
        min-height: 54px;
        border-radius: 12px;
    }

    .sf-upload-icon {
        font-size: 24px;
        flex-shrink: 0;
    }

    .sf-upload-label {
        font-size: 14px;
        font-weight: 700;
    }

    .sf-upload-hint {
        font-size: 11px;
    }

    /* Step footer: stack buttons full-width on very small screens */
    .sf-step-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .sf-step-footer>.btn,
    .sf-step-footer>button {
        width: 100%;
    }

    .sf-step-footer-end {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .sf-step-footer-end>.btn,
    .sf-step-footer-end>button {
        width: 100%;
    }

    /* Drop zone: compact on phone */
    .drop-zone {
        padding: 18px var(--sp-3);
    }
}

@media (max-width: 480px) {
    .sf-upload-btn {
        min-height: 48px;
    }

    .sf-upload-icon {
        font-size: 22px;
    }
}

/* ── VIEW TOGGLE ── */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.view-toggle-btn {
    padding: 5px 9px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: var(--gray-400);
    line-height: 1;
    transition: background .15s, color .15s;
}

.view-toggle-btn.active {
    background: #111827;
    color: #fff;
}

.view-toggle-btn:hover:not(.active) {
    background: var(--gray-100);
}

/* ── ACCOUNT FILTER PILLS ── */
.pill-acct {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 9999px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font);
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}

.pill-acct.active {
    border-width: 1.5px;
    border-color: var(--pill-c, #111827);
    background: var(--pill-bg, #f1f5f9);
    color: var(--pill-c, #111827);
    font-weight: 600;
}

.pill-acct.all-active {
    border: 1.5px solid #111827;
    background: #111827;
    color: #fff;
    font-weight: 600;
}

body.dark-mode .view-toggle {
    border-color: #28304a;
}

body.dark-mode .view-toggle-btn {
    color: #8899b8;
}

body.dark-mode .view-toggle-btn.active {
    background: #1d4ed8;
    color: #fff;
}

body.dark-mode .view-toggle-btn:hover:not(.active) {
    background: #1a2540;
}

body.dark-mode .pill-acct {
    background: #1f2535;
    border-color: #28304a;
    color: #8899b8;
}

body.dark-mode .pill-acct.all-active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gme-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .login-box {
        width: 90vw;
        padding: 32px 24px;
    }

    .main {
        padding: 16px;
    }

    .tab-bar {
        padding: 0;
    }

    .tab-btn-group {
        display: none;
    }

    .tab-dropdown {
        display: block;
    }

    /* Tables scroll horizontally instead of overflowing */
    table.data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .queue-row {
        flex-wrap: wrap;
        gap: var(--sp-2);
    }

    .topbar-user {
        display: none;
    }

    .topbar-user-info {
        display: none;
    }
}

@media (max-width: 600px) {

    .sec-hdr {
        align-items: flex-start;
    }

    .sec-hdr>div:last-child {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .sec-hdr>div:last-child .btn {
        flex: 1 1 140px;
        justify-content: center;
    }

    .card,
    .res-card,
    .ay-card,
    .ay-card-total,
    .gme-card {
        box-shadow: none;
    }

    .card-hdr {
        padding: 12px 14px;
        align-items: flex-start;
    }

    .card-hdr .sub {
        width: 100%;
    }

    .profile-layout {
        gap: 12px;
    }

    [style*="grid-template-columns:280px 1fr 400px"],
    [style*="grid-template-columns:300px 1fr"],
    [style*="grid-template-columns:260px 1fr"],
    [style*="grid-template-columns:320px 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:minmax(180px,.8fr)"] {
        display: flex !important;
        flex-direction: column;
    }

    /* Form fund preview: stack 3-col to single col */
    [style*="grid-template-columns:repeat(3"] {
        display: flex !important;
        flex-direction: column;
    }

    .ay-cards {
        grid-template-columns: 1fr;
    }

    .ay-card,
    .ay-card-total,
    .res-card {
        padding: 12px 14px;
    }

    .mobile-profile-note {
        display: block;
        margin: 0 0 12px;
        padding: 10px 12px;
        border: 1px solid #dbeafe;
        background: #f8fbff;
        border-radius: 10px;
        color: #1e3a8a;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
    }

    .mobile-chart-summary {
        display: block;
    }

    .mobile-chart-graphics {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

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

    .main {
        padding: 12px;
    }

    .login-box {
        padding: 28px 20px;
    }

    .topbar-inner {
        padding: 0 16px;
        gap: 6px;
    }

    .topbar-org {
        font-size: 12px;
    }

    .topbar-portal {
        display: none;
    }

    .btn {
        min-height: 44px;
        padding: 10px var(--sp-5);
    }

    .btn-sm {
        min-height: 36px;
    }

    .inp,
    select.inp,
    textarea.inp,
    input[type="date"],
    input[type="number"] {
        min-height: 44px;
        font-size: var(--text-lg) !important;
    }

    /* Collapse step labels on tiny phones — show circles only */
    .step-label.other {
        display: none;
    }

    .step-row {
        justify-content: center;
    }

    /* AY cards: single column on small phones */
    .ay-cards {
        grid-template-columns: 1fr;
    }

    /* Submit review: stack metrics vertically */
    .confirm-submit-metrics {
        grid-template-columns: 1fr;
    }
}

.admin-stats-grid,
.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.exception-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(320px, 400px);
    gap: 20px;
}

.corrections-filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.corrections-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(320px, 400px);
    gap: 20px;
}

.residency-filters,
.analytics-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}

.residency-filters {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.residency-panel-grid {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 16px;
}

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

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

.txn-date {
    color: var(--gray-500);
    font-family: var(--mono);
    font-size: 11px;
    white-space: nowrap;
}

.txn-desc {
    color: var(--gray-700);
    max-width: 320px;
}

.txn-amount {
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 1100px) {

    .exception-layout,
    .corrections-layout,
    .residency-panel-grid,
    .residency-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .admin-stats-grid,
    .analytics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {

    .residency-filters,
    .analytics-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .residency-source-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {

    .admin-stats-grid,
    .analytics-kpi-grid,
    .residency-filters,
    .analytics-filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   PERSONAL PORTAL LAUNCHER
   ═══════════════════════════════════════════════════════════ */

/* Hide the tab-bar while launcher/home is active */
#tab-bar.launcher-active {
    visibility: hidden;
    pointer-events: none;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.launcher-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 0 32px;
}

.launcher-greeting {
    text-align: center;
    padding: 8px 0 4px;
}

.launcher-name {
    font-size: 22px;
    font-weight: 800;
    color: #0f2942;
    letter-spacing: -0.02em;
}

.launcher-sub {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 3px;
}

.launcher-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.launcher-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: transform 0.12s, box-shadow 0.12s;
    min-height: 76px;
    font-family: inherit;
}

.launcher-btn:active {
    transform: scale(0.98);
}

.launcher-btn-primary {
    background: #0f2942;
    color: #fff;
    box-shadow: 0 4px 16px rgba(15, 41, 66, 0.22), 0 1px 3px rgba(15, 41, 66, 0.12);
}

.launcher-btn-primary:hover {
    background: #1a3a5c;
    box-shadow: 0 6px 20px rgba(15, 41, 66, 0.28);
}

.launcher-btn-secondary {
    background: #fff;
    color: #0f2942;
    border: 1.5px solid #dbe4ee !important;
    box-shadow: 0 2px 8px rgba(15, 41, 66, 0.07);
}

.launcher-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8 !important;
    box-shadow: 0 4px 12px rgba(15, 41, 66, 0.1);
}

.launcher-btn-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
    opacity: 0.9;
}

.launcher-btn-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.launcher-btn-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.launcher-btn-hint {
    font-size: 12px;
    opacity: 0.7;
    font-weight: 400;
    line-height: 1.3;
}

.launcher-draft-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #38bdf8;
    color: #0c2233;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.launcher-action-badge {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border: 1px solid #fde68a;
}

.launcher-notif-hint {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    padding: 6px 0;
}

@media (max-width: 768px) {
    .launcher-wrap {
        gap: 20px;
        padding: 8px 0 24px;
    }

    .launcher-btn {
        padding: 16px 18px;
        min-height: 70px;
    }

    .launcher-btn-title {
        font-size: 16px;
    }
}

@media (max-width: 600px) {
    .launcher-name {
        font-size: 20px;
    }

    .launcher-btn {
        padding: 14px 16px;
        gap: 14px;
    }
}

@media (max-width: 480px) {
    .launcher-btn {
        padding: 14px 14px;
        min-height: 64px;
        gap: 12px;
    }

    .launcher-btn-icon {
        font-size: 22px;
        width: 30px;
    }

    .launcher-btn-title {
        font-size: 15px;
    }

    .launcher-btn-hint {
        font-size: 11px;
    }

    .launcher-draft-badge,
    .launcher-action-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════ */

@media print {

    .topbar,
    .topbar-nav,
    #login-page,
    #confirm-modal-overlay,
    #session-warn-banner,
    #_toast,
    #notif-panel,
    #global-search-wrap,
    #ay-switcher-wrap,
    #dark-mode-btn,
    .topbar-signout,
    .btn,
    .btn-sm,
    .btn-xs,
    .pill-btn,
    .sec-hdr input,
    .sec-hdr select,
    .ay-card-total {
        display: none !important;
    }

    @page {
        margin: 1.5cm;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
        line-height: 1.4;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sec-hdr h2 {
        font-size: 14pt;
        font-weight: 700;
        color: #111827;
        margin-bottom: 8pt;
    }

    .sec-hdr p {
        font-size: 9pt;
        color: #4b5563;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 6px !important;
        break-inside: avoid;
        margin-bottom: 12pt;
    }

    .card-hdr .title {
        font-size: 11pt;
    }

    .card-hdr .sub {
        font-size: 8pt;
    }

    .main {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .profile-layout {
        grid-template-columns: 220px 1fr;
        gap: 12pt;
    }

    .data-table {
        font-size: 8pt;
        min-width: unset;
    }

    .data-table th {
        font-size: 7pt;
        padding: 5pt 8pt;
        background: #f9fafb !important;
    }

    .data-table td {
        padding: 5pt 8pt;
    }

    .data-table tfoot td {
        padding: 5pt 8pt;
    }

    .tfoot-dark {
        background: #111827 !important;
    }

    .tfoot-dark td {
        color: #fff !important;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8pt;
        margin-bottom: 12pt;
    }

    .stat-card {
        padding: 8pt 10pt;
        border-radius: 4px !important;
    }

    .stat-card .lbl {
        font-size: 7pt;
    }

    .stat-card .val {
        font-size: 14pt;
    }

    .ay-cards {
        grid-template-columns: repeat(auto-fit, minmax(100pt, 1fr));
        gap: 6pt;
    }

    .ay-card {
        padding: 8pt 10pt;
        border-radius: 4px !important;
    }

    .ay-card .ay-val {
        font-size: 13pt;
    }

    .badge {
        border: 1px solid #e5e7eb;
        font-size: 7pt;
    }

    a {
        color: #111827;
        text-decoration: none;
    }

    .prog-track {
        border: 1px solid #e5e7eb;
    }

    body.dark-mode,
    body.dark-mode .card,
    body.dark-mode .stat-card,
    body.dark-mode .res-card,
    body.dark-mode .gme-card {
        background: #fff !important;
        color: #000 !important;
        border-color: #e5e7eb !important;
    }
}