/* ── Theme variables ─────────────────────────────────────────────────────── */
:root {
    --brand:        #1a56db;
    --brand-dark:   #1240a8;
    --brand-light:  #e8f0fe;
    --sidebar-bg:   #0f172a;
    --body-bg:      #f3f4f6;
    --card-radius:  10px;
    --card-shadow:  0 1px 4px rgba(0,0,0,.08), 0 2px 12px rgba(0,0,0,.06);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
    background: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    margin-bottom: 0;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar.app-nav {
    background: var(--sidebar-bg) !important;
    border-bottom: 1px solid #1e293b;
    padding: .55rem 1.25rem;
}
.navbar.app-nav .navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: #f1f5f9 !important;
}
.navbar.app-nav .nav-link {
    color: #94a3b8 !important;
    font-size: .88rem;
    padding: .35rem .75rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.navbar.app-nav .nav-link:hover,
.navbar.app-nav .nav-link.active {
    background: rgba(255,255,255,.08);
    color: #f1f5f9 !important;
}
.navbar.app-nav .btn-link { color: #94a3b8 !important; font-size: .88rem; text-decoration: none; }
.navbar.app-nav .btn-link:hover { color: #f1f5f9 !important; }

/* ── Page wrapper ────────────────────────────────────────────────────────── */
.page-content { padding: 1.5rem 1.75rem; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-title { font-size: 1.35rem; font-weight: 700; color: #0f172a; margin-bottom: 0; }
.page-subtitle { font-size: .82rem; color: #64748b; margin-top: .15rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    background: #fff;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #475569;
    padding: .75rem 1.1rem;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary   { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); }
.btn-dark      { --bs-btn-bg: #0f172a; --bs-btn-border-color: #0f172a; --bs-btn-hover-bg: #1e293b; }
.btn           { border-radius: 7px; font-weight: 500; font-size: .875rem; }
.btn-sm        { border-radius: 6px; font-size: .8rem; }
.btn:focus     { box-shadow: 0 0 0 3px rgba(26,86,219,.25); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { --bs-table-hover-bg: #f8faff; font-size: .88rem; }
.table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 2px solid #e2e8f0;
    padding: .7rem .85rem;
}
.table tbody td { padding: .65rem .85rem; border-color: #f1f5f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { font-weight: 500; letter-spacing: .02em; border-radius: 6px; }

/* ── Form controls ───────────────────────────────────────────────────────── */
.form-control, .form-select {
    border-color: #cbd5e1;
    border-radius: 7px;
    font-size: .88rem;
    color: #1e293b;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(26,86,219,.18);
}
.form-label { font-weight: 500; font-size: .85rem; color: #374151; margin-bottom: .35rem; }
.form-text  { font-size: .78rem; color: #94a3b8; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { border-radius: 8px; font-size: .88rem; }

/* ── Status badges (attendance) ──────────────────────────────────────────── */
.badge-on-time  { background: #dcfce7; color: #15803d; }
.badge-late     { background: #fef9c3; color: #a16207; }
.badge-absent   { background: #f1f5f9; color: #64748b; }

/* ── Avatar circle ───────────────────────────────────────────────────────── */
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-light); color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .88rem; flex-shrink: 0;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-content { border-radius: 12px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-header  { border-bottom: 1px solid #e2e8f0; padding: 1rem 1.25rem; }
.modal-footer  { border-top: 1px solid #e2e8f0; padding: .75rem 1.25rem; }

/* ── Kiosk overrides (already has own full-page style) ───────────────────── */
/* Kiosk page sets Layout=null so these don't conflict */

/* ── Responsive mobile ───────────────────────────────────────────────────── */
@media (max-width: 575px) {
    .page-content { padding: .85rem; }
    .page-content .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: .65rem;
    }
    .table thead th:nth-child(4),
    .table tbody td:nth-child(4) { display: none; }
    .table thead th,
    .table tbody td { padding: .45rem .5rem; }
    .table td.text-end { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
}
