:root {
    /* Primary palette - warm amber/gold */
    --amber-50: #fffbeb;
    --amber-100: #fef3c7;
    --amber-200: #fde68a;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --amber-700: #b45309;
    
    /* Secondary palette - sky blue */
    --teal-50: #f0f9ff;
    --teal-100: #e0f2fe;
    --teal-200: #bae6fd;
    --teal-500: #2dd4bf;
    --teal-600: #14b8a6;
    --teal-700: #0d9488;
    --teal-800: #075985;
    --teal-900: #0c4a6e;
    
    /* Neutrals - warm gray */
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-300: #d6d3d1;
    --stone-400: #a8a29e;
    --stone-500: #78716c;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-800: #292524;
    --stone-900: #1c1917;
    
    /* Accent colors */
    --coral-500: #f97316;
    --rose-500: #f43f5e;
    --rose-600: #e11d48;
    --violet-50: #f5f3ff;
    --violet-100: #ede9fe;
    --violet-300: #c4b5fd;
    --violet-500: #8b5cf6;
    --violet-700: #6d28d9;
    --emerald-500: #10b981;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 40px rgba(251, 191, 36, 0.15);
    
    /* Typography */
    --font-display: 'Fraunces', serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    
    /* Orange accent */
    --orange: #f97316;
    --orange-light: #fed7aa;
    
    /* Surface & semantic */
    --surface: #ffffff;
    --red-500: #ef4444;
}


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

html {
    overflow-x: hidden;
    min-height: 100%;
    min-height: -webkit-fill-available; /* older iOS */
    scroll-padding-top: 80px; /* Account for fixed nav */
    scroll-snap-type: y proximity; /* proximity instead of mandatory for smoother control */
    scroll-behavior: smooth;
}

body { 
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--stone-800);
    background: var(--stone-100);
    min-height: 100vh;
    min-height: 100dvh; /* iOS Safari: excludes browser chrome */
    /* iOS safe areas - removed bottom to prevent white bar */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Allow text selection in interactive and content areas */
.modal-content, .info-box, input, textarea, .detail-value,
.fullscreen-content-wrapper, a, p, .student-name-large,
.family-code-display, .lesson-list-time, .lesson-list-duration,
.detail-label, .swap-trade-slot, .payment-row-detail,
.payment-row-name, .invoice-preview {
    -webkit-user-select: text;
    user-select: text;
}
/* Buttons and interactive controls stay non-selectable */
button, .btn, .modal-btn, .dashboard-card-label,
.tab-bar, .week-nav, .control-bar {
    -webkit-user-select: none;
    user-select: none;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ===== LOGIN SCREEN ===== */
#loginScreen {
    height: 100vh;
    height: 100dvh; /* iOS Safari */
    min-height: -webkit-fill-available; /* older iOS */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 1rem;
    background: #1c1917;
    position: relative;
    overflow: hidden;
}

#loginScreen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.unsplash.com/photo-1552422535-c45813c61732?w=1920&q=80') center/cover no-repeat;
    filter: grayscale(0);
    opacity: 0.80;
    z-index: 0;
}

#loginScreen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(28, 25, 23, 0.5) 100%);
    z-index: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.login-logo .bird-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes datePulseTeal {
    0% { color: inherit; }
    50% { color: #14b8a6; }
    100% { color: inherit; }
}

@keyframes datePulseOrange {
    0% { color: inherit; }
    50% { color: #f97316; }
    100% { color: inherit; }
}

.date-pulse-teal .day-date {
    animation: datePulseTeal 0.6s ease-in-out;
}

.date-pulse-orange .day-date {
    animation: datePulseOrange 0.6s ease-in-out;
}

@keyframes cardShine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.dashboard-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.dashboard-card:hover::after {
    left: 100%;
}

.login-logo h1 {
    font-size: 2.5rem;
    background: var(--teal-600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: var(--stone-500);
    font-size: 0.95rem;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn-primary {
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.login-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.login-btn-secondary {
    background: var(--orange);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.login-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.75rem 0;
    gap: 1rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent);
}

.login-divider span {
    color: var(--stone-600);
    font-size: 0.85rem;
    font-weight: 600;
}

.login-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0.1em;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    color: var(--stone-900);
}

.login-input:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
    background: rgba(255, 255, 255, 0.8);
}

.login-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: var(--stone-500);
}

/* Auth fields (Supabase teacher sign-in modal): mirrors the app's .form-input
   styling — warm stone border, teal focus glow — with room for the eye toggle. */
.auth-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--stone-200);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--stone-800);
    background: #fff;
    transition: all 0.2s ease;
    margin-bottom: 0.9rem;
}
.auth-input::placeholder { color: var(--stone-400); }
.auth-input:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}
.auth-input-wrap {
    position: relative;
    margin-bottom: 0.9rem;
}
.auth-input-wrap .auth-input {
    padding-right: 2.75rem; /* room for the eye button */
    margin-bottom: 0;
}
.auth-eye {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--stone-400);
    padding: 0 6px;
    height: 2rem;
    display: flex;
    align-items: center;
    line-height: 0;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.auth-eye:hover { color: var(--teal-700); background: var(--stone-100); }

.login-help {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.login-help p {
    color: var(--stone-600);
    font-size: 0.875rem;
}

#loginScreen .form-label {
    color: var(--stone-700);
    font-weight: 600;
}



/* ===== TEACHER DASHBOARD ===== */
#teacherDashboard {
    height: 100vh;
    height: 100dvh; /* iOS Safari */
    padding: 2rem;
    background: #1c1917;
    position: relative;
    overflow: hidden;
}

#teacherDashboard::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.pexels.com/photos/210764/pexels-photo-210764.jpeg?auto=compress&cs=tinysrgb&w=1920') center/cover no-repeat;
    filter: grayscale(1);
    opacity: 1;
    z-index: 0;
}

#teacherDashboard::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(28, 25, 23, 0.7) 100%);
    z-index: 0;
}



#fullScreenView {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1c1917;
    padding: 2rem;
    overflow: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

#fullScreenView::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('https://images.pexels.com/photos/210764/pexels-photo-210764.jpeg?auto=compress&cs=tinysrgb&w=1920') center/cover no-repeat;
    filter: grayscale(1);
    opacity: 1;
    z-index: 0;
}

#fullScreenView::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(28, 25, 23, 0.7) 100%);
    z-index: 0;
}



#fullScreenContent {
    position: relative;
    z-index: 1;
    overflow-y: auto;
    flex: 1;
    padding: 0 0 2rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#fullScreenContent::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.fullscreen-header {
    max-width: 1000px;
    margin: 0 auto 2rem;
    text-align: center;
}

.fullscreen-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.fullscreen-content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-height: 200px;
}

#fullScreenContentArea {
    min-height: auto;
}


.dashboard-container {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    max-height: 100vh;
    overflow-y: auto;
    padding-bottom: 2rem;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

.dashboard-title {
    font-size: 2.2rem;
    background: var(--teal-500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.25rem 0;
}

.dashboard-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 1rem;
    font-weight: 500;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 240px;
    margin: 0 auto;
}

@media (max-width: 520px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: white;
    border-radius: 20px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}


.dashboard-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,0.16);
}


.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    border-radius: 20px 20px 0 0;
}

.dashboard-card-schedule::before { 
    background: linear-gradient(90deg, #14b8a6 0%, #06b6d4 100%);
}
.dashboard-card-schedule:hover { 
    border-color: #06b6d4;
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
}

.dashboard-card-students::before { 
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
}
.dashboard-card-students:hover { 
    border-color: var(--orange); 
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}


.dashboard-card-payments::before { 
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}
.dashboard-card-payments:hover { 
    border-color: var(--violet-300); 
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}
.dashboard-card-swaps::before { background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%); }
.dashboard-card-swaps:hover { border-color: var(--violet-300); background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%); }
.dashboard-card-reschedules::before { background: var(--stone-500); }
.dashboard-card-reschedules:hover { border-color: var(--stone-400); }
.dashboard-card-inquiries::before { background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%); }
.dashboard-card-inquiries:hover { border-color: #38bdf8; background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%); }
.dashboard-card-blocks::before { background: linear-gradient(90deg, var(--stone-400), var(--stone-500)); }
.dashboard-card-blocks:hover { border-color: var(--stone-300); }



.dashboard-card-profile::before { 
    background: linear-gradient(90deg, #e11d48 0%, #f43f5e 100%);
}
.dashboard-card-profile:hover { 
    border-color: #f43f5e; 
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
}
.dashboard-card-profile .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.15) 0%, rgba(244, 63, 94, 0.15) 100%);
    color: #e11d48;
}
.dashboard-card-profile:hover .dashboard-card-icon {
    background: white;
    color: #e11d48;
}

.dashboard-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.dashboard-card-icon svg {
    width: 22px;
    height: 22px;
}

.dashboard-card-schedule .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    color: var(--teal-600);
}

.dashboard-card-schedule:hover .dashboard-card-icon {
    background: white;
    color: var(--teal-600);
}

.dashboard-card-students .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15) 0%, rgba(251, 146, 60, 0.15) 100%);
    color: var(--orange);
}

.dashboard-card-students:hover .dashboard-card-icon {
    background: white;
    color: var(--orange);
}

.dashboard-card-payments .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
    color: var(--violet-500);
}

.dashboard-card-payments:hover .dashboard-card-icon {
    background: white;
    color: var(--violet-500);
}

.dashboard-card-inquiries .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(56, 189, 248, 0.15) 100%);
    color: #0ea5e9;
}
.dashboard-card-inquiries:hover .dashboard-card-icon {
    background: white;
    color: #0ea5e9;
}

.dashboard-card-swaps .dashboard-card-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
    color: #8b5cf6;
}
.dashboard-card-swaps:hover .dashboard-card-icon {
    background: white;
    color: #8b5cf6;
}

.dashboard-card:hover .dashboard-card-icon {
    transform: scale(1.1) rotate(5deg);
}

.dashboard-card-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--stone-800);
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
    word-wrap: break-word;
    transition: color 0.3s ease;
}


.dashboard-card:hover .dashboard-card-label {
    color: white;
}

.dashboard-card-desc {
    font-size: 0.75rem;
    color: var(--stone-500);
    line-height: 1.3;
    word-wrap: break-word;
    flex-grow: 1;
    transition: color 0.3s ease;
}


.dashboard-card:hover .dashboard-card-desc {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-card-stat {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal-600);
    min-height: 1.2em;
    transition: all 0.3s ease;
}

.dashboard-card-schedule .dashboard-card-stat {
    color: var(--teal-600);
}


.dashboard-card-students .dashboard-card-stat {
    color: var(--orange);
}


.dashboard-card-payments .dashboard-card-stat {
    color: var(--violet-500);
}

.dashboard-card-inquiries .dashboard-card-stat { color: #0ea5e9; }
.dashboard-card-swaps .dashboard-card-stat { color: #8b5cf6; }
.dashboard-card-profile .dashboard-card-stat { color: #e11d48; }


.dashboard-card:hover .dashboard-card-stat {
    color: white;
    border-top-color: rgba(255, 255, 255, 0.2);
}

.dashboard-card:hover .dashboard-card-stat .stat-alert {
    color: white;
}


.dashboard-card-stat .stat-alert {
    color: var(--violet-500);
    font-weight: 700;
}


.dashboard-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: none;
}


.dashboard-logout {
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.dashboard-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.dashboard-logout:active {
    transform: translateY(0);
}


/* ===== MAIN APP LAYOUT ===== */
#mainApp {
    display: none;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* iOS Safari */
    overflow: hidden;
    background: #1c1917;
    position: relative;
}

#mainApp::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('https://images.pexels.com/photos/210764/pexels-photo-210764.jpeg?auto=compress&cs=tinysrgb&w=1920') center/cover no-repeat;
    filter: grayscale(1);
    opacity: 1;
    z-index: 0;
}

#mainApp::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(28, 25, 23, 0.7) 100%);
    z-index: 0;
}

