@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --c-bg: #f0f2f5;
    --c-card: #ffffff;
    --c-text: #1a1d21;
    --c-text-secondary: #6b7280;
    --c-border: #e5e7eb;
    --c-primary: #6366f1;
    --c-primary-hover: #4f46e5;
    --c-primary-light: rgba(99,102,241,0.1);
    --c-accent: #f59e0b;
    --c-accent-light: rgba(245,158,11,0.1);
    --c-success: #10b981;
    --c-success-light: rgba(16,185,129,0.1);
    --c-danger: #ef4444;
    --c-danger-light: rgba(239,68,68,0.1);
    --c-warning: #f59e0b;
    --c-info: #3b82f6;
    --c-sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%);
    --sidebar-w: 260px;
    --topbar-h: 0px;
    --bottomnav-h: 74px;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4c4c4; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ===== SIDEBAR (Desktop) ===== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--c-sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-brand h2 i { color: var(--c-accent); margin-right: 6px; }

.sidebar-brand small {
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
}

.sidebar-user {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user .avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user .info { color: #fff; }
.sidebar-user .info .name { font-weight: 600; font-size: 0.9rem; }
.sidebar-user .info .role-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 3px;
    text-transform: capitalize;
}

.sidebar-menu { flex: 1; padding: 1rem 0.75rem; }
.sidebar-menu .menu-label {
    color: rgba(255,255,255,0.35);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.75rem 0.75rem 0.4rem;
    font-weight: 700;
    margin-top: 1rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.7rem 0.85rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    position: relative;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateX(4px);
}

.sidebar-menu a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-weight: 600;
}

.sidebar-menu a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--c-accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-logout {
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logout a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 0.85rem;
    color: #fca5a5;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-logout a:hover {
    background: rgba(239,68,68,0.2);
    color: #fecaca;
}

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 2rem 2.5rem;
    min-height: 100vh;
    transition: var(--transition);
}

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    min-height: var(--bottomnav-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.06);
    z-index: 320;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav a,
.bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.35rem 0.25rem;
    border-radius: 8px;
    transition: var(--transition);
    min-width: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.bottom-nav a span,
.bottom-nav button span {
    width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav a i,
.bottom-nav button i {
    font-size: 1.12rem;
    line-height: 1;
}

.bottom-nav a.active,
.bottom-nav button.active {
    color: var(--c-primary);
    background: var(--c-primary-light);
}

.bottom-nav a.active i,
.bottom-nav button.active i {
    transform: translateY(-2px);
}

.mobile-menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.38);
    z-index: 280;
}

.mobile-menu-sheet {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
    max-height: calc(100dvh - var(--bottomnav-h) - env(safe-area-inset-bottom) - 1rem);
    background: #fff;
    border: 1px solid var(--c-border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(15,23,42,0.18);
    z-index: 300;
    overflow: hidden;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--c-border);
}

.mobile-menu-header strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.2;
}

.mobile-menu-header span {
    display: block;
    color: var(--c-text-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
}

.mobile-menu-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: #fff;
    color: var(--c-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-menu-list {
    max-height: calc(100dvh - var(--bottomnav-h) - env(safe-area-inset-bottom) - 5.5rem);
    overflow-y: auto;
    padding: 0.75rem;
}

.mobile-menu-label {
    color: var(--c-text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0.8rem 0 0.35rem;
    padding: 0 0.25rem;
    text-transform: uppercase;
}

.mobile-menu-list a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    color: var(--c-text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 650;
}

.mobile-menu-list a i {
    width: 22px;
    color: var(--c-primary);
    text-align: center;
}

.mobile-menu-list a.active {
    background: var(--c-primary-light);
    color: var(--c-primary);
}

.mobile-menu-list a.mobile-menu-logout {
    color: var(--c-danger);
    margin-top: 0.75rem;
    border-top: 1px solid var(--c-border);
    border-radius: 0;
}

.mobile-menu-list a.mobile-menu-logout i { color: var(--c-danger); }

.mobile-menu-backdrop[hidden],
.mobile-menu-sheet[hidden] {
    display: none !important;
}

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--c-primary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--c-text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== CARDS ===== */
.card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--c-border);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--c-border);
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card .stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--c-primary-light); color: var(--c-primary); }
.stat-icon.amber { background: var(--c-accent-light); color: var(--c-accent); }
.stat-icon.green { background: var(--c-success-light); color: var(--c-success); }
.stat-icon.red { background: var(--c-danger-light); color: var(--c-danger); }
.stat-icon.blue { background: rgba(59,130,246,0.1); color: var(--c-info); }

.stat-card .stat-info h4 {
    font-size: 0.78rem;
    color: var(--c-text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.stat-card .stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1.2;
}

/* ===== GRID ===== */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--c-text);
    background: #fff;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-light);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 70px; }

