/* ============================================================
   Dental Clinic System — Mobile Medical App UI
   Teal/mint + white, rounded cards, soft shadows
   Font: Plus Jakarta Sans — clean, modern medical
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    --teal:          #00b8a0;
    --teal-dark:     #009982;
    --teal-light:    #e6f9f6;
    --teal-mid:      #b3ede6;
    --teal-gradient: linear-gradient(135deg, #00c9a7 0%, #00a887 100%);

    --orange:        #f9a825;
    --orange-light:  #fff8e1;

    --bg:            #f4f7f9;
    --surface:       #ffffff;
    --surface2:      #f8fbfc;

    --navy:          #1a2e44;
    --text:          #1a2e44;
    --text-mid:      #4a6177;
    --text-muted:    #99afc4;
    --text-light:    #c5d5e2;

    --border:        #e8f0f5;
    --border-mid:    #d4e4ef;

    --danger:        #ff5c7a;
    --danger-light:  #fff0f3;
    --success:       #00b8a0;
    --warning:       #f9a825;
    --info:          #3b82f6;
    --info-light:    #eff6ff;

    --shadow-sm:     0 2px 8px rgba(0,184,160,0.08);
    --shadow:        0 4px 20px rgba(0,100,80,0.10);
    --shadow-md:     0 8px 32px rgba(0,100,80,0.13);
    --shadow-teal:   0 6px 20px rgba(0,184,160,0.30);

    --radius-xs:     6px;
    --radius-sm:     10px;
    --radius:        16px;
    --radius-lg:     22px;
    --radius-xl:     32px;
    --radius-full:   9999px;

    --sidebar-w:     260px;
    --topbar-h:      70px;

    --font: 'Plus Jakarta Sans', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,100,80,0.06);
}

.sidebar-logo {
    padding: 26px 24px 20px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.sidebar-logo .logo-icon {
    width: 44px; height: 44px;
    background: var(--teal-gradient);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    box-shadow: var(--shadow-teal);
    flex-shrink: 0;
}
.sidebar-logo .logo-text { line-height: 1.2; }
.sidebar-logo .logo-text strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy);
    display: block;
}
.sidebar-logo .logo-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-section-label {
    padding: 14px 24px 5px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-light);
}

.sidebar-nav { flex: 1; padding: 4px 14px; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-mid);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
    transition: all 0.18s;
    position: relative;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; transition: opacity 0.18s; }
.sidebar-nav a:hover {
    background: var(--teal-light);
    color: var(--teal-dark);
}
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-nav a.active {
    background: var(--teal-gradient);
    color: #fff;
    box-shadow: var(--shadow-teal);
}
.sidebar-nav a.active svg { opacity: 1; }
/* ── Nav child items ─────────────────────────────────────── */
.nav-children {
    margin: 2px 0 4px 0;
    padding-left: 14px;
    border-left: 2px solid rgba(255,255,255,0.15);
    margin-left: 20px;
}
.nav-child {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: all 0.18s;
    margin-bottom: 1px;
}
.nav-child:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.nav-child.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 700;
}
.nav-child svg { opacity: 0.7; flex-shrink: 0; }
.nav-child.active svg { opacity: 1; }

.sidebar-nav a .nav-badge {
    margin-left: auto;
    background: var(--teal-light);
    color: var(--teal-dark);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}
.sidebar-nav a.active .nav-badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--teal-light);
    cursor: pointer;
}
.sidebar-user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--teal-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-teal);
}
.sidebar-user-info strong { font-size: 0.82rem; font-weight: 700; color: var(--navy); display: block; }
.sidebar-user-info span  { font-size: 0.7rem; color: var(--text-muted); }

/* ── MAIN ─────────────────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(0,100,80,0.05);
}
.topbar-left h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--navy);
}
.topbar-left .breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
    font-weight: 500;
}
.topbar-left .breadcrumb a { color: var(--teal-dark); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

/* Search input in topbar */
.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
}
.topbar-search input {
    padding: 9px 16px 9px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.83rem;
    font-family: var(--font);
    width: 220px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    transition: all 0.18s;
}
.topbar-search input:focus { border-color: var(--teal); background: #fff; width: 280px; }
.topbar-search svg {
    position: absolute; left: 13px;
    width: 15px; height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Notification bell */
.topbar-icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-mid);
    transition: all 0.18s;
    position: relative;
}
.topbar-icon-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }
.topbar-icon-btn svg { width: 17px; height: 17px; }
.topbar-icon-btn .dot {
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 1.5px solid #fff;
}

