/* ═══════════════════════════════════════════════════════════
   HUMMING BIRDS SCHOOL — AttendTrack
   Premium Theme: "Hummingbird Garden"
   ═══════════════════════════════════════════════════════════ */

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

/* ─── Design Tokens ───────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-lighter: #5eead4;
    --primary-dark: #0f766e;
    --primary-darker: #115e59;

    /* Accent */
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dark: #d97706;

    /* Status */
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --info: #0ea5e9;
    --info-light: #e0f2fe;

    /* Backgrounds */
    --bg-primary: #f0fdfa;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-glass: rgba(255, 255, 255, 0.7);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-on-primary: #ffffff;

    /* Borders */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
    --gradient-header: linear-gradient(135deg, #0f766e 0%, #0d9488 50%, #14b8a6 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.9) 0%, rgba(240,253,250,0.6) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-primary: 0 4px 14px rgba(13, 148, 136, 0.3);
    --shadow-accent: 0 4px 14px rgba(245, 158, 11, 0.3);
    --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.15);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

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

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(13, 148, 136, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(13, 148, 136, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition-fast);
}

a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ─── Header ──────────────────────────────────────────────── */
.app-header {
    background: var(--gradient-header);
    color: var(--text-white);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.25);
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-white);
    text-decoration: none;
}

.header-brand:hover { color: var(--text-white); }

.header-logo {
    transition: transform var(--transition-spring);
}

.header-brand:hover .header-logo {
    transform: scale(1.08) rotate(-3deg);
}

.header-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-school {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-app {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.75;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-base);
    text-decoration: none;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

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

.nav-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fecaca;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all var(--transition-base);
}

/* ─── Main Content ────────────────────────────────────────── */
.main-content {
    flex: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ─── Footer ──────────────────────────────────────────────── */
.app-footer {
    background: var(--gradient-dark);
    color: var(--text-muted);
    text-align: center;
    padding: 1.25rem;
    font-size: 0.82rem;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.app-footer p { opacity: 0.7; }

/* ─── Page Header ─────────────────────────────────────────── */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-primary);
}

.page-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.card:hover::before { opacity: 1; }

.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--border-light);
}

.card-flat:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* ─── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.05;
    transform: translate(30%, -30%);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 1.5rem;
}

.stat-icon.primary { background: var(--gradient-primary); box-shadow: var(--shadow-primary); }
.stat-icon.success { background: var(--gradient-success); }
.stat-icon.danger { background: var(--gradient-danger); }
.stat-icon.warning { background: var(--gradient-accent); }
.stat-icon.info { background: linear-gradient(135deg, #0284c7, #0ea5e9); }

.stat-info { flex: 1; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Class Grid (Attendance Selector) ────────────────────── */
.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.class-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid var(--border-light);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.class-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.class-card:hover::before { opacity: 0.04; }
.class-card:hover { color: var(--text-primary); }

.class-card .class-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.class-card .class-section {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.class-card .class-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.class-badge.marked {
    background: var(--success-light);
    color: var(--success-dark);
}

.class-badge.unmarked {
    background: var(--warning-light);
    color: var(--warning-dark);
}

/* ─── Student List (Mark Attendance) ──────────────────────── */
.student-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
    transition: all var(--transition-fast);
    gap: 12px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.student-row:active {
    transform: scale(0.99);
}

/* ─── Premium Attendance Redesign ────────────────────────── */
.student-row {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition-base);
    position: relative;
}

.student-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.student-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--border-medium);
    transition: all var(--transition-base);
}

.student-row.status-present { background: white; border-color: rgba(16, 185, 129, 0.15); }
.student-row.status-absent { background: white; border-color: rgba(239, 68, 68, 0.15); }
.student-row.status-late { background: white; border-color: rgba(245, 158, 11, 0.15); }

.student-row.status-present::before { background: var(--success); top: 10%; bottom: 10%; width: 6px; box-shadow: 2px 0 8px rgba(16, 185, 129, 0.3); }
.student-row.status-absent::before { background: var(--danger); top: 10%; bottom: 10%; width: 6px; box-shadow: 2px 0 8px rgba(239, 68, 68, 0.3); }
.student-row.status-late::before { background: var(--warning); top: 10%; bottom: 10%; width: 6px; box-shadow: 2px 0 8px rgba(245, 158, 11, 0.3); }

.student-roll {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-light);
}