#mainApp.active {
    display: flex;
}



/* ===== HEADER ===== */
.app-header {
    background: white;
    border-bottom: 1px solid var(--stone-200);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
}

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

/* Hide header-top in teacher mode */
body.teacher-mode .header-top {
    display: none;
}

/* Hide header-top in student mode too */
body.student-mode .header-top {
    display: none;
}

/* Show teacher back button in teacher mode */
body.teacher-mode #teacherBackBtn {
    display: flex !important;
}

/* Show student logout button in student mode */
body.student-mode #studentLogoutBtn {
    display: flex !important;
}

/* Show student info badge in student mode */
body.student-mode #studentInfoBadge {
    display: flex !important;
}

/* Remove margin from teacher controls when header-top is hidden */
body.teacher-mode #teacherControls {
    margin-bottom: 0;
}

/* Remove margin from student controls when header-top is hidden */
body.student-mode #studentControls {
    margin-bottom: 0;
}

/* ===== STUDENT DASHBOARD ===== */
#studentDashboard {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #1c1917;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#studentDashboard::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('https://images.pexels.com/photos/210764/pexels-photo-210764.jpeg?auto=compress&cs=tinysrgb&w=1920') center/cover no-repeat;
    filter: grayscale(1) brightness(0.45);
    opacity: 1;
    z-index: 0;
}

#studentDashboard::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(28, 25, 23, 0.3) 30%, rgba(28, 25, 23, 0.8) 100%);
    z-index: 0;
}



.student-dash-inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
    position: relative;
    z-index: 1;
}

.student-dash-greeting {
    margin-bottom: 2rem;
    text-align: center;
}

.student-dash-greeting h1 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.4);
}


.student-dash-greeting p {
    font-size: 1.05rem;
    color: #d6d3d1;
    font-weight: 400;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.student-dash-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.student-dash-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    padding: 1.4rem 1.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}


.student-dash-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 5px;
}

.student-dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.student-dash-card:active {
    transform: translateY(0);
}

.student-dash-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.student-dash-card-icon svg {
    width: 24px;
    height: 24px;
}

.student-dash-card-text h3 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--stone-800);
    margin-bottom: 0.2rem;
}


.student-dash-card-text p {
    font-size: 0.85rem;
    color: var(--stone-500);
    line-height: 1.4;
}

/* Swap card - teal */
.student-dash-card-swap::before { background: linear-gradient(180deg, #14b8a6, #06b6d4); }
.student-dash-card-swap .student-dash-card-icon {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(6, 182, 212, 0.15));
    color: var(--teal-600);
}
.student-dash-card-swap:hover {
    border-color: #06b6d4;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(6, 182, 212, 0.15)), rgba(255, 255, 255, 0.92);
}
.student-dash-card-swap:hover .student-dash-card-icon {
    background: linear-gradient(135deg, var(--teal-500), var(--teal-600));
    color: white;
}

/* Admin card - violet */
.student-dash-card-admin::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.student-dash-card-admin .student-dash-card-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(167, 139, 250, 0.15));
    color: var(--violet-500);
}
.student-dash-card-admin:hover {
    border-color: var(--violet-300);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(167, 139, 250, 0.15)), rgba(255, 255, 255, 0.92);
}
.student-dash-card-admin:hover .student-dash-card-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

/* Lessons card - orange */
.student-dash-card-lessons::before { background: linear-gradient(180deg, #f97316, #fb923c); }
.student-dash-card-lessons .student-dash-card-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(251, 146, 60, 0.15));
    color: var(--orange);
}
.student-dash-card-lessons:hover {
    border-color: var(--orange);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(251, 146, 60, 0.15)), rgba(255, 255, 255, 0.92);
}
.student-dash-card-lessons:hover .student-dash-card-icon {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
}


.student-dash-logout {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.student-dash-logout button {
    width: 44px;
    height: 44px;
    padding: 0;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
    font-family: var(--font-body);
}

.student-dash-logout button svg {
    stroke: white;
    transition: stroke 0.2s ease;
}

.student-dash-logout button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
    color: white;
}

.student-dash-logout button:hover svg {
    stroke: white;
}

/* ── Next lesson hero card ─────────────────────────────────── */
.sdash-next-lesson {
    background: rgba(255,255,255,0.97);
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 1.5rem 1.6rem 1.3rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}
.sdash-next-lesson::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #14b8a6, #0d9488);
}
.sdash-next-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-600);
    margin-bottom: 0.4rem;
}
.sdash-next-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--stone-800);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}
.sdash-next-meta {
    font-size: 0.85rem;
    color: var(--stone-500);
    margin-bottom: 1.1rem;
}
.sdash-next-actions { display: flex; gap: 0.6rem; }
.sdash-action-primary {
    flex: 1;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
    color: white; border: none; border-radius: 12px;
    font-size: 0.88rem; font-weight: 700; cursor: pointer;
    font-family: var(--font-body); transition: all 0.2s;
}
.sdash-action-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.sdash-action-primary:active { transform: translateY(0); }

/* ── Three-action button row on dashboard next-lesson card ── */
.sdash-action-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.sdash-action-btn {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.6rem 0.5rem;
    border-radius: 12px;
    border: 1.5px solid;
    background: white;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}
.sdash-action-btn-icon {
    font-size: 18px;
    line-height: 1;
}
.sdash-action-btn-label {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}
.sdash-action-btn-sub {
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.75;
}
/* Reschedule — teal */
.sdash-btn-reschedule {
    border-color: rgba(20,184,166,0.4);
    color: var(--teal-700);
}
.sdash-btn-reschedule:hover { background: #f0fdfa; border-color: var(--teal-400); }
/* Swap — purple */
.sdash-btn-swap {
    border-color: rgba(139,92,246,0.35);
    color: #6d28d9;
}
.sdash-btn-swap:hover { background: #f5f3ff; border-color: #8b5cf6; }
/* Release — amber */
.sdash-btn-release {
    border-color: rgba(180,135,50,0.35);
    color: #92400e;
}
.sdash-btn-release:hover { background: #fffbeb; border-color: #d97706; }
/* Disabled state */
.sdash-action-btn:disabled,
.sdash-action-btn.disabled {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Lesson action bottom sheet ──────────────────────────── */
.lesson-action-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 300;
    display: flex; align-items: flex-end;
}
.lesson-action-sheet {
    width: 100%; max-width: 560px;
    margin: 0 auto;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 1rem 1.5rem 2.5rem;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    animation: slideUpSheet 0.22s ease;
}
@keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.las-handle {
    width: 36px; height: 4px;
    background: var(--stone-200);
    border-radius: 2px;
    margin: 0 auto 1.2rem;
}
.las-title {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 700;
    color: var(--stone-800);
    margin-bottom: 0.2rem;
    text-align: center;
}
.las-sub {
    font-size: 0.8rem; color: var(--stone-500);
    text-align: center; margin-bottom: 1.25rem;
}
.las-option {
    display: flex; align-items: flex-start;
    gap: 1rem; padding: 0.9rem 1rem;
    border: 1.5px solid var(--stone-200);
    border-radius: 14px; cursor: pointer;
    margin-bottom: 0.6rem;
    transition: all 0.15s; background: white;
    width: 100%; text-align: left; font-family: var(--font-body);
}
.las-option:hover { border-color: var(--teal-400); background: #f0fdfa; }
.las-option:active { transform: scale(0.99); }
.las-option.disabled {
    opacity: 0.38; cursor: not-allowed; pointer-events: none;
}
.las-option-icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 20px;
}
.las-icon-reschedule { background: rgba(20,184,166,0.12); }
.las-icon-swap       { background: rgba(139,92,246,0.12); }
.las-icon-release    { background: rgba(217,119,6,0.12); }
.las-option-body { flex: 1; }
.las-option-title {
    font-size: 0.95rem; font-weight: 700; color: var(--stone-800);
    margin-bottom: 0.15rem;
}
.las-option-desc { font-size: 0.8rem; color: var(--stone-500); line-height: 1.4; }
.las-option-tag {
    font-size: 0.68rem; font-weight: 700;
    padding: 2px 7px; border-radius: 6px;
    display: inline-block; margin-top: 0.25rem;
}
.las-tag-disabled { background: #fef3c7; color: #92400e; }
.las-tag-pending  { background: #e0f2fe; color: #075985; }
.las-close {
    width: 100%; padding: 0.7rem;
    background: none; border: 1.5px solid var(--stone-200);
    border-radius: 12px; font-size: 0.9rem; font-weight: 600;
    color: var(--stone-500); cursor: pointer;
    font-family: var(--font-body); margin-top: 0.4rem;
    transition: all 0.15s;
}
.las-close:hover { background: var(--stone-50); }

/* ── Release confirmation sheet ───────────────────────────── */
.release-reason-field {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid var(--stone-200); border-radius: 12px;
    font-size: 0.9rem; font-family: var(--font-body);
    color: var(--stone-800); resize: none; outline: none;
    transition: border-color 0.2s; box-sizing: border-box;
    margin-bottom: 0.75rem;
}
.release-reason-field:focus { border-color: var(--teal-500); }
.sdash-no-lesson {
    background: rgba(255,255,255,0.97);
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 20px;
    padding: 1.3rem 1.6rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--stone-500);
    font-size: 0.9rem;
}

.sdash-takeback-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
    background: #fffbeb;
    border: 1.5px solid rgba(217,119,6,0.3);
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}
.sdash-takeback-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(217,119,6,0.15);
}
.sdash-takeback-pulse {
    position: absolute;
    top: 8px;
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    animation: sdash-pulse 2s ease-in-out infinite;
}
@keyframes sdash-pulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
    50% { opacity: 0.7; transform: scale(1.3); box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

/* ── Status strip ──────────────────────────────────────────── */
.sdash-status {
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.sdash-status-waitlist {
    background: rgba(254,243,199,0.95);
    border: 1.5px solid rgba(180,135,50,0.35);
}
.sdash-status-swap-pending {
    background: rgba(240,253,250,0.97);
    border: 1.5px solid rgba(20,184,166,0.35);
}
.sdash-status-icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sdash-status-waitlist .sdash-status-icon { background: rgba(180,135,50,0.15); }
.sdash-status-swap-pending .sdash-status-icon { background: rgba(20,184,166,0.15); }
.sdash-status-body { flex: 1; min-width: 0; }
.sdash-status-label {
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 0.2rem;
}
.sdash-status-waitlist .sdash-status-label { color: #92400e; }
.sdash-status-swap-pending .sdash-status-label { color: var(--teal-700); }
.sdash-status-text { font-size: 0.85rem; line-height: 1.4; }
.sdash-status-waitlist .sdash-status-text { color: #78350f; }
.sdash-status-swap-pending .sdash-status-text { color: var(--teal-800); }
.sdash-status-actions { display: flex; gap: 0.5rem; margin-top: 0.65rem; flex-wrap: wrap; }
.sdash-status-btn {
    padding: 0.4rem 0.85rem; border-radius: 8px;
    font-size: 0.8rem; font-weight: 700; cursor: pointer;
    font-family: var(--font-body); border: 1.5px solid; transition: all 0.15s;
}
.sdash-status-btn-teal { background: var(--teal-600); color: white; border-color: var(--teal-700); }
.sdash-status-btn-ghost { background: transparent; color: var(--teal-700); border-color: var(--teal-300); }
.sdash-status-btn-amber { background: #d97706; color: white; border-color: #b45309; }

/* ── Inline swap request card ──────────────────────────────── */
.sdash-swap-request {
    background: rgba(255,255,255,0.97);
    border: 1.5px solid rgba(20,184,166,0.4);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
}
.sdash-swap-eyebrow {
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--teal-600); margin-bottom: 0.5rem;
}
.sdash-swap-trade { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.sdash-swap-slot {
    flex: 1; background: var(--stone-50);
    border: 1.5px solid var(--stone-200);
    border-radius: 10px; padding: 0.6rem 0.75rem; text-align: center;
}
.sdash-swap-slot-label {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--stone-400); margin-bottom: 0.25rem;
}
.sdash-swap-slot-day { font-size: 0.9rem; font-weight: 700; color: var(--stone-800); }
.sdash-swap-slot-time { font-size: 0.78rem; color: var(--stone-500); margin-top: 0.1rem; }
.sdash-swap-slot.theirs {
    border-color: rgba(20,184,166,0.4); background: rgba(240,253,250,0.6);
}
.sdash-swap-slot.theirs .sdash-swap-slot-day { color: var(--teal-700); }
.sdash-swap-arrow { color: var(--stone-400); flex-shrink: 0; }
.sdash-swap-reason {
    font-size: 0.78rem; color: var(--stone-500);
    font-style: italic; margin-bottom: 0.75rem;
    padding: 0.4rem 0.7rem; background: var(--stone-50); border-radius: 8px;
}
.sdash-swap-btns { display: flex; gap: 0.6rem; }
.sdash-swap-accept {
    flex: 1; padding: 0.65rem;
    background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
    color: white; border: none; border-radius: 10px;
    font-size: 0.88rem; font-weight: 700;
    cursor: pointer; font-family: var(--font-body); transition: all 0.2s;
}
.sdash-swap-accept:hover { opacity: 0.9; }
.sdash-swap-decline {
    flex: 1; padding: 0.65rem;
    background: #fff1f2; color: #dc2626;
    border: 1.5px solid #fca5a5; border-radius: 10px;
    font-size: 0.88rem; font-weight: 700;
    cursor: pointer; font-family: var(--font-body); transition: all 0.2s;
}
.sdash-swap-decline:hover { background: #fee2e2; }

/* ── Topbar with demoted logout ────────────────────────────── */
.sdash-topbar {
    display: flex; justify-content: flex-end; margin-bottom: 0.5rem;
}
.sdash-menu-btn {
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 10px;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; color: white;
}
.sdash-menu-btn:hover { background: rgba(255,255,255,0.25); }
.sdash-menu-dropdown {
    position: absolute; right: 1.5rem; top: 4rem;
    background: white; border: 1.5px solid var(--stone-200);
    border-radius: 12px; padding: 0.4rem;
    min-width: 140px; z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.sdash-menu-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.85rem; border-radius: 8px;
    font-size: 0.88rem; font-weight: 600; color: var(--stone-700);
    cursor: pointer; transition: background 0.15s;
}
.sdash-menu-item:hover { background: var(--stone-50); }
.sdash-menu-item.danger { color: #dc2626; }
.sdash-menu-item.danger:hover { background: #fff1f2; }

.student-dash-badge {
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-arrow-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.2);
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.back-arrow-btn svg {
    flex-shrink: 0;
}

.back-arrow-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.back-arrow-btn:active {
    transform: translateY(0);
}

/* Orange logout variant */
.back-arrow-btn.logout-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.back-arrow-btn.logout-btn:hover {
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
}



.header-brand .bird-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
}

.header-brand h1 {
    font-size: 1.5rem;
    background: var(--teal-600);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--stone-100);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-700);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--stone-100);
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--stone-200);
    color: var(--stone-800);
}

/* ===== CONTROL BAR ===== */
.control-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px; /* iOS touch target minimum */
    touch-action: manipulation;
}

/* Touch-friendly tap states */
.btn:active {
    transform: scale(0.97);
}

.btn-add {
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25);
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.btn-block {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}

.btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #fdba74 0%, #fb923c 100%);
}

.btn-block.btn-open-mode {
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}
.btn-block.btn-open-mode:hover {
    background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 100%);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}



.btn-students {
    background: white;
    color: var(--stone-800);
    border: 1px solid var(--stone-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-students:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--stone-400);
}

.btn-requests {
    background: white;
    color: var(--stone-800);
    border: 1px solid var(--stone-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.btn-requests:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--stone-400);
}

.btn-requests-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.btn-requests-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    border-color: transparent;
}

