/* ============================================================
   BALBHARATI SAMIKSHA THEME
   Inspired by the Antargyan HRMS UI system.
   Mint surface, teal accent, soft shadows, pill controls.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@300;400;500;600;700;800&family=Hind:wght@300;400;500;600;700&family=Cairo:wght@300;400;500;600;700&display=swap');

:root {
    /* Surface — soft mint paper */
    --bg-1: #f3faf8; --bg-2: #e8f4f0; --bg-3: #d4ede5;
    --surface: #ffffff; --surface-dim: #f1f7f5; --surface-hover: #e2efea;

    /* Text */
    --text: #1a1a1a; --text-secondary: #5a5a5a; --text-muted: #94978f; --text-on-dark: #ffffff;

    /* Borders */
    --border: rgba(0,0,0,0.06); --border-strong: rgba(0,0,0,0.1);

    /* Primary — institutional dark */
    --primary: #1a1a1a; --primary-soft: #eaf2ef; --primary-text: #ffffff;

    /* Accent — teal */
    --accent: #0d9488; --accent-soft: #ccfbf1; --accent-text: #ffffff;

    /* Semantic */
    --success: #5cb874; --success-soft: #e2f5e7;
    --danger: #e57373; --danger-soft: #fde8e8;
    --warning: #d4a017; --warning-soft: #fff4c2;
    --info: #4a90c2; --info-soft: #e8f1f9;
    --purple: #7c4dbd; --purple-soft: #f0e7f9;

    --shadow-card: 0 4px 20px rgba(15, 60, 55, 0.06);
    --shadow-lg: 0 8px 24px rgba(15, 60, 55, 0.09);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);

    --radius: 14px; --radius-lg: 20px; --radius-pill: 999px;
    --topbar-h: 76px; --sidebar-w: 260px;

    --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
    --bg-1: #0d1614; --bg-2: #111c1a; --bg-3: #16221f;
    --surface: #1c2723; --surface-dim: #131e1b; --surface-hover: #243530;
    --text: #e6efeb; --text-secondary: #9aa39e; --text-muted: #6e7773;
    --border: rgba(255,255,255,0.06); --border-strong: rgba(255,255,255,0.1);
    --primary: #e6efeb; --primary-soft: #243530; --primary-text: #0d1614;
    --accent: #14b8a6; --accent-soft: #134e4a; --accent-text: #0d1614;
    --success: #7dd396; --success-soft: #1f3525;
    --danger: #ef8a8a; --danger-soft: #3a1f1f;
    --warning: #e7c25c; --warning-soft: #3a3320;
    --info: #7fb3d9; --info-soft: #1a2a3a;
    --purple: #b09cd0; --purple-soft: #2a1f3a;
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font-body);
    font-size: 14px; line-height: 1.5;
    color: var(--text);
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, select, textarea { font-family: inherit; }

h1,h2,h3,h4,h5 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 32px; line-height: 1.1; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

/* === TOPBAR === */
.topbar {
    position: fixed; top: 0; inset-inline-start: 0; inset-inline-end: 0;
    height: var(--topbar-h); display: flex; align-items: center;
    padding: 0 28px; gap: 16px; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer; }
.brand-logo {
    width: 38px; height: 38px; border-radius: 12px;
    background: var(--primary); display: flex; align-items: center; justify-content: center;
    color: var(--accent); font-weight: 800; font-size: 20px;
    position: relative; transform: rotate(-3deg);
}
.brand-logo::after {
    content: ""; position: absolute; width: 14px; height: 14px;
    background: var(--accent); border-radius: 50%;
    top: -4px; inset-inline-end: -4px; border: 3px solid var(--bg-2);
}
.brand-name { font-weight: 800; font-size: 18px; color: var(--text); letter-spacing: -0.03em; }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: -2px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }

.topnav-wrap { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topnav {
    display: flex; align-items: center;
    background: var(--surface); border-radius: var(--radius-pill);
    padding: 5px; box-shadow: var(--shadow-card);
    gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav-item {
    display: flex; align-items: center; gap: 7px;
    padding: 9px 18px; border-radius: var(--radius-pill);
    font-size: 13.5px; font-weight: 500;
    color: var(--text-secondary); white-space: nowrap;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    background: none; cursor: pointer;
}
.topnav-item:hover { color: var(--text); background: var(--surface-hover); }
.topnav-item.active { color: var(--primary-text); background: var(--primary); font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.action-pill {
    display: flex; align-items: center; gap: 7px;
    padding: 10px 18px; background: var(--surface);
    border-radius: var(--radius-pill); box-shadow: var(--shadow-card);
    font-size: 13.5px; font-weight: 500; color: var(--text);
    transition: all 0.18s ease;
}
.action-pill:hover { background: var(--surface-hover); transform: translateY(-1px); }
.icon-circle {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface); box-shadow: var(--shadow-card);
    display: flex; align-items: center; justify-content: center;
    color: var(--text); transition: all 0.18s ease;
    position: relative; flex-shrink: 0;
}
.icon-circle:hover { background: var(--surface-hover); transform: translateY(-1px); }
.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--accent); color: var(--accent-text);
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; box-shadow: var(--shadow-card);
    cursor: pointer; flex-shrink: 0;
}
.user-pill {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 5px 5px 14px; background: var(--surface);
    border-radius: var(--radius-pill); box-shadow: var(--shadow-card);
    cursor: pointer; transition: all 0.18s ease;
}
.user-pill:hover { background: var(--surface-hover); }
.user-pill-info { display: flex; flex-direction: column; line-height: 1.2; max-width: 160px; }
.user-pill-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill-role { font-size: 11px; color: var(--text-muted); }
.user-pill-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* === LAYOUT === */
.app {
    display: flex; padding-top: var(--topbar-h); height: 100vh;
    gap: 20px; padding-inline: 24px; padding-bottom: 24px;
}
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); padding: 22px 14px;
    overflow-y: auto;
}
.sidebar.hidden { display: none; }
.sidebar-header { padding: 0 12px 18px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.sidebar-eyebrow {
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-muted); font-weight: 600; margin-bottom: 4px;
}
.sidebar-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.1; }
.submenu-section { margin-bottom: 18px; }
.submenu-section:last-child { margin-bottom: 0; }
.submenu-section-title {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); padding: 4px 12px 8px; font-weight: 600;
}
.submenu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius-pill);
    font-size: 13.5px; color: var(--text-secondary);
    transition: all 0.15s ease; cursor: pointer;
    font-weight: 500; margin-bottom: 2px;
}
.submenu-item:hover { background: var(--surface-hover); color: var(--text); }
.submenu-item.active { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.submenu-item-label { flex: 1; }

.main { flex: 1; overflow-y: auto; padding-inline-end: 4px; }
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 24px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-title { font-size: 36px; font-weight: 700; color: var(--text); letter-spacing: -0.035em; line-height: 1; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }

/* === CARDS === */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 22px; margin-bottom: 18px; }
.card-dark { background: var(--primary); color: var(--text-on-dark); }
[data-theme="dark"] .card-dark { background: #0d0d0d; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.card-title { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.card-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.card-empty { color: var(--text-secondary); font-size: 13.5px; }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; border: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:not(:disabled):hover { background: #2a2a2a; transform: translateY(-1px); }
[data-theme="dark"] .btn-primary:not(:disabled):hover { background: #fff; }
.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:not(:disabled):hover { background: #0b7d72; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:not(:disabled):hover { background: #d65d5d; transform: translateY(-1px); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }

/* === FORMS === */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.field .req { color: var(--danger); margin-inline-start: 2px; }
.field input, .field select, .field textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text); font-size: 14px;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 12px; color: var(--text-muted); }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.field-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }

.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; margin: 12px 0; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* === BADGES === */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: var(--radius-pill);
    font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.gray { background: var(--surface-dim); color: var(--text-muted); }
.badge.yellow { background: var(--warning-soft); color: var(--warning); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

/* Statuses → badge colors */
.badge-status-PENDING,
.badge-status-DOCUMENTS_UPLOADED,
.badge-status-KYC_IN_PROGRESS { background: var(--warning-soft); color: var(--warning); }
.badge-status-PENDING::before,
.badge-status-DOCUMENTS_UPLOADED::before,
.badge-status-KYC_IN_PROGRESS::before { background: currentColor; }
.badge-status-ACTIVE,
.badge-status-KYC_APPROVED { background: var(--success-soft); color: var(--success); }
.badge-status-KYC_REJECTED,
.badge-status-SUSPENDED,
.badge-status-DEACTIVATED { background: var(--danger-soft); color: var(--danger); }

/* === TABLES === */
.table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; margin-top: 12px; }
.search-pill { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 9px 16px; background: var(--surface); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); }
.search-pill svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.search-pill input { flex: 1; border: none; background: none; outline: none; color: var(--text); font-size: 13.5px; width: 100%; padding: 0; }
.search-pill input::placeholder { color: var(--text-muted); }
.filter-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px; background: var(--surface);
    border-radius: var(--radius-pill); border: 1px solid var(--border);
    font-size: 13px; font-weight: 500; box-shadow: var(--shadow-card);
    cursor: pointer; transition: all 0.15s ease; color: var(--text);
}
.filter-pill:hover { background: var(--surface-hover); }
.filter-pill select { background: none; border: none; color: inherit; font-size: 13px; font-weight: 500; outline: none; cursor: pointer; }