.status-present .student-roll { border-color: var(--success); color: var(--success-dark); background: #f0fdf4; }
.status-absent .student-roll { border-color: var(--danger); color: var(--danger-dark); background: #fef2f2; }
.status-late .student-roll { border-color: var(--warning); color: var(--warning-dark); background: #fffbeb; }

.student-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.student-father {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.student-status-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    gap: 3px;
}

.status-btn {
    width: 50px;
    height: 44px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.status-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5px;
}

.status-btn:hover:not([class*="active-"]) {
    background: rgba(0,0,0,0.03);
    color: var(--text-secondary);
}

.status-btn.active-present { background: white; color: var(--success); box-shadow: var(--shadow-sm); }
.status-btn.active-absent { background: white; color: var(--danger); box-shadow: var(--shadow-sm); }
.status-btn.active-late { background: white; color: var(--warning); box-shadow: var(--shadow-sm); }



/* ─── Mark Attendance Summary Bar ─────────────────────────── */
.mark-summary {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
    margin: 1.5rem -1.5rem -2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 50;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.summary-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.summary-dot.present { background: var(--success); }
.summary-dot.absent { background: var(--danger); }
.summary-dot.late { background: var(--warning); }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-accent {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
    color: white;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

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

/* ─── Forms ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ─── Tables ──────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

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

.data-table thead {
    background: var(--gradient-primary);
    color: white;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.data-table tbody tr:hover {
    background: rgba(13, 148, 136, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Badges ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-info { background: var(--info-light); color: #0369a1; }
.badge-primary { background: rgba(13, 148, 136, 0.1); color: var(--primary-dark); }

/* ─── Alerts ──────────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: #0369a1;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ─── Login Page ──────────────────────────────────────────── */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--gradient-header);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 50%;
    bottom: -80px;
    left: -80px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: fadeScaleIn 0.5s ease;
}

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

.login-logo {
    margin-bottom: 1rem;
}

.login-school {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-form .form-input {
    padding: 12px 16px;
    font-size: 0.95rem;
}

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ─── Dashboard Widgets ───────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.chart-container {
    position: relative;
    height: 280px;
}

.classes-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.class-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    font-size: 0.85rem;
    transition: background var(--transition-fast);
}

.class-status-item:hover { background: var(--border-light); }

.absent-list {
    list-style: none;
    padding: 0;
}

.absent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.88rem;
}

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

.absent-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ─── Report Filters ──────────────────────────────────────── */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-row .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* ─── Search Box ──────────────────────────────────────────── */
.search-wrapper {
    position: relative;
}

.search-wrapper .form-input {
    padding-left: 40px;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results.show { display: block; }

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.search-result-item:hover { background: var(--bg-secondary); }
.search-result-item:last-child { border-bottom: none; }

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-result-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ─── Toast Notification ──────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: slideInRight 0.4s var(--transition-spring);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.toast-success { background: var(--gradient-success); }
.toast-danger { background: var(--gradient-danger); }
.toast-warning { background: var(--gradient-accent); }

.toast-exit {
    animation: slideOutRight 0.3s ease forwards;
}

/* ─── Loading Spinner ─────────────────────────────────────── */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(13, 148, 136, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2.5px;
}

.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 300;
}

.loading-text {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-dark);
}

/* ─── Empty State ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── Attendance Rate Bar ─────────────────────────────────── */
.rate-bar {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--border-light);
    overflow: hidden;
    position: relative;
}

.rate-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rate-bar-fill.low { background: var(--gradient-danger); }
.rate-bar-fill.medium { background: var(--gradient-accent); }
.rate-bar-fill.high { background: var(--gradient-success); }

/* ─── Animations ──────────────────────────────────────────── */
@keyframes fadeScaleIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

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

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.3); }
    50% { box-shadow: 0 0 0 10px rgba(13, 148, 136, 0); }
}

/* Staggered card animation */
.card[data-anim] { opacity: 0; animation: fadeScaleIn 0.4s ease forwards; }
.card[data-anim="1"] { animation-delay: 0.05s; }
.card[data-anim="2"] { animation-delay: 0.1s; }
.card[data-anim="3"] { animation-delay: 0.15s; }
.card[data-anim="4"] { animation-delay: 0.2s; }
.card[data-anim="5"] { animation-delay: 0.25s; }

.class-card { animation: fadeScaleIn 0.4s ease both; }
.class-card:nth-child(1) { animation-delay: 0.03s; }
.class-card:nth-child(2) { animation-delay: 0.06s; }
.class-card:nth-child(3) { animation-delay: 0.09s; }
.class-card:nth-child(4) { animation-delay: 0.12s; }
.class-card:nth-child(5) { animation-delay: 0.15s; }
.class-card:nth-child(6) { animation-delay: 0.18s; }
.class-card:nth-child(7) { animation-delay: 0.21s; }
.class-card:nth-child(8) { animation-delay: 0.24s; }

.student-row { animation: slideDown 0.3s ease both; }

/* ─── Date Display Banner ─────────────────────────────────── */
.date-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-primary);
}

.date-banner-text {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
}

.date-banner-icon {
    font-size: 1.5rem;
}

/* ─── Section Tags ────────────────────────────────────────── */
.section-tags {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    border: 1.5px solid var(--border-medium);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.section-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(13, 148, 136, 0.06);
}

.section-tag.marked {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success-dark);
}

/* ─── Modal System ────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: 1.5rem;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-spring);
    overflow: hidden;
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: var(--gradient-header);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 800;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.section-picker-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.section-picker-btn:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    color: var(--primary);
}

.section-picker-btn span {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.6;
    text-transform: uppercase;
}


/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner { height: 60px; }
    .header-school { font-size: 0.9rem; }
    .header-app { font-size: 0.65rem; }

    .header-nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 4px;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease;
    }

    .header-nav.show { display: flex; }

    .nav-link {
        padding: 12px 16px;
        border-radius: var(--radius-md);
        width: 100%;
    }

    .mobile-menu-btn { display: flex; }

    .main-content { padding: 1rem; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .class-grid { grid-template-columns: 1fr 1fr; }

    .filter-row {
        flex-direction: column;
    }

    .filter-row .form-group {
        min-width: 100%;
    }

    .mark-summary {
        flex-direction: column;
        text-align: center;
        margin: 1rem -1rem -1rem;
        padding: 1rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .page-title { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .class-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
}

/* ─── Print Styles ────────────────────────────────────────── */
@media print {
    .app-header, .app-footer, .filter-bar, .btn, .mark-summary, .nav-link {
        display: none !important;
    }

    .main-content {
        padding: 0;
        max-width: 100%;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .data-table thead {
        background: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body::before { display: none; }
}

/* ─── Utility Classes ─────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hidden { display: none !important; }