.btn-payments {
    background: white;
    color: var(--stone-800);
    border: 1px solid var(--stone-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-payments:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--stone-400);
}

.btn-print {
    background: white;
    color: var(--stone-800);
    border: 1px solid var(--stone-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-print:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--stone-400);
}

.btn-requests .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--orange);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.4);
}

.btn-swap {
    padding: 1rem 2rem;
    font-size: 1rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
    position: relative;
}

.btn-swap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-swap .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}
.btn-swap .badge.flashing {
    animation: badgeFlash 1.2s ease-in-out infinite;
}
/* Outgoing-only pending: amber clock badge, no flash */
.btn-swap .badge.pending-only {
    background: #d97706;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
    animation: none;
}
@keyframes badgeFlash {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 6px rgba(220,38,38,0.4); }
    50% { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(220,38,38,0.2), 0 2px 8px rgba(220,38,38,0.6); }
}

.btn-reschedule-student {
    padding: 1rem 2rem;
    font-size: 1rem;
    background: var(--orange);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    position: relative;
}

.btn-reschedule-student:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.week-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    position: relative;
}

.btn-nav {
    padding: 0.625rem;
    background: var(--stone-100);
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-700);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 38px;
    min-height: 38px;
}

.btn-nav svg {
    flex-shrink: 0;
}

.btn-nav span {
    line-height: 1;
}

.btn-nav:hover {
    background: var(--stone-200);
    border-color: var(--stone-300);
}

.btn-mini-cal {
    font-size: 1rem;
    padding: 0.5rem 0.65rem;
}

.btn-today {
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.btn-today:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

/* Mini month calendar */
.mini-calendar {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(28, 25, 23, 0.14), 0 2px 8px rgba(28, 25, 23, 0.08);
    padding: 0.75rem;
    width: 260px;
    user-select: none;
}

.mini-calendar.hidden {
    display: none;
}

.mini-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0 0.15rem;
}

.mini-cal-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--stone-800);
}

.mini-cal-nav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--stone-500);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.15s;
}

.mini-cal-nav:hover {
    background: var(--stone-100);
    color: var(--stone-800);
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}

.mini-cal-dow {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--stone-400);
    padding: 0.25rem 0;
    text-transform: uppercase;
}

.mini-cal-day {
    font-size: 0.75rem;
    padding: 0.3rem 0;
    border-radius: 6px;
    cursor: pointer;
    color: var(--stone-600);
    transition: all 0.12s;
    position: relative;
}

.mini-cal-day:hover {
    background: var(--teal-50);
    color: var(--teal-700);
}

.mini-cal-day.other-month {
    color: var(--stone-300);
}

.mini-cal-day.today {
    font-weight: 800;
    color: white;
    background: var(--teal-500);
}

.mini-cal-day.today:hover {
    background: var(--teal-600);
    color: white;
}

.mini-cal-day.current-week {
    background: var(--teal-50);
    color: var(--teal-700);
    font-weight: 600;
}

.mini-cal-day.current-week:hover {
    background: var(--teal-100);
}

.mini-cal-day.has-lessons::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--teal-400);
}

.mini-cal-day.today.has-lessons::after {
    background: white;
}









/* ===== FLOATING ACTION BUTTON ===== */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
    color: white;
    font-size: 1.75rem;
    font-weight: 300;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35), 0 2px 6px rgba(0,0,0,0.1);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45), 0 3px 8px rgba(0,0,0,0.12);
}

.fab:active {
    transform: scale(0.95);
}

.fab.hidden {
    display: none;
}


@media (max-width: 768px) {
    .fab {
        bottom: 1.25rem;
        right: 1.25rem;
    }
}