.data-table-wrap { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: start; padding: 14px 18px;
    font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
    border-bottom: 1px dashed var(--border-strong); white-space: nowrap;
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--surface-dim); }

/* === STAT GRID === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.stat-card {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card); padding: 20px;
}
.stat-card.dark { background: var(--primary); color: var(--text-on-dark); }
.stat-label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-secondary); font-weight: 600;
}
.stat-card.dark .stat-label { color: rgba(255,255,255,0.7); }
.stat-value {
    font-size: 36px; font-weight: 700; letter-spacing: -0.035em;
    line-height: 1.1; margin-top: 6px;
}
.stat-trend { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card.dark .stat-trend { color: rgba(255,255,255,0.6); }

/* === AUTH PAGES (login, register) === */
.auth-bg {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%);
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px;
    width: 100%;
    max-width: 480px;
}
.auth-card.wide { max-width: 720px; }
.auth-card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; position: relative; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo {
    width: 56px; height: 56px;
    background: var(--primary); color: var(--accent);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 26px;
    margin-bottom: 14px;
    position: relative; transform: rotate(-3deg);
}
.auth-logo::after {
    content: ""; position: absolute; width: 16px; height: 16px;
    background: var(--accent); border-radius: 50%;
    top: -4px; right: -4px; border: 3px solid var(--surface);
}
.auth-header h1 { font-size: 26px; margin-bottom: 4px; }
.auth-header p { font-size: 13.5px; color: var(--text-secondary); }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-secondary); }
.auth-foot a { color: var(--accent); font-weight: 600; }

/* === MISC === */
.banner {
    background: var(--primary); color: var(--text-on-dark);
    border-radius: var(--radius-lg); padding: 22px 28px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 22px; gap: 20px;
}
[data-theme="dark"] .banner { background: #0d0d0d; }
.banner h2 { color: var(--text-on-dark); margin-bottom: 4px; }
.banner-sub { color: rgba(255,255,255,0.7); font-size: 13.5px; }
.banner-tag {
    display: inline-block; margin-top: 8px;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 12px; color: var(--accent);
    background: rgba(13,148,136,0.18);
    padding: 3px 12px; border-radius: var(--radius-pill);
}

.empty-state {
    text-align: center; padding: 40px 20px;
    color: var(--text-secondary);
}
.empty-state .ico { font-size: 32px; margin-bottom: 8px; }

/* === KYC document slots === */
.kyc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}
.kyc-slot {
    background: var(--surface-dim);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
    transition: border-color 0.15s, background 0.15s;
}
.kyc-slot.uploaded { border-style: solid; background: var(--surface); }
.kyc-slot.verified { border-color: var(--success); background: var(--success-soft); }
.kyc-slot.rejected { border-color: var(--danger); background: var(--danger-soft); }
.kyc-slot.uploading { border-color: var(--accent); }
.kyc-slot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kyc-slot-title { font-weight: 600; font-size: 14px; color: var(--text); }
.kyc-slot-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.kyc-slot-file {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border-radius: var(--radius); padding: 8px 12px;
    font-size: 13px;
}
.kyc-slot-file-icon { font-size: 18px; }
.kyc-slot-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kyc-slot-file-size { color: var(--text-muted); font-size: 11.5px; }
.kyc-slot-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.kyc-slot-reason { font-size: 12px; color: var(--danger); background: rgba(229,115,115,0.08); padding: 6px 10px; border-radius: var(--radius); }

