/* ==========================================================================
   NAHRAIN TRAINING CENTER — DESIGN SYSTEM & STYLESHEET
   True RTL, Premium Typography, Modern Cards, Glassmorphism, Micro-interactions
   ========================================================================== */

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

:root {
    --font-arabic: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-latin: 'Outfit', sans-serif;

    /* Palette: Navy & Emerald Modern Academic Luxury */
    --primary-900: #0b1a2e;
    --primary-800: #0f2744;
    --primary-700: #153a63;
    --primary-600: #1e4d82;
    --primary-500: #2563eb;
    --primary-400: #3b82f6;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;

    --accent-emerald-700: #047857;
    --accent-emerald-600: #059669;
    --accent-emerald-500: #10b981;
    --accent-emerald-100: #d1fae5;
    --accent-emerald-50: #ecfdf5;

    --accent-gold-600: #d97706;
    --accent-gold-500: #f59e0b;
    --accent-gold-100: #fef3c7;
    --accent-gold-50: #fffbeb;

    --danger-600: #e11d48;
    --danger-500: #f43f5e;
    --danger-100: #ffe4e6;
    --danger-50: #fff1f2;

    --neutral-900: #0f172a;
    --neutral-800: #1e293b;
    --neutral-700: #334155;
    --neutral-600: #475569;
    --neutral-500: #64748b;
    --neutral-400: #94a3b8;
    --neutral-300: #cbd5e1;
    --neutral-200: #e2e8f0;
    --neutral-100: #f1f5f9;
    --neutral-50: #f8fafc;
    --white: #ffffff;

    --sidebar-width: 280px;
    --header-height: 72px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-card: 0 10px 30px -10px rgba(15, 42, 74, 0.08);

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

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    direction: rtl;
    text-align: right;
    font-family: var(--font-arabic);
    scroll-behavior: smooth;
    background-color: var(--neutral-50);
    color: var(--neutral-800);
}

body {
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

button, input, select, textarea {
    font-family: inherit;
    font-size: 0.95rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--neutral-900);
    font-weight: 700;
    line-height: 1.3;
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-primary { background: var(--primary-100); color: var(--primary-700); }
.badge-success { background: var(--accent-emerald-100); color: var(--accent-emerald-700); }
.badge-danger { background: var(--danger-100); color: var(--danger-600); }
.badge-warning { background: var(--accent-gold-100); color: var(--accent-gold-600); }
.badge-neutral { background: var(--neutral-200); color: var(--neutral-700); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(15, 39, 68, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 39, 68, 0.35);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-emerald-600), var(--accent-emerald-700));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}
.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-emerald-500), var(--accent-emerald-600));
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--white);
    color: var(--neutral-700);
    border-color: var(--neutral-200);
}
.btn-secondary:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-300);
}

.btn-danger {
    background: var(--danger-600);
    color: var(--white);
}
.btn-danger:hover {
    background: var(--danger-500);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

/* Card Component */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--neutral-300);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--neutral-900);
    background-color: var(--white);
    border: 1.5px solid var(--neutral-200);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.form-control::placeholder {
    color: var(--neutral-400);
}

.form-error {
    color: var(--danger-600);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    display: block;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table, .data-table {
    width: 100%;
    min-width: 600px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: right;
}

.table th, .data-table th {
    background: var(--neutral-50);
    color: var(--neutral-600);
    font-weight: 700;
    font-size: 0.8125rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--neutral-200);
    white-space: nowrap;
}

.table td, .data-table td {
    padding: 0.875rem 1.25rem;
    color: var(--neutral-800);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--neutral-100);
    vertical-align: middle;
}

.table tbody tr:hover td, .data-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Portal Header & Navigation */
.portal-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    z-index: 50;
    padding-block: 0.85rem;
}

.portal-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--primary-900);
}

.brand-emblem {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-800), var(--accent-emerald-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(15, 39, 68, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-weight: 600;
    color: var(--neutral-600);
    position: relative;
    padding-block: 0.5rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-700);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #0a192f 0%, #0f2744 50%, #173b66 100%);
    color: var(--white);
    padding-block: 5rem 6rem;
    position: relative;
    overflow: hidden;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #e0f2fe;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero-title span {
    background: linear-gradient(90deg, #38bdf8, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    max-width: 650px;
    margin-bottom: 2.25rem;
    line-height: 1.8;
}

/* Stats Ribbon */
.stats-ribbon {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--neutral-100);
    text-align: center;
    transition: var(--transition);
}

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

.stat-value {
    font-size: 2.25rem;
    font-weight: 900;
    font-family: var(--font-latin);
    color: var(--primary-800);
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--neutral-500);
    font-weight: 600;
}

