
:root {
    /* Primary palette — UCC Navy Blue */
    --primary: #1B2A5B;
    --primary-light: #2C4080;
    --primary-dark: #111D40;
    --primary-glow: rgba(27, 42, 91, 0.35);

    /* Accent — UCC Gold / success / warning / error */
    --accent: #D4A843;
    --accent-light: #E0BB60;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #CC2229;
    --info: #2C4080;

    /* Neutral dark palette — navy-tinted */
    --bg-primary: #0B0F1A;
    --bg-secondary: #111827;
    --bg-card: #151C2F;
    --bg-card-hover: #1C2540;
    --bg-input: #0F1422;
    --bg-glass: rgba(21, 28, 47, 0.88);

    /* Text */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0B0F1A;

    /* Borders */
    --border: rgba(148, 163, 184, 0.12);
    --border-focus: var(--accent);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px var(--primary-glow);
    --shadow-gold: 0 0 20px rgba(212, 168, 67, 0.15);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(.4,0,.2,1);
    --transition-base: 250ms cubic-bezier(.4,0,.2,1);
    --transition-slow: 400ms cubic-bezier(.4,0,.2,1);
    --transition-spring: 500ms cubic-bezier(.34,1.56,.64,1);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(27, 42, 91, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 67, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(27, 42, 91, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* =============================================
   NAVIGATION
   ============================================= */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: var(--bg-glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.navbar.hidden { transform: translateY(-100%); }

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 32px;
}

.nav-logo { font-size: 1.5rem; }

.nav-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}
.nav-link.active {
    color: var(--accent);
    background: rgba(212, 168, 67, 0.1);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}
.notification-bell:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}

.bell-icon { font-size: 1.2rem; display: flex; }

.notification-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 18px; height: 18px;
    background: var(--error);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse-badge 2s infinite;
    border: 2px solid var(--bg-primary);
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

#user-name {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.user-role-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.user-role-badge.patient { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.user-role-badge.doctor { background: rgba(212, 168, 67, 0.12); color: var(--accent); }
.user-role-badge.admin { background: rgba(212, 168, 67, 0.18); color: var(--accent-light); }

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}
.btn-logout:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(204, 34, 41, 0.08);
}

/* =============================================
   NOTIFICATION PANEL
   ============================================= */
.notification-panel {
    position: fixed;
    top: 72px; right: 16px;
    width: 380px;
    max-height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    overflow: hidden;
    animation: slideDown var(--transition-base);
}

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

.notification-panel.hidden { display: none; }

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.notif-header h3 { font-size: 0.9rem; font-weight: 600; }

.notif-list {
    overflow-y: auto;
    max-height: 400px;
}

.notif-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--bg-card-hover); }
.notif-item.unread { border-left: 3px solid var(--accent); }

.notif-item .notif-message { font-size: 0.85rem; line-height: 1.5; }
.notif-item .notif-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.notif-item.type-success .notif-message { color: var(--success); }
.notif-item.type-warning .notif-message { color: var(--warning); }
.notif-item.type-error .notif-message { color: var(--error); }
.notif-item.type-info .notif-message { color: var(--info); }

/* =============================================
   MAIN CONTAINER
   ============================================= */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: 0;
    transition: padding-top var(--transition-base);
}

.app-container.with-nav { padding-top: 80px; }

/* =============================================
   AUTH PAGES (Login / Register)
   ============================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow:
        var(--shadow-lg),
        0 0 60px rgba(27, 42, 91, 0.08);
    animation: cardEntrance 0.6s var(--transition-spring);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary-light));
    opacity: 0.8;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header .logo {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.auth-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
    letter-spacing: -0.01em;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.form-group input::placeholder { color: var(--text-muted); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group select { cursor: pointer; }
.form-group select option {
    background: #fff;
    color: #1a1a2e;
}
.form-group select option:hover,
.form-group select option:checked {
    background: var(--primary);
    color: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

/* Ripple effect base */
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}
.btn:active::after {
    width: 300px; height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #D4A843, #B8912E);
    color: #0B0F1A;
    box-shadow: 0 2px 12px rgba(212, 168, 67, 0.3);
    font-weight: 700;
    letter-spacing: -0.01em;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(212, 168, 67, 0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #0ea572; transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: var(--text-inverse); }
.btn-warning:hover { background: #e0900a; transform: translateY(-1px); }

.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #b01e24; transform: translateY(-1px); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: 6px; }

.btn-block { width: 100%; }

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}
.btn-link:hover { color: var(--accent-light); text-decoration: underline; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard {
    padding: 28px 32px;
    max-width: 1400px;
    margin: 0 auto;
    animation: pageEnter 0.5s ease;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.dashboard-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    border-color: rgba(212, 168, 67, 0.2);
}
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 14px;
    color: var(--accent);
    opacity: 0.8;
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(27, 42, 91, 0.3), rgba(212, 168, 67, 0.08));
    border-color: rgba(212, 168, 67, 0.2);
}

.stat-card.highlight::before { opacity: 1; }

/* =============================================
   CARDS / PANELS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-body { padding: 24px; }
.card-body.no-padding { padding: 0; }

/* =============================================
   TABLES
   ============================================= */
.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: rgba(27, 42, 91, 0.12);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
}