/* ── CONTENT ─────────────────────────────────────────────── */
.content { padding: 28px 32px; flex: 1; }

/* ── WELCOME BANNER ──────────────────────────────────────── */
.welcome-banner {
    background: var(--teal-gradient);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-teal);
}
.welcome-banner::before {
    content: '';
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    right: -40px; top: -60px;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    right: 80px; bottom: -40px;
}
.welcome-banner h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}
.welcome-banner p { font-size: 0.85rem; color: rgba(255,255,255,0.82); font-weight: 500; }
.welcome-banner .banner-icon {
    font-size: 2.8rem;
    position: relative;
    z-index: 1;
}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.22s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.green  { background: #e6faf7; color: var(--teal); }
.stat-icon.blue   { background: var(--info-light); color: var(--info); }
.stat-icon.amber  { background: var(--orange-light); color: var(--orange); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-top: 3px; }
.stat-info  { font-size: 0.7rem; color: var(--teal); font-weight: 700; margin-top: 4px; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
    padding: 18px 22px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--navy);
    display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 22px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary {
    background: var(--teal-gradient);
    color: #fff;
    box-shadow: var(--shadow-teal);
}
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,184,160,0.35); }
.btn-success {
    background: var(--teal-gradient);
    color: #fff;
    box-shadow: var(--shadow-teal);
}
.btn-success:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-danger {
    background: linear-gradient(135deg, #ff5c7a, #e03360);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255,92,122,0.28);
}
.btn-danger:hover { transform: translateY(-1px); }
.btn-outline {
    background: var(--surface);
    border: 1.5px solid var(--border-mid);
    color: var(--text-mid);
    font-weight: 600;
    box-shadow: none;
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-light); }
.btn-orange {
    background: linear-gradient(135deg, #ffb74d, #f9a825);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249,168,37,0.3);
}
.btn-orange:hover { transform: translateY(-1px); }
.btn-sm { padding: 7px 16px; font-size: 0.76rem; }
.btn-xs { padding: 4px 12px; font-size: 0.7rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #f8fbfc;
    padding: 12px 18px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.87rem;
    vertical-align: middle;
    color: var(--text-mid);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.13s; }
tbody tr:hover { background: #f5fcfa; }
tbody td strong { color: var(--navy); font-weight: 700; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy);
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 15px;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    transition: all 0.18s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(0,184,160,0.10);
    background: #fff;
}
.form-group textarea { resize: vertical; min-height: 88px; }
.form-group.span-2 { grid-column: span 2; }

/* ── SEARCH BAR ──────────────────────────────────────────── */
.search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 380px;
}
.search-wrap svg {
    position: absolute; left: 14px;
    width: 16px; height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}
.search-wrap input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-full);
    font-size: 0.87rem;
    font-family: var(--font);
    outline: none;
    background: var(--surface);
    transition: all 0.18s;
}
.search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0,184,160,0.08); }

