/* ═══════════════════════════════════════════════════════════════════
   ORCHID BOOKING — Design System v6.0
   Mobile-first · Dark/Light Mode · Bilingual · SVG Icon System
   Deemlo © 2026
═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;900&display=swap');

/* ──────────────────────────────────────────────────────────────────
   1. CSS VARIABLES — Light Mode (default)
────────────────────────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --brand-blue:    #1a56db;
    --brand-purple:  #7c3aed;
    --brand-red:     #e02424;

    /* Semantic Colors — Light */
    --primary:       #1a56db;
    --primary-d:     #1143c0;
    --primary-l:     #5b8dee;
    --secondary:     #7c3aed;
    --accent:        #e02424;
    --success:       #059669;
    --warning:       #d97706;
    --danger:        #dc2626;
    --info:          #0284c7;

    /* Surface — Light */
    --bg:            #f0f4ff;
    --bg-alt:        #e8edf8;
    --surface:       #ffffff;
    --surface-2:     #f8faff;
    --surface-3:     #f1f5fd;
    --overlay:       rgba(0,0,0,.45);

    /* Text — Light */
    --text:          #0f172a;
    --text-2:        #334155;
    --text-3:        #64748b;
    --muted:         #94a3b8;
    --on-primary:    #ffffff;

    /* Border — Light */
    --border:        #dde3f0;
    --border-2:      #c8d2e8;
    --divider:       #eef1f8;

    /* Gradients */
    --gradient:      linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
    --gradient-r:    linear-gradient(135deg, #7c3aed 0%, #1a56db 100%);
    --gradient-w:    linear-gradient(135deg, #1a56db 0%, #7c3aed 50%, #e02424 100%);
    --gradient-hero: linear-gradient(160deg, #1a56db 0%, #7c3aed 60%, #e02424 100%);

    /* Shadows — Light */
    --shadow-xs:     0 1px 2px rgba(15,23,42,.04);
    --shadow:        0 1px 4px rgba(26,86,219,.06), 0 4px 16px rgba(26,86,219,.07);
    --shadow-md:     0 4px 20px rgba(26,86,219,.10), 0 1px 4px rgba(26,86,219,.05);
    --shadow-lg:     0 12px 48px rgba(26,86,219,.14), 0 4px 16px rgba(26,86,219,.08);
    --shadow-xl:     0 24px 64px rgba(26,86,219,.18);
    --shadow-float:  0 8px 30px rgba(26,86,219,.22);
    --shadow-inset:  inset 0 1px 3px rgba(26,86,219,.08);

    /* Shape */
    --radius-xs:     6px;
    --radius-sm:     10px;
    --radius:        14px;
    --radius-lg:     20px;
    --radius-xl:     28px;
    --radius-2xl:    36px;
    --radius-full:   9999px;

    /* Typography */
    --font:          'Outfit', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --font-display:  'Playfair Display', Georgia, serif;

    /* Sizing */
    --navbar-h:      58px;
    --tabbar-h:      68px;
    --sidebar-w:     256px;

    /* Safe area */
    --safe-top:      env(safe-area-inset-top, 0px);
    --safe-bot:      env(safe-area-inset-bottom, 0px);
    --safe-left:     env(safe-area-inset-left, 0px);
    --safe-right:    env(safe-area-inset-right, 0px);

    /* Transitions */
    --trans-fast:    .12s cubic-bezier(.4,0,.2,1);
    --trans:         .2s cubic-bezier(.4,0,.2,1);
    --trans-slow:    .35s cubic-bezier(.4,0,.2,1);

    /* Status badges */
    --badge-pending-bg:   #fef3c7;
    --badge-pending-c:    #92400e;
    --badge-confirmed-bg: #dbeafe;
    --badge-confirmed-c:  #1e40af;
    --badge-done-bg:      #d1fae5;
    --badge-done-c:       #065f46;
    --badge-cancelled-bg: #fee2e2;
    --badge-cancelled-c:  #991b1b;
    --badge-noshow-bg:    #f3f4f6;
    --badge-noshow-c:     #374151;
}

/* ──────────────────────────────────────────────────────────────────
   2. DARK MODE
────────────────────────────────────────────────────────────────── */
html.dark-mode {
    --bg:            #0a0e1a;
    --bg-alt:        #0f1422;
    --surface:       #141929;
    --surface-2:     #1a2035;
    --surface-3:     #1f2741;
    --overlay:       rgba(0,0,0,.65);

    --text:          #f0f4ff;
    --text-2:        #c8d4f0;
    --text-3:        #8899bb;
    --muted:         #5a6a88;
    --on-primary:    #ffffff;

    --border:        #1e2d4a;
    --border-2:      #283a5c;
    --divider:       #172035;

    --shadow-xs:     0 1px 2px rgba(0,0,0,.3);
    --shadow:        0 2px 8px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.25);
    --shadow-md:     0 4px 20px rgba(0,0,0,.4), 0 1px 4px rgba(0,0,0,.3);
    --shadow-lg:     0 12px 48px rgba(0,0,0,.5);
    --shadow-xl:     0 24px 64px rgba(0,0,0,.6);
    --shadow-float:  0 8px 30px rgba(0,0,0,.45);
    --shadow-inset:  inset 0 1px 3px rgba(0,0,0,.3);

    --badge-pending-bg:   rgba(245,158,11,.15);
    --badge-pending-c:    #fcd34d;
    --badge-confirmed-bg: rgba(59,130,246,.15);
    --badge-confirmed-c:  #93c5fd;
    --badge-done-bg:      rgba(16,185,129,.15);
    --badge-done-c:       #6ee7b7;
    --badge-cancelled-bg: rgba(239,68,68,.15);
    --badge-cancelled-c:  #fca5a5;
    --badge-noshow-bg:    rgba(107,114,128,.15);
    --badge-noshow-c:     #d1d5db;

    /* Force surface vars cho những nơi dùng var() */
    --surf:          #141929;
    --surf2:         #1a2035;
    --surf3:         #1f2741;
    --bdr:           #1e2d4a;
    --txt:           #f0f4ff;
    --txt2:          #c8d4f0;
    --txt3:          #8899bb;
    --bg2:           #0f1422;
    --pri:           #5b8dee;
}

/* ──────────────────────────────────────────────────────────────────
   3. RESET & BASE
────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; padding: 0;
}
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--trans-slow), color var(--trans-slow);
}
img, svg { display: block; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* Prevent text selection on interactive elements */
button, .btn, .tab-item, .opt-card, .card, .chip, .badge,
.sidebar-item, .date-chip, .cal-slot {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-l); }