/* ===== MOBILE RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    /* Header adjustments */
    .app-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .app-title {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .header-controls {
        gap: 0.5rem;
    }
    
    .student-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Calendar container */
    .calendar-container {
        padding: 0.5rem;
    }
    
    .calendar-wrapper {
        border-radius: 12px;
        max-height: calc(100vh - 120px);
    }
    
    /* Calendar table - horizontal scroll */
    .calendar-table {
        min-width: 800px; /* Prevent squishing */
    }
    
    /* Time column */
    .calendar-table th:first-child,
    .calendar-table td:first-child {
        width: 60px;
        font-size: 0.7rem;
        padding: 0.25rem;
    }
    
    .calendar-table td:first-child {
        background: #1c1917;
    }
    
    /* Day columns */
    .calendar-table th:not(:first-child),
    .calendar-table td:not(:first-child) {
        width: 100px;
        min-width: 100px;
    }
    
    /* Headers */
    .calendar-table thead th {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .day-name {
        font-size: 0.75rem;
    }
    
    .day-date {
        font-size: 0.65rem;
    }
    
    /* Cells */
    .calendar-table td {
        height: 52px;
        padding: 2px;
    }
    
    /* Lesson cards */
    .lesson-card {
        font-size: 0.7rem;
        padding: 0.25rem;
        margin: 1px;
        border-radius: 4px;
    }
    
    .lesson-card-name {
        font-size: 0.7rem;
        font-weight: 600;
    }
    
    .lesson-card-time {
        font-size: 0.65rem;
    }
    
    /* Student controls */
    .student-controls {
        padding: 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .student-controls button {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .dashboard-card {
        padding: 1.25rem;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 1rem;
        padding: 1.5rem;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .modal-subtitle {
        font-size: 0.85rem;
    }
    
    .modal-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Form inputs */
    .form-input,
    .form-select {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    /* Guardian cards */
    .guardian-card {
        padding: 1rem;
    }
    
    /* Info boxes */
    .info-box {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .app-header {
        padding: 0.5rem 0.75rem;
    }
    
    .app-title {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    /* Hide week navigation text on tiny screens */
    .week-nav button span {
        display: none;
    }
    
    .week-nav button svg {
        margin: 0;
    }
    
    /* Calendar */
    .calendar-container {
        padding: 0.25rem;
    }
    
    .calendar-table {
        min-width: 700px;
    }
    
    .calendar-table th:not(:first-child),
    .calendar-table td:not(:first-child) {
        width: 85px;
        min-width: 85px;
    }
    
    .calendar-table th:first-child,
    .calendar-table td:first-child {
        width: 50px;
        font-size: 0.65rem;
    }
    
    .day-name {
        font-size: 0.7rem;
    }
    
    .day-date {
        font-size: 0.6rem;
    }
    
    .lesson-card {
        font-size: 0.65rem;
        padding: 0.2rem;
    }
    
    .lesson-card-name {
        font-size: 0.65rem;
    }
    
    .lesson-card-time {
        font-size: 0.6rem;
    }
    
    /* Modal adjustments */
    .modal-content {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-btn {
        padding: 0.65rem 0.85rem;
        font-size: 0.85rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .calendar-wrapper {
        max-height: calc(100vh - 80px);
    }
    
    .calendar-table td {
        height: 52px;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .modal-btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .lesson-card {
        min-height: 40px;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Disable hover effects on touch devices */
    .calendar-table td.drop-zone:hover {
        background: transparent;
    }
    
    .lesson-card:hover {
        transform: none;
    }
}

/* ===== CALENDAR ===== */
.calendar-container {
    flex: 1;
    padding: 1.5rem 1.5rem 0;
    overflow: hidden;
    margin-bottom: 0;
    min-height: 0;
    display: block;
    visibility: visible;
    position: relative;
    z-index: 1;
}

.calendar-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    background: #f5fffe;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.06);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    z-index: 1;
    visibility: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}

.calendar-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.calendar-wrapper::-webkit-scrollbar-track { background: transparent; }
.calendar-wrapper::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.calendar-table th:first-child,
.calendar-table td:first-child {
    width: 64px;
}

.calendar-table th.narrow-day,
.calendar-table td.narrow-day {
    width: 44px !important;
    min-width: 44px;
    max-width: 44px;
}

.calendar-table th.narrow-day {
    background: #1c1917 !important;
    opacity: 1;
    font-size: 0.7rem;
    padding: 0.5rem 0.1rem;
}

.calendar-table th.narrow-day .day-name {
    font-size: 0.6rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
}

.calendar-table th.narrow-day .day-date {
    display: none;
}

.calendar-table td.narrow-day {
    background: #e8e4de !important;
    pointer-events: none;
    border-color: rgba(0,0,0,0.05) !important;
}



body.teacher-mode .calendar-table td.narrow-day {
    pointer-events: auto;
    cursor: default;
}

body.student-mode.swap-mode-active .calendar-table td.narrow-day {
    pointer-events: auto;
}

.calendar-table th:not(:first-child),
.calendar-table td:not(:first-child) {
    /* width auto-distributed by table-layout: fixed */
}

.calendar-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #e8e4de;
    color: var(--stone-700);
    padding: 0.85rem 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-align: center;
    border-bottom: 2px solid rgba(0,0,0,0.12);
    letter-spacing: 0.01em;
}

.calendar-table th:first-child {
    background: #dedad4;
    z-index: 30;
    border-right: 1px solid rgba(0,0,0,0.1);
    position: sticky;
    left: 0;
}

.calendar-table th.today-header {
    background: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%);
    color: #0f766e;
    border-bottom: 2px solid #14b8a6;
}

.calendar-table th.past-header {
    background: #1c1917;
    color: rgba(255,255,255,0.4);
}

.day-name {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.day-date {
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 1;
    margin-top: 3px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.calendar-table th.today-header .day-date {
    display: inline-block;
    background: #14b8a6;
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    opacity: 1;
    font-weight: 700;
}

.calendar-table th.col-even {
    background: #292524;
    color: rgba(255,255,255,0.75);
}
.calendar-table th.col-odd {
    background: #1c1917;
    color: rgba(255,255,255,0.75);
}

.calendar-table td {
    border-right: 1px solid rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(0,0,0,0.15);
    vertical-align: top;
    height: 52px;
    position: relative;
    transition: background 0.12s ease;
    background: #f5fffe;
}

body.swap-mode-active .calendar-table td.drop-zone:not(.past-day):not(.narrow-day) {
    background: #f5fffe;
}


.calendar-table td:first-child {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.62rem;
    color: rgba(255,255,255,0.55);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    vertical-align: middle;
    padding: 0 6px;
    border-right: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-left: none;
    position: sticky;
    left: 0;
    z-index: 10;
    background: #1c1917;
}

.calendar-table tbody tr:nth-child(even) td:first-child {
    background: #292524;
}

.calendar-table td:first-child.current-hour {
    background: linear-gradient(180deg, #ccfbf1 0%, #99f6e4 100%) !important;
    color: #0f766e !important;
    border-right: 1px solid #14b8a6;
}

.calendar-table td.past-day {
    background: #ede9e3 !important;
    opacity: 0.7;
    cursor: default;
    pointer-events: none;
}

body.teacher-mode .calendar-table td.drop-zone:hover:not(.past-day):not(.narrow-day) {
    background: #d4f0ec !important;
}

body.teacher-mode .cell-gap:hover {
    background-color: #d4f0ec !important;
}


body.student-mode .calendar-table td.drop-zone {
    cursor: default;
}

/* Current time indicator */
.time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #14b8a6, #2dd4bf);
    z-index: 15;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(20,184,166,0.4);
}

.time-indicator-dot {
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #14b8a6;
}

/* Drag and Drop */
.calendar-table td.drag-over:not(.past-day) {
    background: rgba(20,184,166,0.1) !important;
}

.calendar-table td.drag-over:not(.past-day)::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 19px,
        rgba(20,184,166,0.15) 19px,
        rgba(20,184,166,0.15) 20px
    );
    pointer-events: none;
    z-index: 1;
}

.drop-indicator {
    position: absolute;
    left: 4px;
    right: 4px;
    height: 3px;
    background: #14b8a6;
    border-radius: 2px;
    z-index: 500;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(20,184,166,0.5);
    transition: top 0.08s ease;
}

.drop-indicator::before,
.drop-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.drop-indicator::before {
    left: -5px;
    border-width: 5px 5px 5px 0;
    border-color: transparent #14b8a6 transparent transparent;
}

.drop-indicator::after {
    right: -5px;
    border-width: 5px 0 5px 5px;
    border-color: transparent transparent transparent #14b8a6;
}

.drop-preview {
    position: absolute;
    left: 4px;
    right: 4px;
    background: rgba(20,184,166,0.15);
    border-radius: 6px;
    pointer-events: none;
    z-index: 499;
    border: 1px dashed rgba(20,184,166,0.5);
    transition: top 0.08s ease, height 0.08s ease;
}

.drop-indicator-blocked { background: #0d9488; }
.drop-indicator-blocked::before { border-color: transparent #0d9488 transparent transparent; }
.drop-indicator-blocked::after { border-color: transparent transparent transparent #0d9488; }
.drop-preview-blocked { background: rgba(13,148,136,0.1); border-color: rgba(13,148,136,0.4); }

.drop-time-tooltip {
    position: fixed;
    background: var(--stone-800);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 2000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    white-space: nowrap;
}

/* ===== LESSON SLOTS ===== */
.lesson-slot {
    position: absolute;
    left: 3px;
    right: 3px;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.68rem;
    cursor: move;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    z-index: 5;
    border-left-width: 3px !important;
    border-left-style: solid !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

.lesson-slot:hover {
    transform: translateX(1px) scale(1.01);
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.lesson-slot.dragging {
    opacity: 0.35;
    transform: scale(0.95);
    box-shadow: none;
}

.lesson-slot.drag-source {
    background: var(--stone-200) !important;
    opacity: 0.3;
}

.lesson-slot .student-name {
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-meta {
    font-size: 0.62rem;
    opacity: 0.75;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.lesson-30 { height: 26px; }
.lesson-45 { height: 39px; }
.lesson-60 { height: 52px; }

.lesson-past {
    background: #e7e5e4;
    border-left-color: #a8a29e !important;
    color: #78716c;
}

.lesson-overlap-0, .lesson-dur-color-0 {
    background: #ccfbf1;
    border-left-color: #0d9488 !important;
    color: #134e4a;
}
.lesson-overlap-1, .lesson-dur-color-1 {
    background: #fef9c3;
    border-left-color: #ca8a04 !important;
    color: #713f12;
}
.lesson-overlap-2, .lesson-dur-color-2 {
    background: #fce7f3;
    border-left-color: #db2777 !important;
    color: #831843;
}
.lesson-overlap-3, .lesson-dur-color-3 {
    background: #ede9fe;
    border-left-color: #7c3aed !important;
    color: #4c1d95;
}
.lesson-overlap-4, .lesson-dur-color-4 {
    background: #ffedd5;
    border-left-color: #ea580c !important;
    color: #7c2d12;
}
.lesson-overlap-5, .lesson-dur-color-5 {
    background: #dbeafe;
    border-left-color: #2563eb !important;
    color: #1e3a8a;
}



body.teacher-mode .lesson-slot[class*="lesson-overlap"]:hover {
    filter: brightness(0.93);
}

.lesson-slot.my-lesson,
.my-lesson {
    background: #ccfbf1 !important;
    border-left-color: #0d9488 !important;
    color: #134e4a !important;
    box-shadow: 0 0 0 1px rgba(13,148,136,0.3) !important;
}
.lesson-slot.my-lesson:hover,
.my-lesson:hover {
    filter: brightness(0.93);
}

.swap-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(240,253,250,0.97);
    border: 2px solid var(--teal-500);
    border-radius: inherit;
    padding: 6px 8px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
    box-sizing: border-box;
}
.swap-hint-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--teal-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    line-height: 1.2;
}
.swap-hint-btn {
    font-size: 0.62rem;
    font-weight: 700;
    color: white;
    background: var(--teal-600);
    border: none;
    border-radius: 5px;
    padding: 3px 8px;
    cursor: pointer;
    pointer-events: auto;
    white-space: nowrap;
}
.swap-hint-btn:hover {
    background: var(--teal-700);
}
.lesson-slot.my-lesson.swap-hint-visible .swap-hint {
    opacity: 1;
}

/* Ghost open slots — invisible by default, reveal on hover */
.open-slot-ghost {
    position: absolute;
    left: 3px;
    right: 3px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #475569;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
    overflow: hidden;
}
/* On desktop: reveal on hover */
@media (hover: hover) {
    .open-slot-ghost:hover {
        background: #ccfbf1 !important;
        border-color: #0d9488 !important;
        color: #134e4a !important;
        box-shadow: 0 0 0 2px #0d9488, 0 0 10px rgba(13,148,136,0.25) !important;
        animation: swapCompatibleHoverPulse 1.4s ease-in-out infinite;
        z-index: 10;
    }
}
/* On touch/mobile: reveal on tap */
@media (hover: none) {
    .open-slot-ghost:active {
        background: #ccfbf1 !important;
        border-color: #0d9488 !important;
        color: #134e4a !important;
        box-shadow: 0 0 0 2px #0d9488, 0 0 10px rgba(13,148,136,0.25) !important;
    }
}
@keyframes ghostPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(13,148,136,0.4), 0 0 8px rgba(13,148,136,0.2); }
    50%       { box-shadow: 0 0 0 3px rgba(13,148,136,0.7), 0 0 20px rgba(13,148,136,0.45); }
}
.open-slot-ghost.swap-selected-ghost {
    background: rgba(20,184,166,0.75) !important;
    border-color: #0f766e !important;
    box-shadow: 0 0 0 3px #0d9488, 0 0 18px rgba(13,148,136,0.5) !important;
    color: #fff !important;
}

/* Suppress cell background hover when a ghost is sitting on it */
.swap-mode-all-dim .calendar-table td.drop-zone:hover,
.swap-mode-all-dim .cell-gap:hover {
    background-color: transparent !important;
    background: transparent !important;
}

/* Instruction bubble */
.swap-instruction-bubble {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 300;
    background: #f0fdfa;
    border: 2px solid #0d9488;
    color: #0f766e;
    border-radius: 16px;
    padding: 20px 24px;
    max-width: 300px;
    width: 85vw;
    text-align: center;
    box-shadow: 0 8px 40px rgba(13,148,136,0.25);
    animation: bubbleIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translate(-50%,-50%) scale(0.85); }
    to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
.swap-instruction-bubble h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 10px;
    color: #0d9488;
}
.swap-instruction-bubble p {
    font-size: 0.85rem;
    color: #0f766e;
    margin: 0 0 6px;
    line-height: 1.5;
}
.swap-instruction-bubble p strong { color: #0d9488; }
.swap-instruction-got-it {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 10px 0;
    background: #0d9488;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.15s;
}
.swap-instruction-got-it:hover {
    background: #0f766e;
}
.swap-instruction-dontshow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #0f766e;
    cursor: pointer;
    user-select: none;
}
.swap-instruction-dontshow input[type='checkbox'] {
    width: 14px;
    height: 14px;
    accent-color: #0d9488;
    cursor: pointer;
    flex-shrink: 0;
}
.swap-instruction-overlay {
    position: fixed;
    inset: 0;
    z-index: 299;
    background: rgba(0,0,0,0.25);
}

/* Selection number badges */
.swap-selection-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0d9488;
    color: white;
    font-size: 0.62rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    pointer-events: none;
}

/* Review/Send/Confirm button in banner */
.swap-review-btn {
    background: white;
    border: none;
    color: #0f766e;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.swap-review-btn:hover { background: #f0fdf4; }

/* Selection chips in bottom sheet */
.swap-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}
.swap-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}
.swap-chip.chip-open { border-color: #86efac; background: #f0fdf4; color: #166534; }
.swap-chip.chip-swap { border-color: #99f6e4; background: #f0fdfa; color: #134e4a; }
.swap-chip-num {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0d9488;
    color: white;
    font-size: 0.62rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ===== SWAP MODE ===== */
.swap-mode-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    color: white;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 12px rgba(13,148,136,0.3);
    animation: bannerSlideIn 0.2s ease-out;
}
@keyframes bannerSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cancel — red X */
.swap-mode-cancel-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.swap-mode-cancel-btn:hover { background: #dc2626; }

/* Lesson states in swap mode */

/* Everything dims by default in swap mode */
.swap-mode-all-dim .lesson-slot:not(.swap-source):not(.swap-compatible):not(.swap-selected-lesson):not(.swap-pending-request) {
    opacity: 0.18 !important;
    pointer-events: none !important;
    cursor: default !important;
    filter: grayscale(0.6);
}
.swap-mode-all-dim .blocked-slot {
    opacity: 1 !important;
    background: repeating-linear-gradient(
        45deg,
        #f5fffe,
        #f5fffe 18px,
        rgba(0,0,0,0.05) 18px,
        rgba(0,0,0,0.05) 19px
    ) !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Student's own lesson — pulsing teal */
.lesson-slot.swap-source {
    opacity: 1 !important;
    filter: none !important;
    box-shadow: 0 0 0 3px #0d9488, 0 0 0 5px rgba(13,148,136,0.25) !important;
    animation: swapSourcePulse 1.8s ease-in-out infinite;
    z-index: 10 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}
@keyframes swapSourcePulse {
    0%, 100% { box-shadow: 0 0 0 3px #0d9488, 0 0 0 7px rgba(13,148,136,0.15); }
    50%       { box-shadow: 0 0 0 3px #0d9488, 0 0 0 11px rgba(13,148,136,0.08); }
}

/* Compatible student lesson — bold border, dark text, pulsing ring */
.lesson-slot.swap-compatible {
    opacity: 1 !important;
    filter: none !important;
    background: white !important;
    border-left-color: #0d9488 !important;
    border-left-width: 4px !important;
    color: #1c1917 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    box-shadow: 0 0 0 2px #0d9488, 0 0 0 4px rgba(13,148,136,0.2) !important;
    animation: swapCompatiblePulse 1.8s ease-in-out infinite;
    z-index: 6 !important;
    transition: background 0.15s, color 0.15s;
}
@keyframes swapCompatiblePulse {
    0%, 100% { box-shadow: 0 0 0 2px #0d9488, 0 0 0 5px rgba(13,148,136,0.15); }
    50%       { box-shadow: 0 0 0 2px #0d9488, 0 0 0 8px rgba(13,148,136,0.35); }
}
.lesson-slot.swap-compatible:hover {
    background: #ccfbf1 !important;
    border-left-color: #0d9488 !important;
    color: #134e4a !important;
    box-shadow: 0 0 0 2px #0d9488, 0 0 14px rgba(13,148,136,0.4) !important;
    animation: swapCompatibleHoverPulse 1.4s ease-in-out infinite;
    z-index: 7 !important;
}
@keyframes swapCompatibleHoverPulse {
    0%, 100% { box-shadow: 0 0 0 2px #0d9488, 0 0 8px rgba(13,148,136,0.2); }
    50%       { box-shadow: 0 0 0 2px #0d9488, 0 0 16px rgba(13,148,136,0.4); }
}

/* Selected student lesson */
.lesson-slot.swap-selected-lesson {
    opacity: 1 !important;
    filter: none !important;
    background: #ccfbf1 !important;
    border-left-color: #0d9488 !important;
    color: #134e4a !important;
    box-shadow: 0 0 0 2px #0d9488 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Already-sent pending request */
.lesson-slot.swap-pending-request {
    opacity: 0.6 !important;
    box-shadow: 0 0 0 2px #f59e0b !important;
    cursor: default !important;
    pointer-events: none !important;
}

.swap-pending-icon {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.62rem;
    font-weight: 800;
    opacity: 0.9;
    color: #92400e;
    background: rgba(253,230,138,0.85);
    border-radius: 4px;
    padding: 1px 3px;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* Pending swap trade card */
.swap-trade-card {
    background: #f0fdfa;
    border: 1.5px solid #99f6e4;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.swap-trade-card.incoming {
    background: #fffbeb;
    border-color: #fcd34d;
}
.swap-trade-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.swap-trade-slot {
    flex: 1;
    border-radius: 9px;
    padding: 7px 10px;
    border: 1.5px solid;
    min-width: 0;
}
.swap-trade-slot.mine {
    border-color: #0d9488;
    background: #ccfbf1;
}
.swap-trade-slot.theirs {
    border-color: #d1d5db;
    background: #f9fafb;
}
.swap-trade-card.incoming .swap-trade-slot.theirs {
    border-color: #f59e0b;
    background: #fef3c7;
}
.swap-trade-slot-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
    color: #6b7280;
}
.swap-trade-slot.mine .swap-trade-slot-label { color: #0f766e; }
.swap-trade-card.incoming .swap-trade-slot.theirs .swap-trade-slot-label { color: #92400e; }
.swap-trade-slot-day {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swap-trade-slot-date {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 1px;
}
.swap-trade-slot-time {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    margin-top: 2px;
}
.swap-trade-arrow {
    font-size: 1.1rem;
    color: #0d9488;
    flex-shrink: 0;
}
.swap-trade-card.incoming .swap-trade-arrow { color: #d97706; }
.swap-trade-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.swap-trade-sent {
    font-size: 0.72rem;
    color: #6b7280;
}
.swap-trade-reason {
    font-size: 0.72rem;
    color: #64748b;
    font-style: italic;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.swap-trade-cancel {
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 7px;
    background: #fee2e2;
    border: 1.5px solid #fca5a5;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.swap-trade-cancel:hover { background: #fecaca; }
.swap-trade-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.swap-trade-accept {
    padding: 5px 12px;
    border-radius: 8px;
    background: #0d9488;
    border: none;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.swap-trade-accept:hover { background: #0f766e; }
.swap-trade-decline {
    padding: 5px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.swap-trade-decline:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Close button for pending swap sheet */
.swap-sheet-close-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 11px;
    background: #f5f0e8;
    border: 1.5px solid #e0d9ce;
    border-radius: 10px;
    color: #78716c;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
}
.swap-sheet-close-btn:hover { background: #ede8df; }

/* Keep old chip cancel classes for confirmCancelSwapRequest inline confirm */
.pending-req-chip-cancel {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #fee2e2; border: none;
    color: #dc2626; font-size: 0.85rem; font-weight: 900;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* Bottom sheet */
.swap-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.15);
    padding: 20px 20px 32px;
    animation: sheetSlideUp 0.25s cubic-bezier(0.32,0.72,0,1);
    max-width: 520px;
    margin: 0 auto;
}
@keyframes sheetSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.swap-sheet-handle {
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
}
.swap-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.swap-time-compare {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.swap-time-box { flex: 1; text-align: center; }
.swap-time-label { font-size: 0.68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.swap-time-day { font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.swap-time-hour { font-size: 0.8rem; color: #64748b; margin-top: 1px; }
.swap-arrow { font-size: 1.4rem; color: #0d9488; font-weight: 900; flex-shrink: 0; }
.swap-reason-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.swap-reason-input:focus { outline: none; border-color: #0d9488; }
.swap-send-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: white;
    border: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 8px;
}
.swap-send-btn:hover { filter: brightness(1.05); }
.swap-cancel-link {
    width: 100%;
    padding: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
}
.swap-multi-note {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 10px;
}

@keyframes swapFlash {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(20,184,166,0.8); }
    12%  { transform: scale(1.07); box-shadow: 0 0 0 8px rgba(20,184,166,0.5); }
    25%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(20,184,166,0); }
    40%  { transform: scale(1.07); box-shadow: 0 0 0 8px rgba(20,184,166,0.4); }
    55%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(20,184,166,0); }
    70%  { transform: scale(1.04); box-shadow: 0 0 0 5px rgba(20,184,166,0.25); }
    85%  { transform: scale(1);    box-shadow: 0 0 0 0 rgba(20,184,166,0); }
    100% { transform: scale(1);    box-shadow: none; }
}

.lesson-slot.swap-flash {
    animation: swapFlash 3.5s ease-out;
    z-index: 50 !important;
}

/* ===== BLOCKED SLOTS ===== */
/* Generic blocked time — hatch pattern, no label */
.blocked-slot {
    position: absolute;
    left: 2px;
    right: 2px;
    z-index: 5;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 18px,
        rgba(0,0,0,0.18) 18px,
        rgba(0,0,0,0.18) 19px
    );
    border: 1px solid rgba(0,0,0,0.22);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    box-sizing: border-box;
}
body.teacher-mode .blocked-slot:hover {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 18px,
        rgba(0,0,0,0.28) 18px,
        rgba(0,0,0,0.28) 19px
    );
    border-color: rgba(0,0,0,0.35);
}

/* Named block — beige solid fill, bold label */
.named-block {
    position: absolute;
    left: 2px;
    right: 2px;
    z-index: 5;
    background: #e8e2d9;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    color: #1c1917;
    padding: 4px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.12s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    letter-spacing: 0.01em;
}
body.teacher-mode .named-block:hover {
    background: #ddd6cb;
    border-color: rgba(0,0,0,0.22);
}

/* Open slot card — lesson-card style, off-white, "Open" label in teal */
.open-slot-card {
    position: absolute;
    left: 3px;
    right: 3px;
    z-index: 5;
    background: #f8fffe;
    border-left: 3px solid var(--teal-500) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 3px 6px;
    overflow: hidden;
}
.open-slot-card:hover {
    background: #f0fdfa;
    transform: translateX(1px) scale(1.01);
    box-shadow: 0 2px 8px rgba(13,148,136,0.15);
}
.open-slot-card .open-slot-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--teal-600);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Floating pick highlight — shown on hover in swap/reschedule pick mode */
#pick-hover-highlight {
    position: absolute;
    left: 3px;
    right: 3px;
    background: #0d9488;
    border-left: 3px solid rgba(255,255,255,0.5);
    border-radius: 5px;
    pointer-events: none;
    z-index: 20;
    display: none;
    box-sizing: border-box;
}
#pick-hover-highlight .pick-hover-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    padding: 2px 5px;
    white-space: nowrap;
}

/* Hover highlight inside open slot card — reschedule pick mode */
.open-slot-hover {
    position: absolute;
    left: 0; right: 0;
    background: #0d9488;
    border-left: 3px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    pointer-events: none;
    z-index: 6;
    transition: top 0.05s, height 0.05s;
    display: none;
}
.open-slot-card.pick-mode {
    cursor: crosshair;
    background: #ecfdf5 !important;
    border-left: 3px solid var(--teal-400) !important;
    border-top: 1px dashed var(--teal-200) !important;
    border-right: 1px dashed var(--teal-200) !important;
    border-bottom: 1px dashed var(--teal-200) !important;
    box-shadow: none !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 4px !important;
}
.open-slot-card.pick-mode:hover {
    transform: none;
    box-shadow: 0 1px 6px rgba(13,148,136,0.18);
    background: #d1fae5 !important;
}
.open-slot-card.pick-mode .open-slot-label {
    display: block;
    font-size: 0.62rem;
    color: #134e4a;
    transition: color 0.15s ease;
    position: relative;
    z-index: 7;
}
.open-slot-card.pick-mode:hover .open-slot-label {
    color: #fff;
}

/* Availability blocked overlay — student view (both modes) */
.blocked-slot.availability-blocked {
    z-index: 4;
    border: none;
    background: repeating-linear-gradient(
        45deg,
        #f5fffe,
        #f5fffe 18px,
        rgba(0,0,0,0.05) 18px,
        rgba(0,0,0,0.05) 19px
    );
}



/* ===== MODAL ===== */
#modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(28, 25, 23, 0.45);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

#modal.active {
    display: flex;
}

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

/* Uniform popup close (Bucket B): stylized X-in-a-circle, same teal language as
   the back arrow. Auto-injected into every overlay modal by modal(). */
.modal-x {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
    transition: all 0.2s ease;
    z-index: 3;
}
.modal-x:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35); }

#modalContent {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 
        0 8px 32px rgba(28, 25, 23, 0.12),
        0 2px 8px rgba(28, 25, 23, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    max-width: 90vw;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem;
    animation: glassSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    margin: auto;
}

@media (min-width: 640px) {
    #modalContent {
        max-width: 600px;
    }
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--stone-900);
    margin-bottom: 1.5rem;
}

.modal-title-orange {
    color: var(--orange);
}


.modal-title-purple {
    color: var(--violet-500);
}


.modal-subtitle {
    font-size: 0.9rem;
    color: var(--stone-500);
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--stone-700);
    margin-bottom: 0.5rem;
}

.form-label-optional {
    font-weight: 400;
    color: var(--stone-400);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--stone-200);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--stone-800);
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.form-input[readonly] {
    background: var(--stone-100);
    color: var(--stone-500);
    cursor: not-allowed;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--teal-600);
    cursor: pointer;
}

.form-checkbox span {
    font-size: 0.9rem;
    color: var(--stone-700);
}

.modal-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.modal-btn:last-child {
    margin-bottom: 0;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.modal-btn-success {
    background: var(--teal-600);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.modal-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.modal-btn-warning {
    background: linear-gradient(135deg, var(--orange) 0%, #ea580c 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.3);
}

.modal-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.modal-btn-danger {
    /* Red so destructive actions read as destructive — the rose shadow below
       always assumed this; the grey background made "Yes, Delete" look like a
       neutral action. */
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: white;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.3);
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

.modal-btn-secondary {
    background: var(--stone-100);
    color: var(--stone-700);
    border: 1px solid var(--stone-200);
}

.modal-btn-secondary:hover {
    background: var(--stone-200);
}

.modal-btn-violet {
    background: var(--stone-800);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.modal-btn-violet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.modal-btn-amber {
    background: var(--orange);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.modal-btn-amber:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* Info boxes */
.info-box {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.info-box-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid var(--orange);
    color: var(--stone-800);
}

.info-box-info {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 1px solid var(--teal-600);
    color: #075985;
}

.info-box-success {
    background: linear-gradient(135deg, #d1fae5 0%, #dcfce7 100%);
    border: 1px solid var(--teal-600);
    color: #065f46;
}

.info-box-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid var(--stone-500);
    color: #9f1239;
}

/* Detail cards */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--stone-100);
}

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

.detail-label {
    color: var(--stone-500);
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 600;
    color: var(--stone-800);
    font-size: 0.875rem;
}

.recurring-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--teal-100) 0%, var(--teal-50) 100%);
    border: 1px solid var(--teal-300);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--teal-700);
    margin-top: 0.5rem;
}

/* Student list cards */
.student-card {
    padding: 1rem;
    border: 2px solid var(--stone-200);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    transition: all 0.15s ease;
}

.student-card:hover {
    border-color: var(--teal-400);
    background: var(--teal-50);
}

.student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-name-large {
    font-weight: 700;
    font-size: 1rem;
    color: var(--stone-800);
}

.student-meta {
    font-size: 0.8rem;
    color: var(--stone-500);
    margin-top: 0.25rem;
}

.student-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Profile section */
.profile-section {
    background: var(--teal-50);
    border: 1px solid var(--teal-200);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.profile-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

.profile-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: var(--stone-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--stone-400);
    font-size: 0.75rem;
    border: 3px solid white;
    box-shadow: var(--shadow-md);
}

/* Photo Upload Styles */
.photo-upload-section {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.photo-upload-preview {
    position: relative;
    flex-shrink: 0;
}

.photo-preview-img {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid var(--teal-200);
    box-shadow: var(--shadow-md);
}

.photo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    background: var(--stone-100);
    border: 2px dashed var(--stone-300);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--stone-400);
    font-size: 1.5rem;
}

.photo-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--teal-600);
    color: white;
    border: 2px solid white;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.photo-remove-btn:hover {
    background: var(--teal-700);
    transform: scale(1.1);
}

.photo-upload-controls {
    flex: 1;
    min-width: 0;
}

.family-code-display {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--stone-100);
    border: 1px solid var(--stone-300);
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--stone-800);
    letter-spacing: 0.05em;
}

/* Swap request cards */
.swap-request-card {
    background: white;
    border: 2px solid var(--orange);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.swap-arrow {
    text-align: center;
    color: var(--stone-400);
    font-size: 1.25rem;
    margin: 0.5rem 0;
}

/* Available slot cards for reschedule */
.available-slot-card {
    background: white;
    border: 2px solid var(--teal-200);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.available-slot-card:hover {
    border-color: var(--teal-500);
    background: var(--teal-50);
    transform: translateX(4px);
}

.available-slot-card:active {
    transform: scale(0.98);
}



/* Toast notification */
#toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0;
    background: linear-gradient(135deg, var(--stone-800) 0%, var(--stone-900) 100%);
    color: white;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.05);
    font-weight: 500;
    /* Above #modal (z-index 999999): toasts must stay readable when a modal
       is open — e.g. in-dialog validation errors and the "not on cloud yet"
       guards. The modal's translucent blur backdrop would otherwise dim them. */
    z-index: 1000000;
    display: none;
    min-width: 280px;
    max-width: 400px;
    overflow: hidden;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
    display: block;
}

#toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: white;
}

.toast-progress {
    height: 3px;
    background: rgba(255,255,255,0.2);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toastProgress 3s linear forwards;
}

/* Toast Types */
#toast.toast-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
#toast.toast-success .toast-icon {
    background: rgba(255,255,255,0.2);
}
#toast.toast-success .toast-progress-bar {
    background: rgba(255,255,255,0.4);
}

#toast.toast-error {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
#toast.toast-error .toast-icon {
    background: rgba(255,255,255,0.2);
}
#toast.toast-error .toast-progress-bar {
    background: rgba(255,255,255,0.4);
}

#toast.toast-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
#toast.toast-warning .toast-icon {
    background: rgba(255,255,255,0.2);
}
#toast.toast-warning .toast-progress-bar {
    background: rgba(255,255,255,0.4);
}

#toast.toast-info {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}
#toast.toast-info .toast-icon {
    background: rgba(255,255,255,0.2);
}
#toast.toast-info .toast-progress-bar {
    background: rgba(255,255,255,0.4);
}

#toast.toast-default .toast-icon {
    background: rgba(255,255,255,0.15);
}
#toast.toast-default .toast-progress-bar {
    background: rgba(255,255,255,0.3);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Mobile positioning */
@media (max-width: 480px) {
    #toast {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 5rem;
        min-width: auto;
        max-width: none;
    }
}