/* ── FLASH ───────────────────────────────────────────────── */
.flash {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.87rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 0.3s ease;
}
.flash-success { background: #e6faf7; color: #00806e; border: 1.5px solid var(--teal-mid); }
.flash-error   { background: var(--danger-light); color: #c0284a; border: 1.5px solid #ffaabb; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-present { background: #e6faf7; color: #00806e; }
.badge-absent  { background: var(--danger-light); color: #c0284a; }
.badge-S  { background: #e6faf7; color: var(--teal-dark); }
.badge-PF { background: var(--info-light); color: #1d6fd4; }
.badge-TF { background: var(--orange-light); color: #b37800; }
.badge-X  { background: var(--danger-light); color: #c0284a; }
.badge-O  { background: #f3f4f6; color: #4b5563; }

/* ── PILLS ───────────────────────────────────────────────── */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}
.pill-teal   { background: var(--teal-light); color: var(--teal-dark); }
.pill-blue   { background: var(--info-light); color: var(--info); }
.pill-orange { background: var(--orange-light); color: #b37800; }
.pill-red    { background: var(--danger-light); color: var(--danger); }

/* ── PATIENT/CLIENT CARD ─────────────────────────────────── */
.client-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1.5px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}
.client-card:hover { border-color: var(--teal); box-shadow: var(--shadow-teal); transform: translateY(-1px); }
.client-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--teal-gradient);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,184,160,0.22);
}
.client-avatar.orange { background: linear-gradient(135deg,#ffb74d,#f9a825); box-shadow: 0 2px 10px rgba(249,168,37,0.22); }
.client-avatar.blue   { background: linear-gradient(135deg,#60a5fa,#3b82f6); box-shadow: 0 2px 10px rgba(59,130,246,0.22); }

/* ── SECTION CARD ────────────────────────────────────────── */
.section-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 26px;
    margin-bottom: 20px;
}
.section-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--teal);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── DETAIL GRID ─────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}
.detail-item .detail-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.detail-item .detail-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
}

/* ── TOOTH CHART ─────────────────────────────────────────── */
.tooth-arch-label {
    font-size: 0.67rem;
    text-align: center;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 3px 0;
}
.tooth-arch { display: flex; justify-content: center; gap: 3px; margin: 4px 0; }
.tooth-btn {
    width: 38px; height: 48px;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    background: var(--surface2);
    font-size: 0.65rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 3px 2px;
    transition: all 0.15s;
    font-family: var(--font);
}
.tooth-btn:hover { border-color: var(--teal); transform: scale(1.08); z-index: 2; box-shadow: var(--shadow-sm); }
.tooth-num  { font-size: 0.58rem; color: var(--text-muted); font-weight: 700; }
.tooth-code { font-size: 0.78rem; font-weight: 800; min-height: 14px; }
.tooth-btn[data-cond="✓"]   { background: #e6faf7; border-color: var(--teal); color: var(--teal-dark); }
.tooth-btn[data-cond="D"],
.tooth-btn[data-cond="d"]   { background: #fff0f3; border-color: var(--danger); color: #c0284a; }
.tooth-btn[data-cond="F"],
.tooth-btn[data-cond="f"]   { background: #eff6ff; border-color: var(--info); color: #1d6fd4; }
.tooth-btn[data-cond="M"],
.tooth-btn[data-cond="m"]   { background: #f3f4f6; border-color: #9ca3af; color: #374151; }
.tooth-btn[data-cond="Un"],
.tooth-btn[data-cond="un"]  { background: #fff8e1; border-color: var(--orange); color: #b37800; }
.tooth-btn[data-cond="JC"],
.tooth-btn[data-cond="jc"]  { background: #f5f0ff; border-color: #8b5cf6; color: #5b21b6; }
.tooth-btn[data-cond="P"],
.tooth-btn[data-cond="p"]   { background: #fdf0f8; border-color: #ec4899; color: #9d174d; }

.cond-btn {
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-full);
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    background: var(--surface);
    color: var(--text-mid);
    transition: all 0.15s;
}
.cond-btn:hover, .cond-btn.active {
    border-color: var(--teal);
    background: var(--teal-light);
    color: var(--teal-dark);
}
.chart-legend {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 14px; padding: 14px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text-mid); }
.legend-swatch {
    width: 22px; height: 22px;
    border-radius: 5px; border: 2px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.62rem; font-weight: 800;
}
.tooth-chart-section h4 {
    font-size: 0.88rem; font-weight: 800; color: var(--navy);
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border);
}

/* ── BOOKING-STYLE PROFILE CARD ──────────────────────────── */
.doc-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    text-align: center;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--teal); }
.doc-card .doc-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--teal-gradient);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.8rem;
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-teal);
}
.doc-card .doc-name { font-weight: 800; color: var(--navy); font-size: 0.95rem; margin-bottom: 3px; }
.doc-card .doc-sub  { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.doc-card .doc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.doc-card .doc-stat-val  { font-size: 1rem; font-weight: 800; color: var(--navy); }
.doc-card .doc-stat-lbl  { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* ── MISC ────────────────────────────────────────────────── */
.section-title { font-size: 1rem; font-weight: 800; color: var(--navy); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.page-actions  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.empty-state   { text-align: center; padding: 48px 20px; color: var(--text-muted); font-weight: 600; }
.empty-state svg { width: 46px; height: 46px; opacity: 0.22; margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── LOGIN ───────────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}
.login-left {
    flex: 1;
    background: var(--teal-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 24px;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.login-left::before {
    content: '';
    position: absolute;
    width: 350px; height: 350px; border-radius: 50%;
    background: rgba(255,255,255,0.07);
    bottom: -80px; left: -80px;
}
.login-left::after {
    content: '';
    position: absolute;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,0.06);
    top: -40px; right: -40px;
}
.login-left-content { position: relative; z-index: 1; text-align: center; color: #fff; }
.login-left-content .big-icon { font-size: 4rem; margin-bottom: 20px; display: block; }
.login-left-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.login-left-content p  { font-size: 0.9rem; opacity: 0.85; font-weight: 500; max-width: 300px; line-height: 1.7; }
.login-right {
    width: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: var(--surface);
}
.login-form-wrap { width: 100%; max-width: 360px; }
.login-form-wrap .login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.login-brand-icon {
    width: 46px; height: 46px;
    background: var(--teal-gradient);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow-teal);
}
.login-form-wrap h2 { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.login-form-wrap .sub { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; margin-bottom: 30px; }
.login-form-wrap .form-group { margin-bottom: 16px; }
.login-form-wrap .btn { width: 100%; justify-content: center; padding: 13px; font-size: 0.95rem; border-radius: var(--radius-sm); margin-top: 8px; }
.login-hint { text-align: center; margin-top: 18px; font-size: 0.75rem; color: var(--text-muted); background: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); }

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card, .stat-card, .section-card { animation: fadeInUp 0.3s ease both; }
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.08s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.16s; }

/* ── HAMBURGER BUTTON ────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════
   HAMBURGER BUTTON
═══════════════════════════════════════════════════════════ */
.hamburger-btn {
    display: none;  /* hidden on desktop, shown via media query */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--teal);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,184,160,0.3);
}
.hamburger-btn:hover {
    background: var(--teal-dark);
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2.5px;
    background: #ffffff;
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
    pointer-events: none;
}
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ═══════════════════════════════════════════════════════════
   OVERLAY (mobile backdrop)
═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 30, 50, 0.5);
    z-index: 198;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

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

/* Tablet */
@media (max-width: 1024px) {
    :root { --sidebar-w: 230px; }
}

/* Tablet portrait - form adjustments */
@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.span-2 { grid-column: span 1; }
    .login-left { display: none; }
    .login-right { width: 100%; padding: 32px 24px; }
}

/* Mobile - hamburger + slide drawer */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }

    /* ── Sidebar becomes a slide-in drawer ── */
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: 280px !important;
        height: 100vh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        overflow-y: auto;
    }
    .sidebar.is-open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0, 100, 80, 0.2);
    }

    /* ── Main content fills full screen ── */
    .main { margin-left: 0 !important; }

    /* ── Topbar ── */
    .topbar {
        height: 60px;
        padding: 0 14px;
        gap: 8px;
    }
    .topbar-left h2 { font-size: 1rem; }
    .topbar-left .breadcrumb { display: none; }

    /* ── Show hamburger button on mobile ── */
    .hamburger-btn { display: -webkit-flex; display: flex; }

    /* ── Hide things that won't fit ── */
    .topbar-user-text { display: none !important; }
    .topbar-icon-btn  { display: none !important; }
    .topbar-search    { display: none !important; }

    /* ── Hide topbar actions text, keep icons ── */
    .topbar-right .btn span { display: none; }

    /* ── Content ── */
    .content { padding: 16px 14px; }

    /* ── Stats: 2 columns ── */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* ── All dashboard chart grids → single column ── */
    .dash-grid-2,
    .dash-grid-3 { grid-template-columns: 1fr !important; }

    /* ── Tables: allow horizontal scroll ── */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 520px; }

    /* ── Forms ── */
    .section-card { padding: 18px 14px; }
}

/* Small mobile */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .content { padding: 12px 10px; }
    .topbar { padding: 0 10px; height: 56px; }
    .topbar-left h2 { font-size: 0.95rem; }
    .page-actions { flex-wrap: wrap; gap: 6px; }
    .btn { padding: 8px 14px; font-size: 0.78rem; }
    .btn-sm { padding: 6px 10px; font-size: 0.72rem; }
}