/* ──────────────────────────────────────────────────────────────────
   4. TYPOGRAPHY
────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -.02em;
}
h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); font-weight: 700; }
h3 { font-size: clamp(1.1rem, 3vw, 1.3rem); font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
h5 { font-size: .9rem; font-weight: 600; }

.display-title {
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: -.03em;
}
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-muted   { color: var(--muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-sm  { font-size: .85rem; }
.text-xs  { font-size: .75rem; }
.text-lg  { font-size: 1.1rem; }
.text-xl  { font-size: 1.25rem; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* ──────────────────────────────────────────────────────────────────
   5. APP LOADING SCREEN
────────────────────────────────────────────────────────────────── */
#app-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity .5s cubic-bezier(.4,0,.2,1), visibility .5s;
}
#app-loading.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-logo {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(26,86,219,.35);
    overflow: hidden;
    animation: loading-pulse 1.8s ease-in-out infinite;
}
.loading-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.loading-brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
}
.loading-sub {
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .06em;
    text-transform: uppercase;
}
.loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.loading-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    animation: loading-dot 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; background: var(--secondary); }
.loading-dots span:nth-child(3) { animation-delay: .4s; background: var(--accent); }

@keyframes loading-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(26,86,219,.35); }
    50% { transform: scale(1.04); box-shadow: 0 12px 40px rgba(26,86,219,.5); }
}
@keyframes loading-dot {
    0%, 80%, 100% { transform: scale(.6); opacity: .4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ──────────────────────────────────────────────────────────────────
   6. NAVBAR — Top App Bar
────────────────────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 300;
    height: var(--navbar-h);
    padding: 0 16px;
    padding-top: var(--safe-top);
    background: rgba(var(--surface-rgb, 255,255,255), .92);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background var(--trans-slow), border-color var(--trans-slow);
}
html.dark-mode .navbar {
    background: rgba(20,25,41,.92);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
    flex-shrink: 0;
}
.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    object-fit: cover;
}
.navbar-brand .brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gradient);
    flex-shrink: 0;
}
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    cursor: pointer;
    transition: background var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
    position: relative;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn:hover { background: var(--surface-3); color: var(--primary); }
