@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary:       #0077b6;
    --primary-dark:  #023e8a;
    --primary-light: #00b4d8;
    --accent:        #90e0ef;
    --success:       #10b981;
    --warning:       #f59e0b;
    --danger:        #ef4444;
    --bg:            #f1f5f9;
    --card:          #ffffff;
    --text:          #0f172a;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --sidebar-w:     260px;
    --radius:        14px;
    --shadow:        0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.07);
    --shadow-md:     0 4px 12px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ════════════════════════════════════
   SIDEBAR
════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, #01579b 100%);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    text-decoration: none;
}
.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.15);
    border-radius: 10px;
    display: grid; place-items: center;
    font-size: 20px;
}
.sidebar-logo span {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
}
.sidebar-logo small {
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,.5);
    font-weight: 400;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.sidebar-section {
    padding: 16px 12px 4px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 8px;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .2s;
}
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.18); color: #fff; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
}


.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,.1);
    border-radius: 10px;
}
.user-avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    flex-shrink: 0;
}
.user-pill-info { flex: 1; min-width: 0; }
.user-pill-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill-role { font-size: 10px; color: rgba(255,255,255,.5); text-transform: uppercase; letter-spacing: .5px; }
.user-pill a { color: rgba(255,255,255,.5); font-size: 16px; text-decoration: none; transition: color .2s; }
.user-pill a:hover { color: var(--danger); }

/* ════════════════════════════════════
   MAIN LAYOUT
════════════════════════════════════ */
.main {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

/* ── Sidebar collapsed state ── */
body.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
body.sidebar-collapsed .main   { margin-left: 0; }


.page-header {
    padding: 28px 32px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.4px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.content { padding: 24px 32px 40px; }

/* ════════════════════════════════════
   CARDS
════════════════════════════════════ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body { padding: 20px; }

/* ════════════════════════════════════
   STAT CARDS
════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: grid; place-items: center;
    font-size: 22px;
    flex-shrink: 0;
}
.si-blue   { background: #dbeafe; }
.si-teal   { background: #ccfbf1; }
.si-green  { background: #dcfce7; }
.si-orange { background: #ffedd5; }
.si-purple { background: #f3e8ff; }
.si-red    { background: #fee2e2; }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ════════════════════════════════════
   BUTTONS
════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, #0077b6, #023e8a); color: #fff; box-shadow: 0 2px 8px rgba(0,119,182,.3); }
.btn-primary:hover { background: linear-gradient(135deg, #023e8a, #012a6b); box-shadow: 0 4px 12px rgba(0,119,182,.4); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-warning:hover { filter: brightness(.95); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { filter: brightness(1.1); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ════════════════════════════════════
   BADGES
════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-green   { background: #dcfce7; color: #166534; }
.badge-teal    { background: #ccfbf1; color: #134e4a; }
.badge-orange  { background: #ffedd5; color: #9a3412; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-purple  { background: #f3e8ff; color: #6b21a8; }
.badge-grey    { background: #f1f5f9; color: #475569; }
.badge-dot::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ════════════════════════════════════
   FORMS
════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--card);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,119,182,.12); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ════════════════════════════════════
   TABLES
════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-align: left;
}
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ════════════════════════════════════
   ALERTS
════════════════════════════════════ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ════════════════════════════════════
   MODALS
════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .2s ease;
}
.modal-lg { max-width: 720px; }
@keyframes modalIn { from { opacity:0; transform: scale(.96) translateY(8px); } to { opacity:1; transform: none; } }
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: 4px; border-radius: 6px; line-height: 1; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ════════════════════════════════════
   TABS
════════════════════════════════════ */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    width: fit-content;
}
.tab-btn {
    padding: 8px 18px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .2s;
}
.tab-btn.active { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: var(--shadow); }

/* ════════════════════════════════════
   AUTH PAGES
════════════════════════════════════ */
.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.auth-panel {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.auth-panel::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-panel-content { position: relative; z-index: 1; }
.auth-panel-logo { font-size: 40px; margin-bottom: 16px; }
.auth-panel-title { font-size: 32px; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 12px; }
.auth-panel-sub { font-size: 15px; color: rgba(255,255,255,.7); line-height: 1.6; margin-bottom: 32px; }
.auth-feature { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 12px; }
.auth-feature::before { content: '✓'; background: rgba(255,255,255,.2); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.auth-bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    animation: rise 10s infinite ease-in;
}
@keyframes rise {
    0% { transform: translateY(100%) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: .3; }
    100% { transform: translateY(-200%) scale(1.5); opacity: 0; }
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--bg);
}
.auth-form-box {
    width: 100%;
    max-width: 420px;
}
.auth-form-title { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.auth-form-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
.auth-divider { text-align: center; color: var(--text-muted); font-size: 12px; margin: 20px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-link { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-form-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 24px; }
.auth-input-wrap { position: relative; }
.auth-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }
.auth-input-wrap .form-control { padding-left: 38px; }
.btn-auth {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all .2s;
    margin-top: 8px;
}
.btn-auth:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,119,182,.35); }

