/* ============================================================
   PPDB SMK NURUL ULUM LEBAKSIU — Main Design System
   ============================================================ */

/* --- Google Fonts (fallback jika belum ada di template) --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    /* Brand Colors */
    --primary:        #059669;
    --primary-light:  #10b981;
    --primary-lighter:#34d399;
    --primary-bg:     #ecfdf5;
    --primary-bg2:    #f0fdf4;
    --primary-dark:   #047857;

    /* Neutral */
    --text-dark:   #1e293b;
    --text-mid:    #475569;
    --text-light:  #64748b;
    --border:      #e2e8f0;
    --bg-body:     #f8fafc;
    --white:       #ffffff;

    /* Danger */
    --danger:      #ef4444;
    --danger-bg:   #fee2e2;
    --danger-dark: #b91c1c;

    /* Warning */
    --warning:     #f59e0b;
    --warning-bg:  #fffbeb;

    /* Shadows */
    --shadow-sm:   0 2px 8px rgba(0,0,0,0.06);
    --shadow-md:   0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg:   0 10px 35px rgba(0,0,0,0.10);
    --shadow-green:0 8px 25px rgba(5,150,105,0.30);

    /* Border Radius */
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  20px;
    --radius-xl:  24px;
    --radius-full:9999px;

    /* Transitions */
    --transition: all 0.3s ease;

    /* Spacing */
    --content-max: 1200px;
    --nav-height:  75px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   SHARED NAVBAR — PUBLIC (halaman depan, form pendaftaran)
   ============================================================ */
.navbar {
    background: var(--white);
    padding: 0 6%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-logo {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    flex-shrink: 0;
}

.navbar-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.navbar-brand-text .school-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    display: block;
}

.navbar-brand-text .school-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-light);
    display: block;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-menu a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-mid);
    transition: var(--transition);
}

.navbar-menu a:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.navbar-menu a.active {
    color: var(--primary);
    background: var(--primary-bg);
    font-weight: 600;
}

/* Hamburger (mobile) */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
    padding: 4px;
}

/* ============================================================
   SHARED NAVBAR — ADMIN (panel admin)
   ============================================================ */
.admin-navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(5,150,105,0.25);
    position: sticky;
    top: 0;
    z-index: 1000;
    color: white;
}

.admin-navbar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.admin-navbar .brand i { font-size: 22px; }

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

.admin-nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.admin-nav-links a:hover,
.admin-nav-links a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.admin-nav-links a.btn-logout {
    background: rgba(255,255,255,0.15);
    margin-left: 8px;
}

.admin-nav-links a.btn-logout:hover {
    background: rgba(239,68,68,0.7);
}

/* ============================================================
   SHARED FOOTER
   ============================================================ */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 24px 6%;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    margin-top: auto;
}

.site-footer strong { color: var(--primary); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow-green);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(5,150,105,0.40);
    color: white;
}

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

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
}

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

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

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

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
}

.btn-gray {
    background: #64748b;
    color: white;
}

.btn-gray:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 16px 44px;
    font-size: 17px;
}

.btn-block { width: 100%; }

/* ============================================================
   CARDS / BOX
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.card-sm {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}

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

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 7px;
}

.form-label .required {
    color: var(--danger);
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 11px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bg-body);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.12);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

select.form-control { cursor: pointer; }

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.10);
}

/* Radio groups */
.radio-group {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-mid);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   FORM GRID (untuk form 2-kolom)
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 28px;
}

.form-grid .col-span-2 { grid-column: 1 / -1; }

/* ============================================================
   ALERT / NOTICE
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-info {
    background: var(--primary-bg);
    border-left: 4px solid var(--primary-light);
    color: #065f46;
}

.alert-info i { color: var(--primary); }

.alert-danger {
    background: var(--danger-bg);
    border-left: 4px solid var(--danger);
    color: var(--danger-dark);
}

.alert-danger i { color: var(--danger); }

.alert-warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

/* ============================================================
   STEP INDICATOR (Form Pendaftaran)
   ============================================================ */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 28px auto 36px;
    max-width: 600px;
    padding: 0 10px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.step-item.completed:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
    background: var(--primary-lighter);
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.step-item.completed .step-circle {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.step-item.active .step-circle {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.25);
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}

.step-item.active .step-label,
.step-item.completed .step-label {
    color: var(--primary);
}

/* ============================================================
   TABLES (Admin)
   ============================================================ */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.table thead {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
    color: white;
}

.table thead th {
    padding: 13px 14px;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
    vertical-align: middle;
}

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

.table tbody tr:hover { background: var(--primary-bg2); }

.table td.text-center,
.table th.text-center { text-align: center; }