.data-table tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--bg-card-hover); }

/* =============================================
   STATUS BADGES
   ============================================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-badge.scheduled { background: rgba(44, 64, 128, 0.18); color: #6B8AFF; }
.status-badge.rescheduled { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-badge.completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-badge.cancelled { background: rgba(204, 34, 41, 0.12); color: #FF6B6B; }

/* =============================================
   TIME SLOT GRID
   ============================================= */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.slot-btn {
    padding: 10px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-fast);
}

.slot-btn:hover:not(.booked):not(.selected) {
    border-color: var(--accent);
    background: rgba(212, 168, 67, 0.08);
    color: var(--accent);
}

.slot-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
    box-shadow: 0 2px 12px rgba(212, 168, 67, 0.3);
    transform: scale(1.03);
}

.slot-btn.booked {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* =============================================
   DOCTOR CARDS
   ============================================= */
.doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.doctor-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.doctor-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.doctor-card:hover {
    border-color: rgba(212, 168, 67, 0.3);
    box-shadow: var(--shadow-md), var(--shadow-gold);
    transform: translateY(-3px);
}
.doctor-card:hover::before { opacity: 1; }

.doctor-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(27, 42, 91, 0.15), rgba(212, 168, 67, 0.05));
}
.doctor-card.selected::before { opacity: 1; }