/* ════════════════════════════════════
   MISC UTILITIES
════════════════════════════════════ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.grid { display: grid; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.fw-600 { font-weight: 600; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ════════════════════════════════════
   SECTION HEADERS
════════════════════════════════════ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* ════════════════════════════════════
   EMPTY STATE
════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ════════════════════════════════════
   RANGE BAR
════════════════════════════════════ */
.range-bar { background: var(--border); border-radius: 99px; height: 6px; overflow: hidden; margin-top: 6px; }
.range-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.fill-ok     { background: linear-gradient(90deg, var(--success), #34d399); }
.fill-warn   { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.fill-danger { background: linear-gradient(90deg, var(--danger), #f87171); }

/* ════════════════════════════════════
   PAGE BANNER (gradient strip header)
════════════════════════════════════ */
.page-banner {
    background: linear-gradient(135deg, #023e8a 0%, #0369a1 45%, #0891b2 75%, #22d3ee 100%);
    padding: 28px 32px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(2,62,138,.28);
}
.page-banner-bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.banner-bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    animation: bannerFloat 10s infinite ease-in-out;
}
@keyframes bannerFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
.page-banner-content {
    position: relative; z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-banner-title { font-size: 26px; font-weight: 700; color: #fff; }
.page-banner-sub { font-size: 13px; color: rgba(255,255,255,.7); margin-top: 4px; }

/* ════════════════════════════════════
   SIDEBAR BACKDROP (mobile overlay)
════════════════════════════════════ */
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(2px);
    z-index: 199;
}
.sidebar-backdrop.visible { display: block; }

/* ════════════════════════════════════
   MOBILE HEADER (mobile only)
════════════════════════════════════ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #0277bd 100%);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    box-sizing: border-box;
}
.mh-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.mh-logo-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.18);
    border-radius: 8px;
    display: grid; place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}
.mh-logo-text {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.3px;
}
.mh-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mh-avatar {
    width: 32px; height: 32px;
    background: rgba(255,255,255,.22);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.mh-exit-btn {
    background: rgba(239,68,68,.18);
    color: #fca5a5;
    border: 1.5px solid rgba(239,68,68,.35);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s;
}
.mh-exit-btn:active { background: rgba(239,68,68,.36); }

/* ════════════════════════════════════
   BOTTOM NAV (mobile only)
════════════════════════════════════ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 150;
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}
.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 2px 7px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    flex: 1;
    transition: color .15s;
    letter-spacing: .2px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.bn-item .bn-icon { font-size: 20px; line-height: 1; display: block; }
.bn-item.active { color: var(--primary); }
.bn-item.active .bn-icon { transform: scale(1.1); }
.bn-item.active::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}
.bn-item:active { opacity: .65; }

/* ════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900px)
════════════════════════════════════ */
@media (max-width: 900px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-panel   { display: none; }
    .two-col      { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
════════════════════════════════════ */
@media (max-width: 768px) {
    /* Show mobile header + bottom nav, hide sidebar completely */
    .mobile-header { display: flex; }
    .bottom-nav    { display: block; }
    .sidebar       { display: none !important; }

    /* Main always full width with room for top header + bottom nav */
    .main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 56px;
        padding-bottom: 72px;
    }

    /* Content spacing */
    .content      { padding: 14px 12px 28px; }
    .page-banner  { padding: 18px 16px; }
    .page-banner-title { font-size: 20px; }
    .page-banner-sub   { font-size: 12px; }
    .page-banner-content { flex-direction: column; gap: 10px; align-items: flex-start; }

    /* Cards */
    .card-header { padding: 13px 14px; }
    .card-body   { padding: 14px; }

    /* Stat cards */
    .stats-grid  { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card   { padding: 14px; gap: 12px; }
    .stat-icon   { width: 40px; height: 40px; font-size: 18px; }
    .stat-value  { font-size: 20px; }
    .stat-label  { font-size: 11px; }

    /* Tables */
    .table-wrap { -webkit-overflow-scrolling: touch; }
    th, td { padding: 10px 12px; font-size: 12px; }

    /* Buttons */
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-sm { padding: 6px 10px; font-size: 11px; }

    /* Modals — bottom sheet */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal { border-radius: 20px 20px 0 0; max-width: 100% !important; }
    .modal-lg { max-width: 100% !important; }
    .modal-body   { padding: 18px 16px; }
    .modal-footer { padding: 12px 16px; }

    /* Auth */
    .auth-form-side { padding: 32px 20px; }
    .auth-form-title { font-size: 22px; }

    /* Forms */
    .form-control { font-size: 16px; } /* prevent iOS zoom */
}

/* ════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
════════════════════════════════════ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .content    { padding: 12px 10px 28px; }
    .page-banner-title { font-size: 17px; }
    .page-banner { padding: 16px 14px; }
    .card-header { padding: 12px 12px; }
    .card-body   { padding: 12px; }
    .stat-value  { font-size: 18px; }
}