.nav-btn:active { transform: scale(.88); }
.nav-btn .notif-dot {
    position: absolute;
    top: 7px; right: 7px;
    width: 8px; height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* ──────────────────────────────────────────────────────────────────
   7. BOTTOM TABBAR — Customer & Staff
────────────────────────────────────────────────────────────────── */
.app-tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 450;
    height: calc(var(--tabbar-h) + var(--safe-bot));
    padding-bottom: var(--safe-bot);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0,0,0,.06);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    display: flex;
    align-items: stretch;
    transition: background var(--trans-slow), border-color var(--trans-slow);
}
html.dark-mode .app-tabbar {
    background: rgba(20,25,41,.96);
    box-shadow: 0 -4px 24px rgba(0,0,0,.3);
}
.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--muted);
    font-size: .63rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-decoration: none;
    transition: color var(--trans-fast), transform var(--trans-fast);
    position: relative;
}
.tab-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
    transition: stroke-width var(--trans-fast);
}
.tab-item.active {
    color: var(--primary);
}
.tab-item.active svg { stroke-width: 2.3; }
.tab-item:active { transform: scale(.84); }

/* Center FAB tab */
.tab-item-center { flex: 1.2; }
.tab-center-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 18px rgba(26,86,219,.38);
    transition: transform var(--trans-fast), box-shadow var(--trans-fast);
    margin-bottom: 2px;
}
.tab-item-center:active .tab-center-btn {
    transform: scale(.88);
    box-shadow: 0 2px 8px rgba(26,86,219,.2);
}
.tab-item-center.active .tab-center-btn {
    background: var(--gradient-r);
}

/* Tab badge */
.tab-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    background: var(--danger);
    color: #fff;
    font-size: .5rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    line-height: 1;
}

/* Body padding for tabbar */
body.has-tabbar {
    padding-bottom: calc(var(--tabbar-h) + var(--safe-bot) + 8px);
}

@media (min-width: 769px) {
    .app-tabbar { display: none !important; }
    body.has-tabbar { padding-bottom: 0 !important; }
}

/* ──────────────────────────────────────────────────────────────────
   8. SIDEBAR — Partner & Admin
────────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 400;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--trans-slow), background var(--trans-slow), border-color var(--trans-slow);
}
html.dark-mode .sidebar {
    background: #141929 !important;
    border-right-color: #1e2d4a !important;
}
html.dark-mode .sidebar-brand {
    color: #f0f4ff !important;
    border-bottom-color: #1e2d4a !important;
}
html.dark-mode .sidebar-section {
    color: #5a6a88 !important;
}
html.dark-mode .sidebar-item {
    color: #8899bb !important;
}
html.dark-mode .sidebar-item:hover {
    background: rgba(255,255,255,.06) !important;
    color: #f0f4ff !important;
}
html.dark-mode .sidebar-item.active {
    background: rgba(91,141,238,.15) !important;
    border-left-color: #5b8dee !important;
    color: #fff !important;
}
html.dark-mode .sidebar-menu {
    background: #141929;
}
html.dark-mode .sidebar-footer {
    background: #141929;
    border-top-color: #1e2d4a !important;
}
.admin-sidebar {
    background: #0b1220 !important;
    border-right-color: #1a2640 !important;
}
.admin-sidebar .sidebar-brand,
.admin-sidebar .sidebar-item,
.admin-sidebar .sidebar-section { color: rgba(255,255,255,.9); }
.admin-sidebar .sidebar-section { color: rgba(255,255,255,.3) !important; }
.admin-sidebar .sidebar-item { color: rgba(255,255,255,.65); }
.admin-sidebar .sidebar-item.active {
    background: rgba(26,86,219,.25) !important;
    border-left-color: var(--brand-blue) !important;
    color: #fff !important;
}
.admin-sidebar .sidebar-item:hover {
    background: rgba(255,255,255,.07) !important;
    color: #fff !important;
}

.sidebar-brand {
    padding: 18px 16px 14px;
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-brand img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
}
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-section {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 12px 8px 6px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--trans-fast), color var(--trans-fast);
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 1.8;
    opacity: .75;
    transition: opacity var(--trans-fast);
}
.sidebar-item:hover {
    background: var(--surface-3);
    color: var(--primary);
}
.sidebar-item:hover svg { opacity: 1; }
.sidebar-item.active {
    background: rgba(26,86,219,.08);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}
.sidebar-item.active svg { opacity: 1; stroke-width: 2.2; }
.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Sidebar mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 390;
    background: var(--overlay);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .sidebar.open { transform: translateX(0); }
    .partner-layout .main-content,
    .partner-layout .page-content { margin-left: 0 !important; }
}
@media (min-width: 769px) {
    .partner-layout {
        display: grid;
        grid-template-columns: var(--sidebar-w) 1fr;
    }
    .partner-layout .main-content,
    .partner-layout .page-content { grid-column: 2; }
}

/* ──────────────────────────────────────────────────────────────────
   9. CARDS
────────────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--trans), transform var(--trans),
                background var(--trans-slow), border-color var(--trans-slow);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-body { padding: 16px; }
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h3 {
    font-size: .95rem;
    font-weight: 700;
    margin: 0;
}
.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

/* Stat cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    transition: background var(--trans-slow), border-color var(--trans-slow);
}
.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26,86,219,.1);
    color: var(--primary);
    margin-bottom: 12px;
}
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: .78rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.stat-card .stat-delta {
    font-size: .78rem;
    font-weight: 600;
    margin-top: 8px;
}
.stat-card .stat-delta.up { color: var(--success); }
.stat-card .stat-delta.down { color: var(--danger); }

/* ──────────────────────────────────────────────────────────────────
   10. BUTTONS
────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    height: 44px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 600;
    letter-spacing: -.01em;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity var(--trans-fast), transform var(--trans-fast),
                box-shadow var(--trans-fast), background var(--trans-fast);
    -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn:active { transform: scale(.94); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(26,86,219,.28);
}
.btn-primary:hover { opacity: .9; box-shadow: 0 6px 20px rgba(26,86,219,.35); }

.btn-secondary {
    background: rgba(26,86,219,.1);
    color: var(--primary);
}
.btn-secondary:hover { background: rgba(26,86,219,.16); }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-2);
    color: var(--text-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,86,219,.04); }

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-3); }

.btn-danger {
    background: rgba(220,38,38,.1);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(220,38,38,.18); }

.btn-success {
    background: rgba(5,150,105,.1);
    color: var(--success);
}
.btn-success:hover { background: rgba(5,150,105,.18); }

.btn-sm  { height: 34px; padding: 0 12px; font-size: .8rem; border-radius: var(--radius-xs); }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg  { height: 52px; padding: 0 24px; font-size: .95rem; border-radius: var(--radius); }
.btn-xl  { height: 58px; padding: 0 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }

/* Icon button */
.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
    flex-shrink: 0;
}
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon:hover { background: rgba(26,86,219,.1); color: var(--primary); border-color: var(--primary); }
.btn-icon:active { transform: scale(.88); }
.btn-icon.sm { width: 32px; height: 32px; border-radius: var(--radius-xs); }
.btn-icon.sm svg { width: 15px; height: 15px; }