/* ============================================================
   STAT CARDS (Admin Dashboard)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--primary-light);
    transition: var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-info .stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-info .stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    margin-top: 4px;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-green  { background: var(--primary-bg); color: var(--primary); }
.badge-gray   { background: #f1f5f9; color: var(--text-light); }
.badge-red    { background: var(--danger-bg); color: var(--danger-dark); }

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-bar .form-control {
    flex: 1;
    min-width: 180px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-mid);
    background: white;
    border: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
}

.page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-green   { color: var(--primary); }
.text-muted   { color: var(--text-light); }
.text-danger  { color: var(--danger); }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mt-32        { margin-top: 32px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.mb-32        { margin-bottom: 32px; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

/* Section heading */
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px;
    margin-top: 8px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

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

.animate-up   { animation: fadeInUp 0.7s ease both; }
.animate-down { animation: fadeInDown 0.7s ease both; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-bg2) 0%, var(--primary-bg) 50%, #d1fae5 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-deco {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
}
.login-deco-1 {
    width: 500px; height: 500px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    top: -200px; right: -150px;
    animation: float1 25s infinite ease-in-out;
}
.login-deco-2 {
    width: 350px; height: 350px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
    bottom: -120px; left: -80px;
    animation: float2 20s infinite ease-in-out;
}

@keyframes float1 {
    0%,100% { transform: translate(0,0) rotate(0); }
    50%      { transform: translate(40px,70px) rotate(180deg); }
}
@keyframes float2 {
    0%,100% { transform: translate(0,0); }
    50%      { transform: translate(-30px,-50px) rotate(-180deg); }
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
    padding: 48px 44px;
    position: relative;
    z-index: 2;
    animation: fadeInUp 0.8s ease;
}

.login-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-card-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
}

.login-card-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
}

.login-card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.login-card-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

/* ============================================================
   INFO GRID (Dashboard siswa / detail)
   ============================================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.info-item {
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border-left: 4px solid var(--primary-light);
}

.info-item .info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-item .info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ============================================================
   RESPONSIVE — Comprehensive Multi-Breakpoint System
   ============================================================ */

/* ── Large tablet / small desktop (≤ 1024px) ── */
@media (max-width: 1024px) {
    :root { --nav-height: 70px; }

    .navbar { padding: 0 4%; }

    .navbar-brand-text .school-name { font-size: 15px; }

    .btn-lg { padding: 14px 36px; font-size: 16px; }

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

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

/* ── Tablet (≤ 768px) ── */
@media (max-width: 768px) {
    :root { --nav-height: 60px; }

    /* --- Navbar public --- */
    .navbar {
        padding: 0 16px;
        height: var(--nav-height);
    }

    .navbar-brand-text .school-name { font-size: 14px; }
    .navbar-brand-text .school-sub  { display: none; }

    .navbar-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0; right: 0;
        background: white;
        flex-direction: column;
        padding: 12px 16px 20px;
        gap: 4px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        border-top: 1px solid var(--border);
        transform: translateY(-110%);
        opacity: 0;
        transition: transform 0.32s ease, opacity 0.28s ease;
        z-index: 999;
    }

    .navbar-menu.open {
        transform: translateY(0);
        opacity: 1;
    }

    .navbar-menu a {
        width: 100%;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 15px;
    }

    .navbar-toggle { display: flex; }

    /* --- Admin navbar --- mobile version is handled in header-admin.php --- */
    .admin-navbar {
        /* Keep sticky on mobile */
        position: sticky;
    }

    /* --- Footer --- */
    .site-footer { padding: 20px 16px; font-size: 12px; }

    /* --- Buttons --- */
    .btn    { padding: 11px 22px; font-size: 14px; }
    .btn-lg { padding: 13px 28px; font-size: 15px; }
    .btn-sm { padding: 7px 14px; font-size: 12px; }

    /* --- Form grid --- */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .form-grid .col-span-2 { grid-column: 1; }

    /* --- Step indicator --- */
    .step-indicator {
        margin: 20px auto 28px;
        padding: 0 6px;
    }
    .step-label { display: none; }
    .step-circle { width: 30px; height: 30px; font-size: 12px; }
    .step-item:not(:last-child)::after { top: 15px; }

    /* --- Stats grid --- */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .stat-card  { padding: 18px 20px; gap: 14px; }
    .stat-icon  { width: 44px; height: 44px; font-size: 19px; }
    .stat-info .stat-number { font-size: 22px; }

    /* --- Login card --- */
    .login-card { padding: 32px 24px; }
    .login-page { padding: 16px; }
    .login-card-title { font-size: 20px; }

    /* --- Info grid --- */
    .info-grid { grid-template-columns: 1fr; }

    /* --- Filter bar --- */
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { min-width: 0; }

    /* --- Pagination --- */
    .page-link { width: 32px; height: 32px; font-size: 13px; }

    /* --- Card --- */
    .card    { padding: 24px 20px; }
    .card-sm { padding: 16px 18px; }

    /* --- Table --- */
    .table-responsive { border-radius: var(--radius-sm); }

    /* --- Utility spacing --- */
    .mt-32 { margin-top: 20px; }
    .mb-32 { margin-bottom: 20px; }
}

