/* ============================================================
   SALBA Montessori Management System — Unified Stylesheet
   ============================================================ */

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

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* ============================================================
   CLEAN PAGE — base layout used on admin/student/settings pages
   ============================================================ */

.clean-page {
    background-color: #f8fafc;
    min-height: 100vh;
}

.clean-page-header {
    background: #fff;
    border-bottom: 0.0625rem solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 40;
}

.clean-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0.25rem 0 0;
}

.clean-page-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

/* Back button */
.clean-back-px-3 {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: color 0.15s;
}
.clean-back-px-3:hover { color: #0f172a; }

/* ============================================================
   BADGES
   ============================================================ */

.clean-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 624.938rem;
    white-space: nowrap;
}

.clean-badge-primary  { background: #dbeafe; color: #1d4ed8; }
.clean-badge-info     { background: #e0f2fe; color: #0369a1; }
.clean-badge-success  { background: #dcfce7; color: #15803d; }
.clean-badge-danger   { background: #fee2e2; color: #b91c1c; }
.clean-badge-warning  { background: #fef9c3; color: #a16207; }
.clean-badge-gray     { background: #f1f5f9; color: #475569; }

/* ============================================================
   STATS GRID
   ============================================================ */

.clean-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-bottom: 0.0625rem solid #e2e8f0;
}

.clean-stat-item {
    text-align: center;
    min-width: 5rem;
    padding: 0.5rem 0.75rem;
    border-right: 0.0625rem solid #e2e8f0;
}
.clean-stat-item:last-child { border-right: none; }

.clean-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
}

.clean-stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ============================================================
   FILTER BAR
   ============================================================ */

.clean-filter-bar {
    padding: 0.875rem 1.5rem;
    background: #f8fafc;
    border-bottom: 0.0625rem solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.clean-search-input {
    border: 0.0625rem solid #cbd5e1;
    border-radius: 0.5rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}
.clean-search-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 0.1875rem rgba(59,130,246,0.1); }

/* ============================================================
   TABLES
   ============================================================ */

.clean-bg-white {
    background: #fff;
    border-radius: 0.75rem;
    border: 0.0625rem solid #e2e8f0;
    overflow: hidden;
    margin: 1rem 1.5rem;
}

.clean-w-full-scroll { overflow-x: auto; }

.clean-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.clean-table thead { background: #f8fafc; }
.clean-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    text-align: left;
    border-bottom: 0.0625rem solid #e2e8f0;
}
.clean-table tbody tr { border-bottom: 0.0625rem solid #f1f5f9; transition: background 0.1s; }
.clean-table tbody tr:hover { background: #f8fafc; }
.clean-table tbody tr:last-child { border-bottom: none; }
.clean-table tbody td { padding: 0.75rem 1rem; color: #374151; vertical-align: middle; }

/* ============================================================
   BUTTONS
   ============================================================ */

.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

.rounded-clean-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.45rem 1rem;
    background: #2563eb;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.rounded-clean-primary:hover { background: #1d4ed8; }

.rounded-clean-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: #fff;
    color: #374151;
    border: 0.0625rem solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.rounded-clean-outline:hover { background: #f9fafb; border-color: #9ca3af; }

.rounded-clean-success {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: #16a34a;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.rounded-clean-success:hover { background: #15803d; }

.rounded-clean-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: #dc2626;
    color: #fff;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}
.rounded-clean-danger:hover { background: #b91c1c; }

.rounded-clean-sm {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
}

/* ============================================================
   ACTION BUTTONS GROUP
   ============================================================ */

.clean-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ============================================================
   ALERTS
   ============================================================ */

.clean-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 1rem 1.5rem;
}

.clean-alert-success { background: #f0fdf4; color: #15803d; border: 0.0625rem solid #bbf7d0; }
.clean-alert-danger  { background: #fef2f2; color: #b91c1c; border: 0.0625rem solid #fecaca; }
.clean-alert-warning { background: #fffbeb; color: #b45309; border: 0.0625rem solid #fde68a; }
.clean-alert-info    { background: #eff6ff; color: #1d4ed8; border: 0.0625rem solid #bfdbfe; }

/* ============================================================
   EMPTY STATE
   ============================================================ */

.clean-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.clean-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.clean-empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem;
}

.clean-empty-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1rem;
}

/* ============================================================
   FORMS — shared input styles
   ============================================================ */

.clean-form-group { margin-bottom: 1.25rem; }

.clean-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.clean-input, .clean-select, .clean-textarea {
    width: 100%;
    padding: 0.55rem 0.875rem;
    border: 0.0625rem solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.clean-input:focus, .clean-select:focus, .clean-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.1875rem rgba(59,130,246,0.1);
}

/* ============================================================
   CARDS
   ============================================================ */

.clean-card {
    background: #fff;
    border: 0.0625rem solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: box-shadow 0.2s;
}
.clean-card:hover { box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.07); }

.clean-card-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

/* ============================================================
   PAGE HEADER (non-clean pages — mixed use)
   ============================================================ */

.page-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1.5625rem 3.125rem rgba(0,0,0,0.25);
    width: 100%;
    max-width: 26.25rem;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: #fff;
    padding: 2rem 2rem 1.75rem;
    text-align: center;
}

.login-icon {
    width: 4rem;
    height: 4rem;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.login-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
}

.login-body {
    padding: 2rem;
}

.login-alert {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: #fef2f2;
    color: #b91c1c;
    border: 0.0625rem solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.login-form-group { margin-bottom: 1.25rem; }

.login-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

.login-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border: 0.0625rem solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}
.login-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.1875rem rgba(37,99,235,0.1);
}

.login-btn {
    width: 100%;
    padding: 0.7rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s;
    font-family: inherit;
    margin-top: 0.5rem;
}
.login-btn:hover { background: #1d4ed8; }

.login-footer {
    text-align: center;
    padding: 1rem 2rem;
    background: #f8fafc;
    border-top: 0.0625rem solid #e2e8f0;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ============================================================
   RESPONSIVE — sidebar offset awareness
   ============================================================ */

@media (max-width: 48rem) {
    .clean-page-header { padding: 1rem; }
    .clean-stats-grid { padding: 0.75rem 1rem; }
    .clean-filter-bar { padding: 0.75rem 1rem; }
    .clean-bg-white { margin: 0.75rem 1rem; }
    .clean-alert { margin: 0.75rem 1rem; }
}

/* ==========================================================================
   MODERN VIVID LIGHT DESIGN SYSTEM (Security & Attendance Hub)
   ========================================================================== */

:root {
    --vivid-indigo: #4f46e5;
    --vivid-purple: #7c3aed;
    --vivid-emerald: #059669;
    --vivid-sky: #0284c7;
    --vivid-rose: #e11d48;
    --vivid-orange: #d97706;
}

.bg-security {
    background-color: #f8fafc !important; /* Clean White Surface */
    background-image: none !important;
    color: #1e293b !important;
}

/* Vivid Solid Card for Light Mode */
.security-card {
    background: #ffffff;
    border: 0.0625rem solid #e2e8f0;
    box-shadow: 0 0.625rem 1.5625rem -0.3125rem rgba(0, 0, 0, 0.05);
    border-radius: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.security-card:hover {
    box-shadow: 0 1.25rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1);
    transform: translateY(-0.125rem);
}

/* Colorful Card Modifiers */
.card-vivid-indigo { background: var(--vivid-indigo); color: white !important; border: none; }
.card-vivid-emerald { background: var(--vivid-emerald); color: white !important; border: none; }
.card-vivid-rose { background: var(--vivid-rose); color: white !important; border: none; }
.card-vivid-orange { background: var(--vivid-orange); color: white !important; border: none; }

/* Table Overhaul for Light Mode */
.security-manifest-wrapper {
    background: #ffffff;
    border-radius: 1.5rem;
    border: 0.0625rem solid #e2e8f0;
    box-shadow: 0 0.0625rem 0.1875rem rgba(0,0,0,0.1);
    overflow: hidden;
}

.security-manifest-table thead {
    background: #f1f5f9;
}

.security-manifest-table tr {
    background: #ffffff;
    border-bottom: 0.0625rem solid #f1f5f9;
}

.security-manifest-table tr:hover {
    background: #f8fafc;
}

/* Vivid Accents */
.security-card-ribbon {
    position: relative;
    overflow: hidden;
}

.security-card-ribbon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--vivid-indigo), var(--vivid-purple), var(--vivid-sky));
}

/* Verification Halo (Authentication Lens) */
.identity-lens {
    width: 7.5rem;
    height: 7.5rem;
    margin-left: auto;
    margin-right: auto;
    border-radius: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 0.125rem solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.5s ease;
    box-shadow: inset 0 0 1.25rem rgba(0, 0, 0, 0.2);
}

.identity-lens::after {
    content: '';
    position: absolute;
    inset: -0.625rem;
    border-radius: 3.125rem;
    border: 0.125rem solid var(--vivid-indigo);
    opacity: 0.2;
    animation: pulse-halo 3s infinite;
}

@keyframes pulse-halo {
    0% { transform: scale(0.95); opacity: 0.1; }
    50% { transform: scale(1.05); opacity: 0.3; }
    100% { transform: scale(0.95); opacity: 0.1; }
}

/* Manifest Table: Frosted Rows */
.security-manifest-wrapper {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 2rem;
    border: 0.0625rem solid var(--glass-border);
    overflow: hidden;
    backdrop-filter: blur(0.625rem);
}

.security-manifest-table {
    min-width: 37.5rem;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.security-manifest-table tr {
    background: transparent;
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.security-manifest-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.security-manifest-table td {
    padding: 1.5rem 1rem;
    border-top: 0.0625rem solid rgba(255, 255, 255, 0.03);
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.security-manifest-table td:first-child { 
    border-left: 0.0625rem solid rgba(255, 255, 255, 0.03); 
    border-radius: 1.25rem 0 0 1.25rem; 
}

.security-manifest-table td:last-child { 
    border-right: 0.0625rem solid rgba(255, 255, 255, 0.03); 
    border-radius: 0 1.25rem 1.25rem 0; 
}

/* High-Visibility Solid Badges */
.status-pill-solid {
    padding: 0.6rem 1.25rem;
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 624.938rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff !important;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
}

.pill-emerald { background: #10b981 !important; box-shadow: 0 0 1.25rem rgba(16, 185, 129, 0.4); }
.pill-rose { background: #f43f5e !important; box-shadow: 0 0 1.25rem rgba(244, 63, 94, 0.4); }
.pill-orange { background: #f59e0b !important; box-shadow: 0 0 1.25rem rgba(245, 158, 11, 0.4); }
.pill-sky { background: #0ea5e9 !important; box-shadow: 0 0 1.25rem rgba(14, 165, 233, 0.4); }
.pill-indigo { background: #6366f1 !important; box-shadow: 0 0 1.25rem rgba(99, 102, 241, 0.4); }
.pill-violet { background: #8b5cf6 !important; box-shadow: 0 0 1.25rem rgba(139, 92, 246, 0.4); }

/* Mobile Overrides for Security Theme */
@media (max-width: 40rem) {
    .identity-lens {
        width: 6.25rem;
        height: 6.25rem;
    }
    .identity-lens i {
        font-size: 2.5rem !important;
    }
    .hud-stat {
        font-size: 0.4375rem;
    }
    .security-manifest-table-lg td {
        padding: 1rem !important;
    }
}