/* ──────────────────────────────────────────────────────────────────
   11. FORMS
────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: .02em;
    text-transform: uppercase;
}
.form-control {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 400;
    color: var(--text);
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast),
                background var(--trans-slow);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-control::placeholder { color: var(--muted); }
textarea.form-control {
    height: auto;
    padding: 12px 14px;
    resize: vertical;
    min-height: 90px;
}
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
html.dark-mode .form-control {
    background: var(--surface-2);
}

/* Input with icon */
.input-group { position: relative; }
.input-group .input-icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.input-group .form-control { padding-left: 40px; }
.input-group .input-action {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
}

/* Form hint / error */
.form-hint { font-size: .78rem; color: var(--muted); }
.form-error { font-size: .78rem; color: var(--danger); }
.form-control.is-error { border-color: var(--danger); }
.form-control.is-error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

/* Checkbox / Radio custom */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
.form-check-label { font-size: .875rem; font-weight: 500; color: var(--text-2); }

/* Toggle switch */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.toggle {
    width: 44px;
    height: 24px;
    background: var(--border-2);
    border-radius: 12px;
    position: relative;
    transition: background var(--trans);
    flex-shrink: 0;
}
.toggle::after {
    content: '';
    position: absolute;
    left: 3px; top: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform var(--trans);
}
input:checked + .toggle,
.toggle.on { background: var(--primary); }
input:checked + .toggle::after,
.toggle.on::after { transform: translateX(20px); }

/* ──────────────────────────────────────────────────────────────────
   12. BADGES & STATUS CHIPS
────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.badge-pending   { background: var(--badge-pending-bg);   color: var(--badge-pending-c); }
.badge-confirmed { background: var(--badge-confirmed-bg); color: var(--badge-confirmed-c); }
.badge-completed,
.badge-done      { background: var(--badge-done-bg);      color: var(--badge-done-c); }
.badge-cancelled { background: var(--badge-cancelled-bg); color: var(--badge-cancelled-c); }
.badge-no_show,
.badge-noshow    { background: var(--badge-noshow-bg);    color: var(--badge-noshow-c); }
.badge-primary   { background: rgba(26,86,219,.12); color: var(--primary); }
.badge-success   { background: rgba(5,150,105,.12); color: var(--success); }
.badge-danger    { background: rgba(220,38,38,.12); color: var(--danger); }
.badge-warning   { background: rgba(217,119,6,.12); color: var(--warning); }
.badge-gray      { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }

/* Dot badge */
.badge-dot::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 2px;
}