.doctor-card .doctor-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.doctor-card .doctor-spec {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.doctor-card .doctor-bio {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

.doctor-card .doctor-fee {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.95rem;
}

/* =============================================
   AVAILABILITY TABLE
   ============================================= */
.availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.avail-card {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}
.avail-card:hover {
    border-color: rgba(212, 168, 67, 0.2);
    background: var(--bg-card-hover);
}

.avail-card .avail-day {
    font-weight: 700;
    font-size: 0.9rem;
}

.avail-card .avail-time {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.toast.toast-success { background: rgba(16, 185, 129, 0.95); }
.toast.toast-error { background: rgba(204, 34, 41, 0.95); }
.toast.toast-warning { background: rgba(245, 158, 11, 0.95); color: var(--text-inverse); }
.toast.toast-info { background: rgba(44, 64, 128, 0.95); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.toast-out {
    animation: toastOut 0.3s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

/* =============================================
   LOADING / EMPTY STATES
   ============================================= */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
}
.empty-state p {
    font-size: 0.9rem;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.6;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: overlayIn 0.25s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.35s cubic-bezier(.34,1.56,.64,1);
    box-shadow: var(--shadow-lg);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* =============================================
   UTILITY
   ============================================= */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* =============================================
   PAYMENT METHOD CARDS
   ============================================= */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.payment-method-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.payment-method-card:hover {
    border-color: rgba(212, 168, 67, 0.3);
    background: rgba(212, 168, 67, 0.04);
    transform: translateY(-2px);
}

.payment-method-card.selected {
    border-color: var(--accent);
    background: rgba(212, 168, 67, 0.08);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.15);
}

.pm-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.pm-info { flex: 1; }

.pm-name {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.pm-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.payment-form {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* =============================================
   RECEIPT
   ============================================= */
.receipt {
    max-width: 480px;
    margin: 0 auto;
}

.receipt-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.receipt-row:last-child { border-bottom: none; }

.receipt-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.receipt-value {
    font-weight: 700;
    font-size: 0.9rem;
    text-align: right;
}

.receipt-total {
    border-top: 2px solid var(--accent);
    margin-top: 8px;
    padding-top: 14px;
}

.receipt-total .receipt-value {
    font-size: 1.3rem;
    color: var(--accent);
}

/* =============================================
   STAGGERED ANIMATIONS
   ============================================= */
.stats-grid .stat-card {
    animation: staggerIn 0.5s ease both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.25s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.3s; }
.stats-grid .stat-card:nth-child(7) { animation-delay: 0.35s; }
.stats-grid .stat-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.card {
    animation: cardFadeIn 0.5s ease both;
}
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .navbar { padding: 0 12px; }
    .nav-brand { margin-right: 12px; }
    .nav-title { display: none; }
    .nav-links { overflow-x: auto; }
    .nav-link { font-size: 0.8rem; padding: 6px 10px; white-space: nowrap; }
    .user-menu #user-name { display: none; }
    .notification-panel { width: calc(100vw - 32px); right: 16px; }

    .dashboard { padding: 16px; }
    .dashboard-header h1 { font-size: 1.35rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-value { font-size: 1.5rem; }

    .auth-card { padding: 28px 20px; }
    .form-row { grid-template-columns: 1fr; }
    .doctor-grid { grid-template-columns: 1fr; }
    .slots-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .availability-grid { grid-template-columns: 1fr; }

    .data-table th, .data-table td { padding: 10px 12px; font-size: 0.8rem; }

    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { min-width: auto; width: 100%; }
    .payment-methods { grid-template-columns: 1fr; }
    .receipt { padding: 0; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .modal { margin: 16px; border-radius: var(--radius-md); }
}

/* ================================
   LIGHT MODE THEME
   ================================ */
[data-theme="light"] {
    --bg-primary: #F0F2F5;
    --bg-secondary: #E8EBF0;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F7FA;
    --bg-input: #F0F2F5;
    --bg-glass: rgba(255, 255, 255, 0.92);

    --text-primary: #1A1D2E;
    --text-secondary: #4A5568;
    --text-muted: #718096;
    --text-inverse: #FFFFFF;

    --border: rgba(27, 42, 91, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(27, 42, 91, 0.06);
    --shadow-gold: 0 0 20px rgba(212, 168, 67, 0.08);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(27, 42, 91, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 168, 67, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(27, 42, 91, 0.03) 0%, transparent 40%);
}

[data-theme="light"] body {
    background: var(--bg-primary);
}

[data-theme="light"] .navbar {
    background: var(--bg-glass);
    border-bottom-color: rgba(27, 42, 91, 0.08);
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

[data-theme="light"] .nav-title {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .auth-header h1 {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .auth-card {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(27,42,91,0.04);
}

[data-theme="light"] .auth-card::before {
    opacity: 0.6;
}

[data-theme="light"] .stat-card.highlight {
    background: linear-gradient(135deg, rgba(27, 42, 91, 0.05), rgba(212, 168, 67, 0.03));
    border-color: rgba(27, 42, 91, 0.1);
}

[data-theme="light"] .stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .doctor-card.selected {
    background: linear-gradient(135deg, rgba(27, 42, 91, 0.04), rgba(212, 168, 67, 0.03));
}

[data-theme="light"] .btn-primary {
    color: #FFFFFF;
    background: linear-gradient(135deg, #1B2A5B, #111D40);
    box-shadow: 0 2px 12px rgba(27, 42, 91, 0.15);
}

[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 6px 24px rgba(27, 42, 91, 0.25);
}

[data-theme="light"] .btn-secondary {
    background: rgba(27, 42, 91, 0.04);
    border-color: rgba(27, 42, 91, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .notification-panel {
    background: #FFFFFF;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .data-table th {
    background: rgba(27, 42, 91, 0.04);
}

[data-theme="light"] .slot-btn {
    background: #FFFFFF;
    border-color: rgba(27, 42, 91, 0.12);
}

[data-theme="light"] .form-group select option {
    background: #fff;
    color: #1a1a2e;
}

[data-theme="light"] .toast-container .toast {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .notification-badge {
    border-color: #FFFFFF;
}

[data-theme="light"] .card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

[data-theme="light"] ::-webkit-scrollbar-track { background: #E8EBF0; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #a0aec0; }

/* --- Theme Toggle Button --- */
.btn-theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(212, 168, 67, 0.06);
}

/* =============================================
   PROFILE SLIDE PANEL
   ============================================= */
.profile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    backdrop-filter: blur(4px);
    transition: opacity var(--transition-base);
}
.profile-backdrop.hidden { display: none; }

.profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.profile-panel.hidden { display: none; }
.profile-panel.open { transform: translateX(0); }

.profile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.profile-panel-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.profile-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.profile-panel-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.profile-panel-body {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Avatar Section */
.profile-avatar-section {
    text-align: center;
    padding: 32px 20px 24px;
    border-bottom: 1px solid var(--border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 auto 14px;
    letter-spacing: 1px;
    position: relative;
}
.profile-avatar.patient {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    color: var(--success);
    border: 2px solid rgba(16, 185, 129, 0.3);
}
.profile-avatar.doctor {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.15), rgba(212, 168, 67, 0.05));
    color: var(--accent);
    border: 2px solid rgba(212, 168, 67, 0.3);
}
.profile-avatar.admin {
    background: linear-gradient(135deg, rgba(44, 64, 128, 0.2), rgba(212, 168, 67, 0.1));
    color: var(--accent-light);
    border: 2px solid rgba(212, 168, 67, 0.3);
}

.profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.profile-email {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.profile-joined {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Fields — View Mode */
.profile-fields {
    padding: 16px 20px;
}
.profile-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin: 16px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.profile-section-title:first-child { margin-top: 0; }

.profile-field-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.profile-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.profile-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 55%;
    word-break: break-word;
}

/* Profile Fields — Edit Mode */
.profile-field {
    margin-bottom: 14px;
}
.profile-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.profile-field input,
.profile-field select,
.profile-field textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    outline: none;
}
.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.12);
}
.profile-field textarea {
    min-height: 70px;
    resize: vertical;
}

.profile-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Password Section */
.profile-password-section {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}
.profile-password-form {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.profile-password-form.hidden { display: none; }

/* User menu clickable */
.user-menu {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.user-menu:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Responsive */
@media (max-width: 480px) {
    .profile-panel {
        width: 100%;
    }
}
