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

:root {
    --color-primary: #163d73;
    --color-primary-dark: #0d2a52;
    --color-primary-light: #2c5da3;
    --color-accent: #d99a2b;
    --color-accent-light: #f3c876;
    --color-bg: #f6f8fb;
    --color-card: #ffffff;
    --color-text: #1c2430;
    --color-muted: #647087;
    --color-border: #e3e8f0;
    --color-success: #1f8a4c;
    --color-danger: #c0392b;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(15, 35, 70, 0.06);
    --shadow-md: 0 8px 24px rgba(15, 35, 70, 0.08);
    --shadow-lg: 0 20px 48px rgba(15, 35, 70, 0.14);
    --font-heading: 'Poppins', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.25; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top contact strip ---------- */
.top-bar {
    background: var(--color-primary-dark);
    color: #b9cbe8;
    font-size: 0.82rem;
}
.top-bar .bar {
    max-width: 1140px;
    margin: 0 auto;
    padding: 7px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.top-bar a { color: #dce9ff; font-weight: 500; }
.top-bar a:hover { color: #fff; }
.top-bar span { opacity: 0.5; margin: 0 8px; }
.top-bar-links, .top-bar-contact { display: flex; align-items: center; }
@media (max-width: 640px) { .top-bar { display: none; } }

/* ---------- Notice ticker ---------- */
.notice-ticker {
    background: var(--color-accent);
    color: #2a1c04;
    display: flex;
    align-items: stretch;
    font-size: 0.88rem;
    font-weight: 600;
}
.notice-ticker-label {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 9px 18px;
    flex-shrink: 0;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
}
.notice-ticker-track { overflow: hidden; flex: 1; padding: 9px 0; }
.notice-ticker-inner { display: flex; width: max-content; animation: ticker-scroll 30s linear infinite; }
.notice-ticker-inner span { padding: 0 40px; white-space: nowrap; }
.notice-ticker-track:hover .notice-ticker-inner { animation-play-state: paused; }
@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (max-width: 640px) { .notice-ticker-label { display: none; } }

/* ---------- Fixed side tab ---------- */
.side-tab {
    position: fixed;
    right: 0;
    top: 45%;
    background: var(--color-primary);
    color: #fff !important;
    padding: 12px 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    border-radius: 8px 0 0 8px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    box-shadow: var(--shadow-md);
    z-index: 40;
    text-decoration: none !important;
}
.side-tab:hover { background: var(--color-primary-light); padding-right: 12px; }
@media (max-width: 640px) { .side-tab { display: none; } }

/* ---------- Header ---------- */
.site-header {
    background: linear-gradient(180deg, var(--color-primary) 0%, #144073 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.site-header .bar {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 20px;
}
.site-header .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.08rem;
    line-height: 1.25;
    min-width: 0;
    flex: 1 1 auto;
}
.site-header .brand img { height: 46px; width: 46px; object-fit: contain; border-radius: 50%; background: #fff; padding: 3px; flex-shrink: 0; }
.site-header .brand span { min-width: 0; overflow-wrap: break-word; }
.site-header .brand small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.72rem; color: var(--color-accent-light); letter-spacing: 0.03em; }

.nav-toggle {
    display: none;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
}

.site-header nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: flex-end;
}
.site-header nav a {
    color: #dce9ff;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
}
.site-header nav a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }

.nav-ctas { display: flex; gap: 8px; margin-left: 10px; }
.btn-nav {
    background: var(--color-accent);
    color: #2a1c04 !important;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    white-space: nowrap;
}
.btn-nav:hover { background: var(--color-accent-light); text-decoration: none; }
.btn-nav.secondary {
    background: transparent;
    color: #fff !important;
    border: 1.5px solid rgba(255,255,255,0.5);
}
.btn-nav.secondary:hover { background: rgba(255,255,255,0.12); border-color: #fff; }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .site-header nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        order: 3;
        border-top: 1px solid rgba(255,255,255,0.12);
        margin-top: 10px;
        padding-top: 8px;
    }
    .site-header nav.open { display: flex; }
    .site-header .bar { flex-wrap: wrap; }
    .site-header nav a { padding: 11px 8px; }
    .nav-ctas { flex-direction: column; margin-left: 0; margin-top: 6px; }
    .btn-nav { text-align: center; }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--color-primary-dark);
    color: #b9cbe8;
    margin-top: 56px;
    padding: 40px 20px 20px;
    font-size: 0.9rem;
}
.site-footer .bar {
    max-width: 1140px;
    margin: 0 auto;
}
.site-footer .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.site-footer h4 { color: #fff; font-family: var(--font-heading); font-size: 0.95rem; margin: 0 0 12px; }
.site-footer .footer-grid a { display: block; color: #b9cbe8; padding: 4px 0; }
.site-footer .footer-grid a:hover { color: #fff; text-decoration: none; }
.site-footer .foot-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    opacity: 0.75;
    font-size: 0.82rem;
}
@media (max-width: 700px) {
    .site-footer .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(circle at 15% 20%, rgba(217,154,43,0.10) 0%, transparent 45%),
        linear-gradient(180deg, #eef3fb 0%, var(--color-bg) 100%);
    border-bottom: 1px solid var(--color-border);
}
.hero-inner { text-align: center; padding: 64px 20px 52px; }
.hero-logo { height: 128px; width: 128px; object-fit: contain; margin-bottom: 20px; filter: drop-shadow(0 8px 20px rgba(15,35,70,0.15)); }
.hero-inner h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; color: var(--color-primary-dark); }
.hero-tagline { margin: 0; font-weight: 700; color: var(--color-accent); letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; }
.hero-motto { margin: 6px 0 0; color: var(--color-muted); font-size: 1.02rem; }

@media (max-width: 700px) {
    .home-grid { grid-template-columns: 1fr !important; }
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

/* ---------- Cards ---------- */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.stat-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

h1, .card h1 { font-weight: 800; }
.card h3 { font-size: 1.05rem; margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-body);
    box-shadow: 0 6px 16px rgba(22,61,115,0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { background: var(--color-primary-light); text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 20px rgba(22,61,115,0.3); }
.btn.secondary { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); box-shadow: none; }
.btn.secondary:hover { background: var(--color-primary); color: #fff; }
.btn.danger { background: var(--color-danger); box-shadow: none; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.12s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
}

.auth-box {
    max-width: 380px;
    margin: 60px auto;
}
.auth-box h1 { font-size: 1.3rem; margin-bottom: 20px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.flash.success { background: #e5f6ec; color: var(--color-success); border: 1px solid #b8e6c9; }
.flash.error { background: #fbe9e7; color: var(--color-danger); border: 1px solid #f3c2ba; }

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; }
table th { background: #eef2f7; font-weight: 600; }

.portal-shell { display: flex; min-height: 100vh; }
.portal-sidebar {
    width: 220px;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}
.portal-sidebar .brand { padding: 0 20px 20px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.15); margin-bottom: 12px; }
.portal-sidebar a { display: block; color: #dce6f4; padding: 10px 20px; font-size: 0.92rem; }
.portal-sidebar a:hover, .portal-sidebar a.active { background: rgba(255,255,255,0.1); text-decoration: none; color: #fff; }
.portal-main { flex: 1; padding: 28px 32px; }
.portal-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge.role-super_admin { background: #f3e6d8; color: #8a5a1f; }
.badge.role-admin { background: #dbe9f8; color: var(--color-primary-dark); }
.badge.role-staff { background: #e3f0e6; color: var(--color-success); }
.badge.role-parent { background: #f1e6f8; color: #6a3a8f; }