/* ──────────────────────────────────────────────────────────────────
   13. DARK MODE TOGGLE BUTTON
────────────────────────────────────────────────────────────────── */
.dark-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--trans-fast), border-color var(--trans-fast),
                color var(--trans-fast), transform var(--trans-fast);
    flex-shrink: 0;
}
.dark-toggle:hover {
    background: rgba(26,86,219,.1);
    border-color: var(--primary);
    color: var(--primary);
}
.dark-toggle:active { transform: scale(.88); }
.dark-toggle svg { width: 18px; height: 18px; transition: transform .4s; }
.dark-toggle:hover svg { transform: rotate(20deg); }

/* Sun icon — show in dark mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
html.dark-mode .icon-sun  { display: block; }
html.dark-mode .icon-moon { display: none; }

/* ──────────────────────────────────────────────────────────────────
   14. LANGUAGE SWITCHER
────────────────────────────────────────────────────────────────── */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.lang-btn {
    padding: 4px 10px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    cursor: pointer;
    transition: background var(--trans-fast), color var(--trans-fast);
}
.lang-btn.active,
.lang-btn:hover {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* ──────────────────────────────────────────────────────────────────
   15. TOAST NOTIFICATIONS
────────────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: calc(var(--navbar-h) + var(--safe-top) + 10px);
    right: 12px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    max-width: 340px;
    animation: toast-in .28s cubic-bezier(.34,1.56,.64,1) forwards;
}
.toast-icon svg { width: 20px; height: 20px; }
.toast-title { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.toast-body { font-size: .8rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px) scale(.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ──────────────────────────────────────────────────────────────────
   16. PAGE HEADER / SECTION HEADER
────────────────────────────────────────────────────────────────── */
.page-header {
    padding: 20px 16px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.page-header-inner { flex: 1; }
.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--text);
    line-height: 1.2;
    margin: 0;
}
.page-subtitle {
    font-size: .82rem;
    color: var(--muted);
    margin-top: 3px;
    font-weight: 400;
}
.section-header {
    padding: 0 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}
.section-link {
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
}

/* ──────────────────────────────────────────────────────────────────
   17. LIST ITEMS
────────────────────────────────────────────────────────────────── */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    background: var(--surface);
    transition: background var(--trans-fast);
    text-decoration: none;
    color: var(--text);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover, .list-item:active { background: var(--surface-2); }
.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(26,86,219,.09);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}
.list-item-icon svg { width: 18px; height: 18px; }
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.list-item-sub   { font-size: .78rem; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.list-item-chevron { width: 16px; height: 16px; color: var(--muted); }

/* ──────────────────────────────────────────────────────────────────
   18. AVATAR
────────────────────────────────────────────────────────────────── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-xs);
}
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.3rem; border-width: 3px; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -10px; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ──────────────────────────────────────────────────────────────────
   19. EMPTY STATE
────────────────────────────────────────────────────────────────── */
.empty-state {
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}
.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    margin-bottom: 4px;
}
.empty-icon svg { width: 28px; height: 28px; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.empty-sub { font-size: .83rem; color: var(--muted); max-width: 260px; line-height: 1.5; }

/* ──────────────────────────────────────────────────────────────────
   20. SKELETON LOADING
────────────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%);
    background-size: 200% 100%;
    animation: skeleton-shine 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shine {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
.skeleton-text { height: 14px; border-radius: 7px; }
.skeleton-title { height: 20px; border-radius: 10px; }
.skeleton-avatar { border-radius: 50%; }

/* ──────────────────────────────────────────────────────────────────
   21. PAGE LAYOUT
────────────────────────────────────────────────────────────────── */
.page-content {
    padding: 0 12px 24px;
    max-width: 680px;
    margin: 0 auto;
}
.page-content-wide {
    padding: 0 12px 24px;
    max-width: 960px;
    margin: 0 auto;
}
.section { margin-bottom: 20px; }
.divider {
    height: 1px;
    background: var(--divider);
    margin: 12px 0;
}
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 480px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
}