/* ── Mobile large (≤ 600px) ── */
@media (max-width: 600px) {
    body { font-size: 14px; }

    /* --- Stats --- */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-card  { padding: 14px 16px; gap: 12px; }
    .stat-info .stat-number { font-size: 20px; }
    .stat-info .stat-label  { font-size: 12px; }

    /* --- Buttons stack on small screens --- */
    .btn-block-mobile { width: 100%; }

    /* --- Hero CTA buttons --- */
    .hero-cta { flex-direction: column; align-items: center; gap: 10px; }
    .hero-cta .btn { width: 100%; max-width: 280px; }

    /* --- Step indicator compact --- */
    .step-indicator { gap: 0; max-width: 100%; }
    .step-circle { width: 28px; height: 28px; font-size: 11px; }

    /* --- Login card --- */
    .login-card { padding: 28px 18px; border-radius: var(--radius-md); }
    .login-card-logo { width: 56px; height: 56px; font-size: 24px; }
    .login-card-title { font-size: 18px; }

    /* --- Admin navbar stacks to 2 rows --- */
    .admin-navbar .brand span { font-size: 14px; }

    /* --- Info grid 1-col --- */
    .info-grid { grid-template-columns: 1fr; gap: 10px; }
    .info-item { padding: 12px 14px; }

    /* --- Alerts --- */
    .alert { flex-direction: column; gap: 8px; padding: 12px 14px; }
    .alert i { font-size: 20px; }
}

/* ── Mobile small (≤ 480px) ── */
@media (max-width: 480px) {
    :root { --nav-height: 56px; }

    /* --- Navbar --- */
    .navbar { padding: 0 12px; }
    .navbar-logo { width: 36px; height: 36px; font-size: 18px; }
    .navbar-logo img { width: 28px; height: 28px; }
    .navbar-brand-text .school-name { font-size: 13px; }
    .navbar-menu { top: var(--nav-height); padding: 10px 12px 16px; }

    /* --- Stats: 1 column on tiny screens --- */
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card  { padding: 16px 18px; }

    /* --- Forms --- */
    .form-group { margin-bottom: 16px; }
    .form-control { font-size: 14px; padding: 10px 14px; }
    .form-label   { font-size: 13px; }

    /* --- Buttons --- */
    .btn    { padding: 10px 18px; font-size: 14px; gap: 6px; }
    .btn-lg { padding: 12px 24px; font-size: 14px; }

    /* --- Cards --- */
    .card    { padding: 20px 16px; }
    .card-sm { padding: 14px 14px; }

    /* --- Login card --- */
    .login-card { padding: 24px 16px; }
    .login-page { padding: 12px; }

    /* --- Step indicator minimal --- */
    .step-indicator { margin: 16px auto 22px; }
    .step-circle    { width: 26px; height: 26px; font-size: 10px; }
    .step-item:not(:last-child)::after { top: 13px; }

    /* --- Pagination --- */
    .pagination { gap: 4px; }
    .page-link  { width: 30px; height: 30px; font-size: 12px; }

    /* --- Table font sizes --- */
    .table thead th { font-size: 11px; padding: 10px 10px; }
    .table tbody td { font-size: 12px; padding: 9px 10px; }

    /* --- Badge --- */
    .badge { font-size: 11px; padding: 3px 8px; }

    /* --- Section headings --- */
    .section-title { font-size: 18px; }
}

/* ── Ultra-small (≤ 360px) ── */
@media (max-width: 360px) {
    .navbar-brand-text { display: none; }
    .btn-lg { padding: 10px 18px; font-size: 13px; }
    .login-card { padding: 20px 12px; }
    .step-circle { width: 24px; height: 24px; font-size: 9px; }
}

/* ============================================================
   TOUCH / ACCESSIBILITY IMPROVEMENTS
   ============================================================ */

/* Minimum tap target size (WCAG 2.5.5 — 44×44px) */
.btn, .page-link, .navbar-toggle, .admin-toggle {
    min-height: 44px;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Smooth scrolling with reduced motion fallback */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Smoother momentum scrolling on iOS */
.table-scroll,
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .navbar, .admin-navbar, .site-footer,
    .btn, .print-actions, .navbar-toggle { display: none !important; }

    body { background: white; font-size: 12px; }

    .card, .card-sm { box-shadow: none; border: 1px solid #ddd; }
}