.input-group {
    display: flex;
    gap: 0.5rem;
}

.input-group .form-control { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }

.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--c-warning); color: #fff; }
.btn-warning:hover { background: #d97706; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--c-border);
    color: var(--c-text-secondary);
}
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.78rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

thead th {
    background: #f9fafb;
    padding: 0.8rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--c-border);
    white-space: nowrap;
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

tbody tr { transition: var(--transition); }
tbody tr:hover { background: #f9fafb; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-primary { background: var(--c-primary-light); color: var(--c-primary); }
.badge-success { background: var(--c-success-light); color: #065f46; }
.badge-warning { background: var(--c-accent-light); color: #92400e; }
.badge-danger { background: var(--c-danger-light); color: #991b1b; }
.badge-info { background: rgba(59,130,246,0.1); color: #1d4ed8; }

/* ===== ALERT / FLASH ===== */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success { background: var(--c-success-light); color: #065f46; border-left: 4px solid var(--c-success); }
.alert-danger { background: var(--c-danger-light); color: #991b1b; border-left: 4px solid var(--c-danger); }
.alert-warning { background: var(--c-accent-light); color: #92400e; border-left: 4px solid var(--c-warning); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SECTION DIVIDER ===== */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--c-border);
    color: var(--c-text);
}

.section-title i { color: var(--c-primary); margin-right: 6px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--c-text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p { font-size: 0.9rem; }

/* ===== QUICK ACCESS CARDS ===== */
.quick-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--c-text);
    transition: var(--transition);
    background: #fff;
}

.quick-card:hover {
    border-color: var(--c-primary);
    box-shadow: 0 4px 12px var(--c-primary-light);
    transform: translateY(-2px);
}

.quick-card .qc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.quick-card .qc-text h4 { font-size: 0.9rem; font-weight: 700; }
.quick-card .qc-text p { font-size: 0.78rem; color: var(--c-text-secondary); }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-overlay.show { display: flex; }

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 { font-size: 1.15rem; font-weight: 700; }

.modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #6b7280;
    transition: var(--transition);
}

.modal-close:hover { background: var(--c-danger-light); color: var(--c-danger); }

/* ===== LOGIN PAGE ===== */
.login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4338ca 100%);
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
    top: -100px; right: -100px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
    bottom: -80px; left: -80px;
    border-radius: 50%;
}

.login-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}

.login-box .brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-box .brand h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e1b4b;
    letter-spacing: -1px;
}

.login-box .brand h1 i { color: var(--c-accent); }

.login-box .brand p {
    color: var(--c-text-secondary);
    font-size: 0.88rem;
    margin-top: 4px;
}

/* ===== UTILITY ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--c-text-secondary); }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.highlight-box {
    background: #f8fafc;
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-primary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.patient-item {
    padding: 1rem;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.patient-item:hover {
    border-color: var(--c-primary);
    background: var(--c-primary-light);
}

.patient-item.active-item {
    border-color: var(--c-primary);
    background: var(--c-primary-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .main { padding: 1.5rem; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav { display: grid; }
    .mobile-menu-backdrop { display: block; }
    .mobile-menu-sheet { display: flex; flex-direction: column; }
    body.mobile-menu-open { overflow: hidden; }

    .main {
        margin-left: 0;
        padding: 1.25rem 1rem;
        padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 1.5rem);
    }

    .page-header h1 { font-size: 1.35rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-info .stat-value { font-size: 1.2rem; }
    .stat-card .stat-icon { width: 42px; height: 42px; font-size: 1rem; }

    .card { padding: 1.15rem; border-radius: 12px; }
    .card-header { align-items: flex-start; gap: 0.75rem; flex-wrap: wrap; }
    .card-header .btn,
    .card-header form { width: 100%; }
    .login-box { padding: 2rem 1.5rem; }

    .grid-auto { grid-template-columns: 1fr; }
    .input-group { align-items: stretch; }
    .btn { min-height: 40px; }
    .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .bottom-nav {
        gap: 0.15rem;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
    .bottom-nav a,
    .bottom-nav button {
        font-size: 0.6rem;
        padding-left: 0.15rem;
        padding-right: 0.15rem;
    }
    .bottom-nav a i,
    .bottom-nav button i { font-size: 1.05rem; }
    .mobile-menu-sheet {
        left: 0.35rem;
        right: 0.35rem;
        border-radius: 16px 16px 0 0;
    }
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    backdrop-filter: blur(8px);
    cursor: zoom-out;
}
.lightbox-overlay.show { display: flex; }
.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.lightbox-overlay.show .lightbox-img { transform: scale(1); }
.lightbox-close {
    position: absolute;
    top: 20px; right: 20px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