/* Flex utils */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1      { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-full      { width: 100%; }

/* ──────────────────────────────────────────────────────────────────
   22. TABLE
────────────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead { background: var(--surface-2); border-bottom: 1px solid var(--border); }
th {
    padding: 11px 14px;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
td {
    padding: 12px 14px;
    color: var(--text-2);
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--trans-fast); }
tbody tr:hover { background: var(--surface-2); }

/* ──────────────────────────────────────────────────────────────────
   23. MODAL / BOTTOM SHEET
────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 800;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--trans), visibility var(--trans);
}
.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-sheet {
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    padding-bottom: calc(24px + var(--safe-bot));
    transform: translateY(100%);
    transition: transform var(--trans-slow) cubic-bezier(.34,1.3,.64,1);
    overscroll-behavior: contain;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
    width: 40px; height: 4px;
    background: var(--border-2);
    border-radius: 2px;
    margin: 12px auto 8px;
}
.modal-header {
    padding: 8px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-body  { padding: 16px; }

/* Center modal for desktop */
@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
    }
    .modal-sheet {
        border-radius: var(--radius-xl);
        max-height: 85vh;
    }
}

/* ──────────────────────────────────────────────────────────────────
   24. HERO SECTION
────────────────────────────────────────────────────────────────── */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin: 12px;
    padding: 28px 20px 24px;
    background: var(--gradient-hero);
    color: #fff;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='80' cy='20' r='60' fill='rgba(255,255,255,.06)'/%3E%3Ccircle cx='10' cy='90' r='50' fill='rgba(255,255,255,.04)'/%3E%3C/svg%3E");
    background-size: 180px;
    pointer-events: none;
}
.hero-title { font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.15; position: relative; }
.hero-sub   { font-size: .85rem; opacity: .85; margin-top: 6px; position: relative; }
.hero-actions { display: flex; gap: 8px; margin-top: 18px; position: relative; }
.hero .btn { background: rgba(255,255,255,.2); color: #fff; border: 1.5px solid rgba(255,255,255,.35); backdrop-filter: blur(8px); }
.hero .btn-primary { background: rgba(255,255,255,.95); color: var(--primary); border: none; }

/* ──────────────────────────────────────────────────────────────────
   25. SEARCH BAR
────────────────────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0 14px;
    height: 46px;
    transition: border-color var(--trans-fast), box-shadow var(--trans-fast),
                background var(--trans-slow);
    box-shadow: var(--shadow-xs);
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.search-bar svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 400;
    color: var(--text);
    outline: none;
    padding: 0 10px;
}
.search-bar input::placeholder { color: var(--muted); }

/* ──────────────────────────────────────────────────────────────────
   26. CHIP / FILTER TABS
────────────────────────────────────────────────────────────────── */
.chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: .78rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--trans-fast), border-color var(--trans-fast),
                color var(--trans-fast), transform var(--trans-fast);
    -webkit-tap-highlight-color: transparent;
}
.chip:hover, .chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 10px rgba(26,86,219,.25);
}
.chip:active { transform: scale(.92); }

/* ──────────────────────────────────────────────────────────────────
   27. NOTIFICATION PANEL
────────────────────────────────────────────────────────────────── */
.notif-panel {
    position: fixed;
    top: calc(var(--navbar-h) + var(--safe-top) + 8px);
    right: 8px;
    width: 340px;
    max-width: calc(100vw - 16px);
    max-height: 70vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    z-index: 600;
    display: flex;
    flex-direction: column;
    transform: scale(.95) translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--trans), opacity var(--trans), visibility var(--trans);
    transform-origin: top right;
}
.notif-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}
.notif-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-header h4 { font-size: .9rem; font-weight: 700; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background var(--trans-fast);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: rgba(26,86,219,.04); }
.notif-item.unread::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 6px;
    vertical-align: middle;
}
.notif-item-title { font-size: .85rem; font-weight: 600; color: var(--text); }
.notif-item-body  { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.notif-item-time  { font-size: .7rem; color: var(--muted); margin-top: 4px; }

/* ──────────────────────────────────────────────────────────────────
   28. PARTNER LAYOUT / ADMIN LAYOUT
────────────────────────────────────────────────────────────────── */
.partner-body  { background: var(--bg); }
.partner-layout { display: flex; min-height: 100vh; }
.main-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}
@media (min-width: 769px) {
    .main-content { margin-left: var(--sidebar-w); }
}

/* Top bar for partner/admin pages */
.topbar {
    height: var(--navbar-h);
    padding: 0 20px;
    padding-top: var(--safe-top);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 200;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background var(--trans-slow), border-color var(--trans-slow);
}
.topbar-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-hamburger {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--trans-fast);
}
.topbar-hamburger:hover { background: var(--surface-3); }
.topbar-hamburger svg { width: 22px; height: 22px; }