.file-input { display: none; }
.file-button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-pill);
    background: var(--accent); color: var(--accent-text);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.file-button.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.file-button.danger { background: var(--danger); color: white; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal {
    background: var(--surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); width: 100%; max-width: 480px;
    padding: 24px;
}
.modal h3 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* Splash */
.bb-splash {
    position: fixed; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 40%, var(--bg-3) 100%);
    gap: 14px;
}
.bb-splash-logo {
    width: 64px; height: 64px; border-radius: 14px;
    background: var(--primary); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 30px;
    position: relative; transform: rotate(-3deg);
}
.bb-splash-logo::after {
    content: ""; position: absolute; width: 16px; height: 16px;
    background: var(--accent); border-radius: 50%;
    top: -4px; right: -4px; border: 3px solid var(--bg-2);
}
.bb-splash-text { font-size: 20px; font-weight: 700; color: var(--text); }
.bb-splash-sub { font-size: 13px; color: var(--text-secondary); }

/* === LANGUAGE / DROPDOWN MENUS === */
.menu-wrap { position: relative; }
.menu-pop {
    position: absolute; top: calc(100% + 8px); inset-inline-end: 0;
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all 0.18s ease; z-index: 200;
}
.menu-pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-option {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: var(--radius-pill);
    font-size: 13.5px; width: 100%; transition: background 0.15s ease;
    color: var(--text); background: none; cursor: pointer;
}
.menu-option:hover { background: var(--surface-hover); }
.menu-option.active { background: var(--primary); color: var(--primary-text); font-weight: 500; }
.menu-option .check { opacity: 0; }
.menu-option.active .check { opacity: 1; }

/* === MOBILE NAV TOGGLE === */
.menu-toggle {
    display: none;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--surface); box-shadow: var(--shadow-card);
    align-items: center; justify-content: center;
    color: var(--text);
    flex-shrink: 0;
    font-size: 20px;
}

/* Backdrop for mobile drawers */
.backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 90; opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease;
}
.backdrop.open { opacity: 1; visibility: visible; }

/* === RESPONSIVE === */
@media (max-width: 1100px) {
    .topnav-item-label { display: none; }
}
@media (max-width: 980px) {
    .user-pill-info { display: none; }
    .user-pill { padding: 5px; }
}

@media (max-width: 860px) {
    :root { --topbar-h: 64px; }
    .topbar { padding: 0 14px; gap: 10px; }
    .menu-toggle { display: inline-flex; }
    .brand-sub { display: none; }
    .brand-name { font-size: 16px; }

    /* Topnav becomes a slide-down drawer */
    .topnav-wrap {
        position: fixed; top: var(--topbar-h); inset-inline-start: 14px; inset-inline-end: 14px;
        z-index: 95; display: none;
    }
    .topnav-wrap.open { display: flex; }
    .topnav {
        flex-direction: column; align-items: stretch;
        width: 100%; max-width: 100%;
        padding: 10px; border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg); gap: 2px;
    }
    .topnav-item { justify-content: flex-start; padding: 12px 16px; font-size: 14px; }
    .topnav-item-label { display: inline; }

    /* Sidebar becomes off-canvas */
    .app { padding-inline: 14px; padding-bottom: 14px; gap: 14px; flex-direction: column; }
    .sidebar {
        position: fixed; inset-inline-start: 14px; inset-inline-end: 14px;
        top: calc(var(--topbar-h) + 8px); z-index: 95;
        width: auto; max-height: calc(100vh - var(--topbar-h) - 16px);
        display: none;
    }
    .sidebar.mobile-open { display: block; }

    .topbar-actions { gap: 6px; }
    .action-pill { padding: 8px 12px; font-size: 12.5px; }
    .icon-circle { width: 38px; height: 38px; }
    .user-pill-avatar, .user-avatar { width: 36px; height: 36px; }
}

@media (max-width: 560px) {
    .page-header { gap: 12px; }
    .page-title { font-size: 24px; }
    .auth-card { padding: 24px 20px; }
    .auth-card.wide { padding: 24px 20px; }
    .field-grid { grid-template-columns: 1fr; gap: 10px; }
    .card { padding: 18px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 30px; }
    .data-table th, .data-table td { padding: 10px 12px; font-size: 12.5px; }
    .data-table th { font-size: 10.5px; }
    .banner { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
    .table-toolbar { gap: 8px; }
    .filter-pill { padding: 7px 12px; }
    .search-pill { padding: 7px 14px; }
    .btn { padding: 8px 16px; font-size: 13px; }
    .btn-sm { padding: 6px 12px; font-size: 12px; }
    .menu-pop { inset-inline-end: 50%; transform: translate(50%, -6px); }
    .menu-pop.open { transform: translate(50%, 0); }
}