/* Course Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card-header {
    background: linear-gradient(135deg, var(--neutral-800), var(--neutral-900));
    padding: 1.5rem;
    color: var(--white);
    position: relative;
}

.course-card-category {
    font-size: 0.8125rem;
    color: #38bdf8;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.course-card-title {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
}

.course-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Admin Dashboard Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background-color: #f1f5f9;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--primary-900);
    color: var(--neutral-300);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 40;
}

.admin-sidebar-header {
    height: var(--header-height);
    padding-inline: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 1rem;
    list-style: none;
    overflow-y: auto;
}

.sidebar-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--neutral-400);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.3), rgba(37, 99, 235, 0.1));
    border-right: 3px solid var(--primary-400);
    color: var(--white);
}

.sidebar-icon {
    font-size: 1.15rem;
    width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 2rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.admin-content {
    padding: 2rem;
    flex: 1;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

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

.kpi-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-500);
    margin-bottom: 0.35rem;
}

.kpi-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--neutral-900);
    font-family: var(--font-latin);
}

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

/* Attendance Sheet Specifics */
.attendance-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-attend-present {
    background: var(--accent-emerald-50);
    color: var(--accent-emerald-700);
    border: 1.5px solid var(--accent-emerald-500);
}
.btn-attend-present.active, .btn-attend-present:hover {
    background: var(--accent-emerald-600);
    color: var(--white);
}

.btn-attend-absent {
    background: var(--danger-50);
    color: var(--danger-600);
    border: 1.5px solid var(--danger-500);
}
.btn-attend-absent.active, .btn-attend-absent:hover {
    background: var(--danger-600);
    color: var(--white);
}

.btn-attend-transfer {
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1.5px solid var(--primary-500);
}
.btn-attend-transfer:hover {
    background: var(--primary-600);
    color: var(--white);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--white);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: translateY(16px);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

/* Responsive Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.library-booking-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 2rem;
}

.form-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) auto;
    gap: 1rem;
    align-items: flex-end;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Portal Navbar Mobile Components */
.portal-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.portal-nav-toggle:hover {
    background: var(--neutral-200);
}

.portal-nav-toggle .hamburger-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--neutral-800);
    border-radius: 2px;
    transition: var(--transition);
}

.portal-nav-toggle.open .hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.portal-nav-toggle.open .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.portal-nav-toggle.open .hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.portal-nav-collapse {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.portal-nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ==========================================================================
   BREAKPOINTS: LAPTOPS & TABLETS (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }

    .admin-sidebar {
        position: fixed;
        right: -320px;
        top: 0;
        bottom: 0;
        width: min(300px, 85vw);
        z-index: 50;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .admin-sidebar.open {
        right: 0;
    }

    .library-booking-grid {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   BREAKPOINTS: TABLETS & MOBILE LANDSCAPE (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding-inline: 1.15rem;
    }

    /* Portal Navigation */
    .portal-nav-toggle {
        display: flex;
    }

    .portal-nav-inner {
        flex-wrap: wrap;
    }

    .portal-nav-collapse {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
        padding-top: 1.25rem;
        margin-top: 1rem;
        border-top: 1px solid var(--neutral-200);
        animation: portalNavSlideDown 0.25s ease-out;
    }

    .portal-nav-collapse.show {
        display: flex;
    }

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

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: var(--radius-md);
        background: var(--neutral-50);
        border: 1px solid var(--neutral-200);
    }

    .nav-link.active {
        background: var(--primary-50);
        border-color: var(--primary-300);
    }

    .portal-nav-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .portal-nav-actions .btn {
        width: 100%;
        justify-content: center;
        padding-block: 0.75rem;
    }

    /* Portal Hero */
    .hero-section {
        padding-block: 3.5rem 4rem;
    }

    .hero-title {
        font-size: 1.95rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .stats-ribbon {
        margin-top: -1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem 1rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    /* Admin Dashboard */
    .admin-header {
        padding-inline: 1.25rem;
        height: 64px;
    }

    .admin-content {
        padding: 1.25rem 1rem;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .card-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .form-filter-grid {
        grid-template-columns: 1fr;
    }

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

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

    /* Modals on Mobile */
    .modal-card {
        width: 95vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Seat Grid in Library Booking */
    #seatGrid {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)) !important;
        gap: 0.5rem !important;
    }

    .seat-btn {
        padding: 0.5rem 0.2rem !important;
        font-size: 0.85rem !important;
    }
}

/* ==========================================================================
   BREAKPOINTS: SMALL MOBILE PHONES (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .container {
        padding-inline: 0.85rem;
    }

    .brand-logo {
        font-size: 1.1rem;
    }

    .brand-emblem {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .hero-title {
        font-size: 1.65rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }

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

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

    .kpi-card {
        padding: 1.1rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .admin-header {
        padding-inline: 0.85rem;
    }

    .admin-content {
        padding: 1rem 0.75rem;
    }

    .card-body {
        padding: 1.15rem 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    /* Button and Input Touch-Friendly sizing */
    .btn {
        min-height: 42px;
    }

    .form-control, .form-select {
        min-height: 44px;
        font-size: 0.9rem;
    }

    /* Table adjustments */
    .table th, .table td {
        padding: 0.75rem 0.85rem;
        font-size: 0.8125rem;
    }

    /* Seat grid for extra small phone screens (320px–375px) */
    #seatGrid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important;
        gap: 0.4rem !important;
    }

    .seat-btn {
        padding: 0.45rem 0.15rem !important;
        font-size: 0.8rem !important;
    }

    /* Attendance actions stack cleanly */
    .attendance-actions {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .attendance-actions .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