/* ──────────────────────────────────────────────────────────────────
   29. ANIMATIONS & TRANSITIONS
────────────────────────────────────────────────────────────────── */
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slide-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes bounce-in {
    0%   { transform: scale(.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

.animate-fade   { animation: fade-in .25s ease forwards; }
.animate-up     { animation: slide-up .3s cubic-bezier(.34,1.3,.64,1) forwards; }
.animate-right  { animation: slide-in-right .25s ease forwards; }
.animate-scale  { animation: scale-in .25s cubic-bezier(.34,1.3,.64,1) forwards; }

/* Staggered children */
.stagger > * { opacity: 0; animation: slide-up .3s cubic-bezier(.34,1.3,.64,1) forwards; }
.stagger > *:nth-child(1)  { animation-delay: .05s; }
.stagger > *:nth-child(2)  { animation-delay: .1s; }
.stagger > *:nth-child(3)  { animation-delay: .15s; }
.stagger > *:nth-child(4)  { animation-delay: .2s; }
.stagger > *:nth-child(5)  { animation-delay: .25s; }
.stagger > *:nth-child(6)  { animation-delay: .3s; }
.stagger > *:nth-child(n+7){ animation-delay: .35s; }

/* ──────────────────────────────────────────────────────────────────
   30. MISC UTILITIES
────────────────────────────────────────────────────────────────── */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
.pos-relative { position: relative; }
.radius { border-radius: var(--radius); }
.radius-lg { border-radius: var(--radius-lg); }
.radius-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.overflow-hidden { overflow: hidden; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.block { display: block; }
.hidden { display: none !important; }

/* Pull-to-refresh prevention */
html, body { overscroll-behavior-y: none; }

/* ══════════════════════════════════════════════════════════
   DARK MODE — Comprehensive overrides (Hostinger compatible)
   Hardcode values thay vì var() để tránh CSS variable bugs
══════════════════════════════════════════════════════════ */
html.dark-mode body {
    background: #0a0e1a !important;
    color: #f0f4ff !important;
}
html.dark-mode .partner-layout,
html.dark-mode .main-content {
    background: #0a0e1a !important;
}
html.dark-mode .topbar,
html.dark-mode .partner-topbar {
    background: rgba(20,25,41,.97) !important;
    border-bottom-color: #1e2d4a !important;
}
html.dark-mode .card {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .card-header,
html.dark-mode .card-footer {
    background: #1a2035 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .surface,
html.dark-mode .stat-card {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .form-control,
html.dark-mode input:not([type=color]):not([type=range]),
html.dark-mode textarea,
html.dark-mode select {
    background: #1a2035 !important;
    border-color: #283a5c !important;
    color: #f0f4ff !important;
}
html.dark-mode .form-control::placeholder,
html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: #5a6a88 !important;
}
html.dark-mode .btn-outline {
    border-color: #283a5c !important;
    color: #c8d4f0 !important;
}
html.dark-mode .btn-ghost {
    color: #a5b4fc !important;
}
html.dark-mode .btn-ghost:hover {
    background: rgba(255,255,255,.08) !important;
}
html.dark-mode table thead {
    background: #1a2035 !important;
}
html.dark-mode th {
    color: #5a6a88 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode td {
    color: #c8d4f0 !important;
    border-color: #172035 !important;
}
html.dark-mode tbody tr:hover {
    background: rgba(255,255,255,.03) !important;
}
html.dark-mode .table-wrap {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .list-item {
    background: #141929 !important;
    border-color: #172035 !important;
    color: #f0f4ff !important;
}
html.dark-mode .chip {
    background: #1a2035 !important;
    border-color: #1e2d4a !important;
    color: #c8d4f0 !important;
}
html.dark-mode .chip.active {
    background: #1a56db !important;
    border-color: #1a56db !important;
    color: #fff !important;
}
html.dark-mode .empty-state .empty-icon {
    background: #1a2035 !important;
}
html.dark-mode .page-title,
html.dark-mode .page-subtitle,
html.dark-mode .section-title,
html.dark-mode h1, html.dark-mode h2,
html.dark-mode h3, html.dark-mode h4 {
    color: #f0f4ff !important;
}
html.dark-mode .text-muted,
html.dark-mode .page-subtitle {
    color: #5a6a88 !important;
}
/* Nav dropdown */
html.dark-mode .nav-dropdown,
html.dark-mode .utn-dropdown,
html.dark-mode .notif-panel {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .nd-item,
html.dark-mode .utn-dd-item {
    color: #c8d4f0 !important;
}
html.dark-mode .nd-item:hover,
html.dark-mode .utn-dd-item:hover {
    background: rgba(255,255,255,.06) !important;
}
/* Lang switcher */
html.dark-mode .lang-switcher {
    background: #1a2035 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .lang-btn {
    color: #8899bb !important;
}
html.dark-mode .lang-btn.active {
    background: #141929 !important;
    color: #5b8dee !important;
}
/* Calendar specific */
html.dark-mode .cal-page {
    background: #0a0e1a !important;
}
html.dark-mode .cal-top-controls {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .cal-toolbar {
    background: #141929 !important;
}
html.dark-mode .cal-vbtn {
    background: #1a2035 !important;
    border-color: #283a5c !important;
    color: #c8d4f0 !important;
}
html.dark-mode .cal-vbtn.on {
    background: #1a56db !important;
    color: #fff !important;
    border-color: #1a56db !important;
}
html.dark-mode .cal-hdr-staff {
    background: #141929 !important;
    border-color: #1e2d4a !important;
}
html.dark-mode .cal-s-col {
    border-color: #1e2d4a !important;
}
html.dark-mode .hr-line {
    border-color: rgba(255,255,255,.06) !important;
}
html.dark-mode .half-line {
    border-color: rgba(255,255,255,.03) !important;
}
html.dark-mode .cal-time-col {
    background: #0f1422 !important;
}
html.dark-mode .t-row span {
    color: #5a6a88 !important;
}
html.dark-mode .cal-body-wrap {
    background: #0a0e1a !important;
}
/* Modal/Sheet */
html.dark-mode .modal-sheet,
html.dark-mode #qb-panel,
html.dark-mode #ov-qbook > div,
html.dark-mode #ov-detail > div {
    background: #141929 !important;
}
html.dark-mode .modal-handle {
    background: #283a5c !important;
}
html.dark-mode .sh-grid .sh-cell {
    background: #1a2035 !important;
    border-color: #1e2d4a !important;
}
/* Dark toggle icon visibility */
html.dark-mode .icon-sun { display: block !important; }
html.dark-mode .icon-moon { display: none !important; }
.icon-sun { display: none; }
.icon-moon { display: block; }

/* ══════════════════════════════════════════════════════════
   DARK MODE — Active/Selected states rõ ràng hơn
══════════════════════════════════════════════════════════ */
html.dark-mode .cal-vbtn.on,
html.dark-mode .cal-vbtn:focus {
    background: #1a56db !important;
    color: #ffffff !important;
    border-color: #1a56db !important;
    box-shadow: 0 0 0 3px rgba(26,86,219,.4) !important;
}
html.dark-mode .cal-nav-arr:active,
html.dark-mode .cal-today-btn:active {
    background: rgba(26,86,219,.3) !important;
    transform: scale(.92);
}
html.dark-mode button:active,
html.dark-mode .btn:active {
    opacity: .85;
}
html.dark-mode .date-chip.active,
html.dark-mode .ds-chip.selected {
    background: #1a56db !important;
    border-color: #1a56db !important;
    color: #fff !important;
    box-shadow: 0 0 0 2px rgba(26,86,219,.5) !important;
}
html.dark-mode .time-slot.active,
html.dark-mode .time-c.on {
    background: #1a56db !important;
    border-color: #1a56db !important;
    color: #fff !important;
    box-shadow: 0 2px 12px rgba(26,86,219,.5) !important;
}
html.dark-mode .sf-chip.on {
    border-color: #5b8dee !important;
    background: rgba(91,141,238,.2) !important;
    box-shadow: 0 0 0 2px rgba(91,141,238,.35) !important;
}
html.dark-mode .cu-filter.on,
html.dark-mode .chip.active,
html.dark-mode .ptab.active {
    background: #1a56db !important;
    border-color: #1a56db !important;
    color: #fff !important;
    box-shadow: 0 2px 10px rgba(26,86,219,.4) !important;
}
html.dark-mode .sidebar-item.active {
    background: rgba(91,141,238,.2) !important;
    border-left-color: #5b8dee !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 #5b8dee !important;
}
/* Button states */
html.dark-mode .btn-primary {
    box-shadow: 0 4px 14px rgba(26,86,219,.5) !important;
}
html.dark-mode .btn-primary:active {
    transform: scale(.94) !important;
    box-shadow: 0 2px 6px rgba(26,86,219,.3) !important;
}
/* Lang btn active */
html.dark-mode .lang-btn.active,
html.dark-mode .nd-lang-pill.active,
html.dark-mode .utn-lang-pill.active {
    background: #1a56db !important;
    color: #fff !important;
    border-color: #1a56db !important;
}