/* Confirm flash — teal circle with checkmark */
#confirm-flash {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    width: 72px;
    height: 72px;
    background: var(--teal-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(13,148,136,0.4);
}
#confirm-flash svg {
    width: 36px;
    height: 36px;
}
#confirm-flash.flash-in {
    animation: confirmFlash 500ms cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes confirmFlash {
    0%   { opacity: 0; transform: translate(-50%,-50%) scale(0.6); }
    30%  { opacity: 1; transform: translate(-50%,-50%) scale(1.08); }
    55%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
    80%  { opacity: 1; transform: translate(-50%,-50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(0.85); }
}

/* Section dividers */
.section-divider {
    border-top: 2px solid var(--stone-200);
    margin: 1.5rem 0;
    padding-top: 1.5rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--stone-400);
    margin-bottom: 1rem;
}

/* Guardian cards */
.guardian-card {
    background: var(--stone-50);
    border: 1px solid var(--stone-200);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

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

.guardian-header .section-title {
    margin-bottom: 0;
}

.btn-remove-guardian {
    background: var(--stone-200);
    color: var(--stone-700);
    border: none;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-remove-guardian:hover {
    background: var(--stone-300);
}

.btn-add-guardian {
    width: 100%;
    padding: 0.75rem;
    background: var(--teal-50);
    border: 2px dashed var(--teal-300);
    border-radius: 10px;
    color: var(--teal-700);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 1rem;
}

.btn-add-guardian:hover {
    background: var(--teal-100);
    border-color: var(--teal-400);
}




/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--stone-100);
}

::-webkit-scrollbar-thumb {
    background: var(--stone-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--stone-400);
}

/* Conflict list */
.conflict-list {
    background: var(--stone-100);
    border: 1px solid var(--stone-300);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.conflict-item {
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--stone-300);
}

.conflict-item:last-child {
    border-bottom: none;
}

/* Lesson list for student view */
.lesson-list-item {
    background: var(--stone-100);
    border: 2px solid var(--orange);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
    cursor: pointer;
}

.lesson-list-item:hover {
    border-color: var(--orange);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.lesson-list-time {
    font-weight: 700;
    font-size: 1rem;
    color: var(--stone-800);
}

.lesson-list-duration {
    font-size: 0.8rem;
    color: var(--stone-500);
}

/* Utility classes */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Max height scroll containers */
.scroll-container {
    max-height: 300px;
    overflow-y: auto;
}

/* Payment tracking styles */
.payment-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-stat {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    background: var(--stone-100);
}

.payment-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.payment-stat-label {
    font-size: 0.75rem;
    color: var(--stone-500);
    margin-top: 0.25rem;
}

.payment-stat.paid {
    background: rgba(16, 185, 129, 0.15);
}

.payment-stat.paid .payment-stat-value {
    color: var(--teal-600);
}

.payment-stat.unpaid {
    background: rgba(249, 115, 22, 0.12);
}

.payment-stat.unpaid .payment-stat-value {
    color: var(--orange);
}

.payment-stat.total {
    background: rgba(139, 92, 246, 0.15);
}

.payment-stat.total .payment-stat-value {
    color: var(--stone-700);
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--stone-200);
}

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

.payment-row-info {
    flex: 1;
}

.payment-row-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.payment-row-detail {
    font-size: 0.75rem;
    color: var(--stone-500);
}

.payment-row-amount {
    font-weight: 700;
    font-family: var(--font-display);
    font-size: 1rem;
    margin-right: 0.75rem;
}

.payment-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-badge.paid {
    background: var(--teal-600);
    color: white;
}

.payment-badge.unpaid {
    background: var(--orange);
    color: white;
}

.rate-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rate-input input {
    width: 100px;
    text-align: right;
}

.invoice-preview {
    background: white;
    border: 1px solid var(--stone-300);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-size: 0.875rem;
}


.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--stone-200);
}

.invoice-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.invoice-table th,
.invoice-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--stone-200);
}

.invoice-table th {
    font-weight: 600;
    background: var(--stone-100);
}

.invoice-total {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--stone-300);
}

.dashboard-card-messages::before { 
    background: var(--violet-500); 
}
.dashboard-card-messages:hover { 
    border-color: var(--violet-400); 
}
.dashboard-card-messages .dashboard-card-icon {
    color: var(--violet-600);
}
.dashboard-card-messages:hover .dashboard-card-icon {
    color: var(--violet-700);
}

.message-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--stone-50);
}

.message-sidebar {
    width: 100%;
    max-width: 380px;
    border-right: 1px solid var(--stone-200);
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.message-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--stone-50);
}

.message-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--stone-200);
    background: white;
}

.message-header h2 {
    font-size: 1.5rem;
    color: var(--stone-800);
    margin-bottom: 0.25rem;
}

.message-header-subtitle {
    color: var(--stone-500);
    font-size: 0.875rem;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.conversation-item {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
    background: var(--stone-50);
    position: relative;
}

.conversation-item:hover {
    background: var(--stone-100);
    border-color: var(--violet-200);
}

.conversation-item.active {
    background: var(--violet-50);
    border-color: var(--violet-500);
}

.conversation-item.has-unread {
    background: var(--violet-50);
    border-color: var(--violet-200);
    font-weight: 600;
}

.conversation-item.has-unread::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--violet-600);
    border-radius: 50%;
}

.conversation-name {
    font-weight: 600;
    color: var(--stone-800);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.conversation-preview {
    color: var(--stone-500);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-time {
    color: var(--stone-400);
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

.conversation-item.has-unread .conversation-preview,
.conversation-item.has-unread .conversation-name {
    color: var(--violet-800);
}

.message-thread {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-bubble {
    max-width: 65%;
    padding: 0.875rem 1.125rem;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--teal-500) 0%, var(--teal-600) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}

.message-bubble.received {
    align-self: flex-start;
    background: white;
    color: var(--stone-800);
    border: 1px solid var(--stone-200);
    border-bottom-left-radius: 4px;
}

.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.message-sender-name {
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    opacity: 0.85;
}

.msg-student-picker-item:hover { background: var(--stone-100) !important; }
.message-compose {
    padding: 1.5rem 2rem;
    background: white;
    border-top: 1px solid var(--stone-200);
}

.message-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--stone-200);
    border-radius: 24px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    transition: border-color 0.15s ease;
}

.message-input:focus {
    outline: none;
    border-color: var(--violet-500);
}

.message-send-btn {
    background: linear-gradient(135deg, var(--violet-500) 0%, var(--violet-600) 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 48px;
}

.message-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.message-send-btn:active {
    transform: translateY(0);
}

.message-empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--stone-400);
    padding: 3rem;
    text-align: center;
}

.message-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--stone-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--violet-500);
}

.message-empty-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--stone-600);
}

.message-empty-subtext {
    font-size: 0.875rem;
    color: var(--stone-400);
}

.new-message-btn {
    margin: 1rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, var(--violet-500) 0%, var(--violet-600) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.new-message-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.message-badge {
    background: var(--violet-600);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
    margin-left: 0.5rem;
}

.conversation-search {
    padding: 1rem;
    border-bottom: 1px solid var(--stone-200);
}

.conversation-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--stone-200);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.875rem;
}

.conversation-search input:focus {
    outline: none;
    border-color: var(--violet-500);
}









@media (max-width: 768px) {
    .message-sidebar {
        max-width: 100%;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .message-thread {
        padding: 1rem;
    }
}

/* =====================================================================
   PUBLIC WEBSITE / LANDING PAGE
   Ported from MelaniesmusicstudioFeb20.html (2026-06-22). Dark-mode rules
   (data-theme="dark") are inert here — the dark toggle was intentionally
   dropped (the app has no dark theme yet).
   ===================================================================== */
        #publicWebsite {
            font-family: var(--font-body);
            color: var(--stone-800);
            background: var(--stone-50);
            padding-bottom: 0;
            /* The app's body is a content-sized scroll container (fine for its
               100vh screens), which would clip this taller page. So the landing
               is its own scroll panel. */
            height: 100vh;
            overflow-y: auto;
            overflow-x: hidden;
            scroll-padding-top: 80px;   /* anchor offset for the fixed nav */
            scroll-behavior: smooth;
        }
        
        [data-theme="dark"] #publicWebsite {
            background: var(--stone-900);
            color: var(--stone-200);
        }
        
        /* --- Site Nav --- */
        .site-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 100;
            padding: 1rem 2.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-bottom: 1px solid var(--stone-200);
            transition: background 0.3s;
        }
        
        [data-theme="dark"] .site-nav {
            background: rgba(12, 10, 9, 0.85);
            border-bottom-color: rgba(255, 255, 255, 0.06);
        }
        
        .site-nav-brand {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-family: var(--font-display);
            font-weight: 800;
            font-size: 1.2rem;
            color: var(--stone-900);
            text-decoration: none;
        }
        
        .site-nav-brand svg { color: var(--teal-600); }
        
        .site-theme-toggle {
            display: none; /* Hidden - dark mode controlled by system preference on mobile only */
        }
        
        [data-theme="dark"] .site-nav-brand {
            color: var(--stone-100);
        }
        
        .site-nav-brand .bird-icon {
            display: flex;
            align-items: center;
        }
        
        .site-nav-links {
            display: flex;
            align-items: center;
            gap: 2rem;
        }
        
        .site-nav-links a {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--stone-500);
            text-decoration: none;
            transition: color 0.2s;
            letter-spacing: 0.01em;
        }
        
        .site-nav-links a:hover {
            color: var(--stone-900);
        }
        
        [data-theme="dark"] .site-nav-links a { color: rgba(255, 255, 255, 0.6); }
        [data-theme="dark"] .site-nav-links a:hover {
            color: white;
        }
        
        .site-portal-btn {
            padding: 0.55rem 1.3rem;
            background: var(--teal-600);
            color: white;
            border: none;
            border-radius: 8px;
            font-family: var(--font-body);
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        
        .site-portal-btn:hover {
            background: var(--teal-700);
            transform: translateY(-1px);
        }
        
        /* --- Hero --- */
        .site-hero {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 8rem 2rem 6rem;
            position: relative;
            overflow: hidden;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            scroll-snap-align: start;
            scroll-snap-stop: always;
        }
        
        .site-hero::before {
            content: '';
            position: absolute;
            inset: 0;
            background: url('https://images.pexels.com/photos/210764/pexels-photo-210764.jpeg?auto=compress&cs=tinysrgb&w=1920') center center / cover no-repeat;
            opacity: 0.7;
            filter: brightness(1.05);
            pointer-events: none;
        }
        
        [data-theme="dark"] .site-hero::before {
            opacity: 0.4;
            filter: brightness(0.85);
        }
        
        .site-hero::after {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
        }
        
        @keyframes floatNotes {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
        }
        
        .site-hero-content {
            max-width: 720px;
            text-align: center;
            position: relative;
            z-index: 1;
        }
        
        .site-hero-badge {
            display: inline-block;
            padding: 0.5rem 0;
            background: none;
            border: none;
            font-family: var(--font-display);
            font-size: 1.5rem;
            font-weight: 700;
            color: #f97316;
            margin-top: 2.5rem;
            margin-bottom: 0;
            letter-spacing: -0.01em;
        }
        
        [data-theme="dark"] .site-hero-badge {
            color: #fb923c;
            border-color: rgba(251, 146, 60, 0.35);
        }
        
        .site-hero h1 {
            font-family: var(--font-display);
            font-size: clamp(2.8rem, 6vw, 4.2rem);
            font-weight: 800;
            line-height: 1.1;
            color: #0c4a6e;
            margin-bottom: 1.5rem;
            letter-spacing: -0.025em;
            text-shadow: 0 2px 20px rgba(56, 189, 248, 0.1);
        }
        
        [data-theme="dark"] .site-hero h1 {
            color: white;
        }
        
        .site-hero h1 .accent {
            background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .site-hero-sub {
            font-size: 1.15rem;
            line-height: 1.7;
            color: #1e293b;
            max-width: 540px;
            margin: 0 auto 2.5rem;
            text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
            background: rgba(255, 248, 230, 0.3);
            padding: 1rem 1.5rem;
            border-radius: 12px;
            backdrop-filter: blur(8px);
        }
        
        .site-hero-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        .site-btn-primary {
            padding: 0.9rem 2rem;
            background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-family: var(--font-body);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            box-shadow: 0 4px 16px rgba(14, 165, 233, 0.25);
        }
        
        .site-btn-primary:hover {
            background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 24px rgba(20, 184, 166, 0.35);
        }
        
        .site-btn-secondary {
            padding: 0.9rem 2rem;
            background: white;
            color: #57534e;
            border: 2px solid #d6d3d1;
            border-radius: 12px;
            font-family: var(--font-body);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }
        
        .site-btn-secondary:hover {
            background: #fafaf9;
            border-color: #a8a29e;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }
        
        [data-theme="dark"] .site-btn-secondary {
            background: transparent;
            color: var(--stone-200);
            border-color: var(--stone-500);
        }
        
        /* --- Section Shared --- */
        .site-section {
            padding: 6rem 2rem 0;
            scroll-snap-align: start;
        }
        
        /* Extra bottom padding for About, Lessons, Testimonials, Contact */
        .site-about,
        .site-services,
        .site-testimonials,
        .site-cta {
            min-height: calc(100vh - 80px); /* Full viewport minus nav height */
            padding-bottom: 6rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        
        .site-section-label {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            color: #14b8a6;
            margin-bottom: 0.75rem;
        }
        
        /* Orange label for services section */
        .site-services .site-section-label {
            color: #f97316;
        }
        
        .site-section h2 {
            font-family: var(--font-display);
            font-size: clamp(1.8rem, 4vw, 2.4rem);
            font-weight: 800;
            color: var(--stone-900);
            margin-bottom: 1rem;
            letter-spacing: -0.02em;
        }
        
        [data-theme="dark"] .site-section h2 {
            color: var(--stone-50);
        }
        
        .site-section-desc {
            font-size: 1.05rem;
            line-height: 1.7;
            color: var(--stone-500);
            max-width: 560px;
        }
        
        /* --- About --- */
        .site-about {
            background: white;
        }
        
        [data-theme="dark"] .site-about {
            background: var(--stone-800);
        }
        
        .site-about-inner {
            max-width: 1100px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4rem;
            align-items: center;
        }
        
        .site-about-img {
            width: 100%;
            aspect-ratio: 1 / 1;
            background: var(--stone-100);
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            box-shadow: 0 8px 32px rgba(14, 165, 233, 0.12);
        }

        .site-about-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            display: block;
        }
        
        [data-theme="dark"] .site-about-img {
            filter: brightness(0.85);
        }
        
        .site-about-img::after {
            content: '';
            font-size: 0;
        }
        
        .site-about-text p {
            font-size: 1.05rem;
            line-height: 1.8;
            color: var(--stone-600);
            margin-bottom: 1.5rem;
        }
        
        [data-theme="dark"] .site-about-text p {
            color: var(--stone-400);
        }
        
        .site-about-text p.site-signature {
            font-family: 'Dancing Script', cursive;
            font-size: 2.2rem;
            font-weight: 700;
            line-height: 1;
            color: var(--teal-600);
            margin: 0.25rem 0 1.75rem;
        }

        .site-stat-row {
            display: flex;
            gap: 2.5rem;
            margin-top: 2rem;
        }
        
        .site-stat {
            text-align: center;
        }
        
        .site-stat-num {
            font-family: var(--font-display);
            font-size: 2rem;
            font-weight: 800;
            background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .site-stat-label {
            font-size: 0.8rem;
            color: var(--stone-500);
            margin-top: 0.15rem;
        }
        
        /* --- Services --- */
        .site-services {
            background: linear-gradient(to bottom, #FFF3DB 0%, #FFFBF0 100%);
        }
        
        [data-theme="dark"] .site-services {
            background: var(--stone-900);
        }
        
        .site-services-inner {
            max-width: 1100px;
            margin: 0 auto;
        }
        
        .site-services-header {
            text-align: center;
            margin-bottom: 3.5rem;
        }
        
        .site-services-header .site-section-desc {
            margin: 0 auto;
        }
        
        .site-services-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
        }
        
        .site-service-card {
            background: white;
            border-radius: 16px;
            padding: 2rem;
            border: 1px solid #e7e5e4;
            transition: all 0.25s;
        }
        
        .site-service-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
            border-color: #d6d3d1;
        }
        
        [data-theme="dark"] .site-service-card {
            background: var(--stone-800);
            border-color: var(--stone-700);
        }
        
        .site-service-icon {
            width: 48px;
            height: 48px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.4rem;
            margin-bottom: 1.25rem;
            background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
            color: #9a3412;
        }
        
        .site-service-card:nth-child(2) .site-service-icon { 
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); 
            color: #92400e; 
        }
        .site-service-card:nth-child(3) .site-service-icon { 
            background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); 
            color: #9a3412; 
        }
        
        .site-service-card h3 {
            font-family: var(--font-display);
            font-weight: 700;
            font-size: 1.1rem;
            color: var(--stone-800);
            margin-bottom: 0.6rem;
        }
        
        [data-theme="dark"] .site-service-card h3 {
            color: var(--stone-100);
        }
        
        .site-service-card p {
            font-size: 0.9rem;
            line-height: 1.65;
            color: var(--stone-500);
        }
        
        .site-service-price {
            margin-top: 1.25rem;
            padding-top: 1rem;
            border-top: 1px solid var(--stone-200);
            font-family: var(--font-display);
            font-weight: 700;
            font-size: 1.2rem;
            color: var(--stone-900);
        }
        
        [data-theme="dark"] .site-service-price { border-top-color: var(--stone-700); }
        
        .site-service-price span {
            font-size: 0.8rem;
            font-weight: 400;
            color: var(--stone-400);
        }
        
        /* --- Testimonials --- */
        .site-testimonials {
            background: white;
        }
        
        [data-theme="dark"] .site-testimonials {
            background: var(--stone-800);
        }
        
        .site-testimonials-inner {
            max-width: 1100px;
            margin: 0 auto;
        }
        
        .site-testimonials-header {
            text-align: center;
            margin-bottom: 3rem;
        }
        
        .site-testimonials-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.5rem;
        }
        
        .site-testimonial-card {
            background: linear-gradient(to bottom, #f0f9ff 0%, white 100%);
            border-radius: 16px;
            padding: 2rem;
            border: 1px solid #bae6fd;
            box-shadow: 0 4px 16px rgba(14, 165, 233, 0.08);
        }
        
        [data-theme="dark"] .site-testimonial-card {
            background: var(--stone-700);
        }
        
        .site-testimonial-stars {
            display: flex;
            gap: 2px;
            color: #2dd4bf;
            font-size: 0.9rem;
            margin-bottom: 1rem;
        }
        
        .site-testimonial-card blockquote {
            font-size: 0.95rem;
            line-height: 1.7;
            color: var(--stone-600);
            font-style: italic;
            margin-bottom: 1.25rem;
        }
        
        [data-theme="dark"] .site-testimonial-card blockquote {
            color: var(--stone-300);
        }
        
        .site-testimonial-author {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }
        
        .site-testimonial-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #5eead4 0%, #2dd4bf 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            color: white;
            font-weight: 700;
        }
        
        .site-testimonial-card:nth-child(2) .site-testimonial-avatar { 
            background: linear-gradient(135deg, #7dd3fc 0%, #38bdf8 100%); 
        }
        .site-testimonial-card:nth-child(3) .site-testimonial-avatar { 
            background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); 
        }
        
        .site-testimonial-name {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--stone-800);
        }
        
        [data-theme="dark"] .site-testimonial-name {
            color: var(--stone-100);
        }
        
        .site-testimonial-detail {
            font-size: 0.75rem;
            color: var(--stone-400);
        }
        
        /* --- CTA --- */
        .site-cta {
            /* Single piano photo with a light dark scrim so the white text stays readable. */
            background: linear-gradient(rgba(28, 25, 23, 0.5), rgba(28, 25, 23, 0.7)), url('https://images.pexels.com/photos/1246437/pexels-photo-1246437.jpeg?auto=compress&cs=tinysrgb&w=1200') center center / cover no-repeat;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .site-cta-inner {
            max-width: 600px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
        }
        
        .site-cta h2 {
            color: white;
            margin-bottom: 1rem;
        }
        
        .site-cta p {
            color: var(--stone-400);
            font-size: 1.05rem;
            line-height: 1.7;
            margin-bottom: 2rem;
        }
        
        .site-cta .site-btn-primary {
            margin: 0 auto;
        }
        
        /* --- Mobile floating nav (Option C): hidden on desktop --- */
        #mobileNavFab, .mnav-menu-panel { display: none; }

        /* --- Footer --- */
        /* --- Responsive --- */
        @media (max-width: 768px) {
            .site-nav-links { display: none; }   /* header links replaced by the floating controls below */
            .site-about-inner { grid-template-columns: 1fr; gap: 2rem; }
            .site-services-grid { grid-template-columns: 1fr; }
            .site-testimonials-grid { grid-template-columns: 1fr; }
            .site-hero { padding: 5rem 1.5rem 4rem; }

            /* Compact header that auto-hides ~1.2s after load (JS toggles .site-nav--hidden) */
            .site-nav { padding: 0.7rem 1.1rem; }
            .site-nav-brand { font-size: 1.05rem; }
            .site-nav--hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-120%); }

            /* Floating ☰ + Student Portal controls (live inside #publicWebsite, so they
               only show on the landing, not the login/app screens). */
            #mobileNavFab { display: flex; justify-content: space-between; align-items: center; position: fixed; top: 0.8rem; left: 0.8rem; right: 0.8rem; z-index: 200; pointer-events: none; }
            .mnav-fab-btn { pointer-events: auto; border: none; cursor: pointer; font-family: var(--font-body); display: flex; align-items: center; gap: 0.4rem; height: 44px; border-radius: 999px; box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
            .mnav-menu { width: 44px; justify-content: center; background: rgba(255,255,255,0.95); color: var(--stone-700); }
            .mnav-portal { padding: 0 1.1rem; background: var(--teal-600); color: white; font-weight: 600; font-size: 0.85rem; }
            .mnav-portal svg { width: 16px; height: 16px; }

            /* Menu opened by the ☰ button */
            .mnav-menu-panel.open { display: block; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.3); }
            .mnav-menu-card { position: absolute; top: 4rem; left: 0.8rem; background: white; border-radius: 14px; padding: 0.4rem; box-shadow: 0 14px 44px rgba(0,0,0,0.25); display: flex; flex-direction: column; min-width: 180px; max-height: calc(100vh - 5.5rem); overflow-y: auto; -webkit-overflow-scrolling: touch; }
            .mnav-menu-card a { padding: 0.85rem 1rem; color: var(--stone-800); text-decoration: none; font-weight: 600; font-size: 0.98rem; border-radius: 9px; }
            .mnav-menu-card a:active { background: var(--stone-100); }
        }
        
        /* --- Entrance animations --- */
        @keyframes site-fade-up {
            from { opacity: 0; transform: translateY(24px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .site-anim {
            animation: site-fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
        }
        
        .site-anim-d1 { animation-delay: 0.1s; }
        .site-anim-d2 { animation-delay: 0.2s; }
        .site-anim-d3 { animation-delay: 0.3s; }
        .site-anim-d4 { animation-delay: 0.4s; }

        /* ===== Resources dropdown (desktop nav, click-toggle) ===== */
        .site-nav-dd { position: relative; display: inline-flex; align-items: center; }
        .site-nav-dd-trigger {
            display: inline-flex; align-items: center;
            background: none; border: none; padding: 0; margin: 0;
            font-family: var(--font-body);
            font-size: 0.85rem; font-weight: 500; color: var(--stone-500);
            text-decoration: none; cursor: pointer; letter-spacing: 0.01em;
            transition: color 0.2s;
        }
        .site-nav-dd-trigger svg { margin-left: 4px; transition: transform 0.2s ease; }
        .site-nav-dd-trigger:hover { color: var(--stone-900); }
        .site-nav-dd.open .site-nav-dd-trigger { color: var(--stone-900); }
        .site-nav-dd.open .site-nav-dd-trigger svg { transform: rotate(180deg); }
        .site-nav-dd-menu {
            position: absolute; top: 100%; right: 0;
            padding-top: 0.6rem;                 /* small gap below the trigger */
            min-width: 250px; z-index: 60;
            opacity: 0; visibility: hidden; transform: translateY(6px);
            transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
        }
        .site-nav-dd.open .site-nav-dd-menu { opacity: 1; visibility: visible; transform: translateY(0); }
        .site-nav-dd-panel {
            background: #fff; border: 1px solid var(--stone-200);
            border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.14);
            padding: 0.6rem 0.5rem;
        }
        .site-nav-dd-group { padding: 0.15rem 0.15rem; }
        .site-nav-dd-group + .site-nav-dd-group {
            margin-top: 0.5rem; padding-top: 0.6rem; border-top: 1px solid var(--stone-100);
        }
        .site-nav-dd-label {
            display: block; font-family: var(--font-body);
            font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
            text-transform: uppercase; color: var(--stone-400);
            padding: 0 0.65rem; margin-bottom: 0.25rem;
        }
        .site-nav-dd-menu a {
            display: block; padding: 0.5rem 0.65rem; border-radius: 9px;
            font-size: 0.9rem; font-weight: 500; color: var(--stone-700);
            text-decoration: none; white-space: nowrap; transition: background 0.15s, color 0.15s;
        }
        .site-nav-dd-menu a:hover { background: var(--stone-100); color: var(--teal-700); }

        /* ===== Key Dates pop-up "Back to main" arrow ===== */
        .kd-back {
            display: inline-flex; align-items: center; gap: 0.35rem;
            background: none; border: none; padding: 0.25rem 0.1rem; margin-bottom: 0.4rem;
            font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
            color: var(--teal-700); cursor: pointer; transition: color 0.15s, transform 0.15s;
        }
        .kd-back:hover { color: var(--teal-600); transform: translateX(-2px); }

        /* ===== Key Dates list (used in the pop-up) ===== */
        .site-keydates-inner { max-width: 760px; margin: 0 auto; width: 100%; }
        .site-keydates-list { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1rem; }
        .site-keydate {
            display: flex; align-items: stretch; gap: 1.25rem;
            background: #fff; border: 1px solid var(--stone-200);
            border-radius: 16px; padding: 1.1rem 1.35rem;
            box-shadow: 0 2px 12px rgba(0,0,0,0.04);
        }
        .site-keydate-when {
            flex: 0 0 auto; align-self: center;
            min-width: 62px; text-align: center;
            font-family: var(--font-display); font-weight: 800;
            color: #fff; padding: 0.55rem 0.5rem; border-radius: 12px;
            background: linear-gradient(135deg, var(--teal-600) 0%, var(--teal-700) 100%);
            letter-spacing: 0.02em;
        }
        .site-keydate-mon { display: block; font-size: 1rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.05em; }
        .site-keydate-day { display: block; font-size: 1.55rem; line-height: 1.05; margin-top: 2px; }
        .site-keydate-body h3 {
            font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
            color: var(--stone-800); margin: 0 0 0.25rem;
        }
        .site-keydate-body p { font-family: var(--font-body); font-size: 0.95rem; line-height: 1.55; color: var(--stone-500); margin: 0; }

        /* ===== Mobile menu: section labels for the Resources groups ===== */
        @media (max-width: 768px) {
            .mnav-menu-label {
                display: block; font-family: var(--font-body);
                font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
                text-transform: uppercase; color: var(--stone-400);
                padding: 0.7rem 1rem 0.2rem;
            }
            .site-keydate { padding: 0.95rem 1.1rem; gap: 1rem; }
        }
