@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Libre+Baskerville:wght@700&display=swap');

:root {
    --bg: #eef2f4;
    --surface: #ffffff;
    --ink: #1a2b33;
    --muted: #5e717b;
    --line: #d5dee3;
    --brand: #0d6b5c;
    --brand-dark: #085246;
    --brand-soft: #e4f3ef;
    --accent: #c45c26;
    --danger: #b42318;
    --sidebar-w: 260px;
    --sidebar-collapsed: 72px;
    --shadow: 0 10px 30px rgba(26, 43, 51, 0.08);
    --radius: 12px;
    --font: 'Source Sans 3', sans-serif;
    --display: 'Libre Baskerville', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(13,107,92,.08), transparent 35%),
        linear-gradient(180deg, #f7faf9 0%, var(--bg) 100%);
    min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(13,107,92,.92), rgba(26,43,51,.88)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
    width: min(440px, 100%);
    background: var(--surface);
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-family: var(--display);
    font-size: 1.7rem;
    margin: 0 0 8px;
}

.login-card p {
    margin: 0 0 24px;
    color: var(--muted);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #113430 0%, #0b2623 100%);
    color: #e8f2ef;
    position: fixed;
    inset: 0 auto 0 0;
    transition: width .25s ease;
    z-index: 40;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
}

.sidebar-brand .mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #1f8f7c;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand .text { overflow: hidden; white-space: nowrap; }
.sidebar-brand .text strong { display: block; font-size: .98rem; }
.sidebar-brand .text span { font-size: .78rem; opacity: .7; }
.sidebar.collapsed .text { display: none; }

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: auto;
    flex: 1;
}

.nav-link, .nav-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #d7ebe6;
    border: 0;
    background: transparent;
    width: 100%;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.nav-link:hover, .nav-toggle:hover,
.nav-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.nav-link .icon, .nav-toggle .icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: .9;
}

.nav-link .label, .nav-toggle .label { white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .label, .sidebar.collapsed .chevron { display: none; }

.nav-group .submenu {
    margin-left: 34px;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0 8px;
}
.nav-group.open .submenu { display: flex; }
.sidebar.collapsed .submenu { display: none !important; }
.submenu a {
    color: #bdd8d1;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: .92rem;
}
.submenu a:hover, .submenu a.active { background: rgba(255,255,255,.08); color: #fff; }
.chevron { margin-left: auto; transition: transform .2s ease; }
.nav-group.open .chevron { transform: rotate(90deg); }

.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    transition: margin-left .25s ease;
}
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
    background: rgba(247,250,249,.85);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    gap: 12px;
}

.icon-btn {
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.content { padding: 22px; }

.page-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.page-title h1 {
    margin: 0;
    font-family: var(--display);
    font-size: 1.55rem;
}
.page-title p { margin: 4px 0 0; color: var(--muted); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-body { padding: 18px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}
.stat .label { color: var(--muted); font-size: .9rem; }
.stat .value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 6px;
    color: var(--brand-dark);
}
.stat .meta {
    margin-top: 8px;
    font-size: .85rem;
    color: var(--muted);
}

.dash-section { margin-bottom: 22px; }
.dash-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.dash-section-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}
.dash-section-head a {
    font-size: .9rem;
    font-weight: 600;
}

.stat.accent-total {
    border-color: #9fc5bc;
    background: linear-gradient(160deg, #f3faf8 0%, #fff 70%);
}
.stat.accent-ssc {
    border-color: #b9c8d8;
    background: linear-gradient(160deg, #f4f7fb 0%, #fff 70%);
}
.stat.accent-ssc .value { color: #1f4e79; }
.stat.accent-hsc {
    border-color: #d4b89a;
    background: linear-gradient(160deg, #fbf6f0 0%, #fff 70%);
}
.stat.accent-hsc .value { color: #8a4b16; }
.stat.accent-dropout {
    border-color: #d6a3a3;
    background: linear-gradient(160deg, #fbf3f3 0%, #fff 70%);
}
.stat.accent-dropout .value { color: #9b2c2c; }

.dash-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 4px;
}
.dash-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.dash-panel h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}
.dash-panel.accent-ssc {
    border-top: 3px solid #1f4e79;
}
.dash-panel.accent-hsc {
    border-top: 3px solid #8a4b16;
}
.dash-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dash-panel li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
}
.dash-panel li:last-child { border-bottom: none; }
.dash-panel li span { color: var(--muted); }
.dash-panel li strong { font-size: 1.1rem; color: var(--ink); }

@media (max-width: 720px) {
    .dash-split { grid-template-columns: 1fr; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 10px; font-size: .9rem; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: .92rem; }
.form-group input, .form-group select, .form-group textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: 2px solid rgba(13,107,92,.25);
    border-color: var(--brand);
}

.table-wrap { overflow: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}
table.data th, table.data td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}
table.data th {
    background: var(--brand-soft);
    font-weight: 700;
}
table.data.report {
    font-family: 'Times New Roman', Times, serif;
}
table.data.report th, table.data.report td {
    border: 1px solid #999;
    white-space: normal;
    vertical-align: top;
}

.board-report-header {
    display: grid;
    grid-template-columns: 90px 1fr 90px;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 12px 8px 16px;
    border-bottom: 2px solid #0b3d5c;
    background: #fff;
}
.board-report-header .board-logo {
    display: flex;
    justify-content: center;
    align-items: center;
}
.board-report-header .board-logo img {
    width: 78px;
    height: 78px;
    object-fit: contain;
}
.board-report-header .board-logo.govt img {
    width: 68px;
    height: 68px;
}
.board-report-header .board-titles {
    text-align: center;
}
.board-report-header .board-titles h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0b3d5c;
    letter-spacing: .02em;
    line-height: 1.3;
    font-family: 'Times New Roman', Times, serif;
}
.board-report-header .board-titles h3 {
    margin: 8px 0 0;
    display: inline-block;
    padding: 3px 12px;
    font-size: .95rem;
    font-weight: 700;
    color: #0b3d5c;
    border: 1px solid #0b3d5c;
    font-family: 'Times New Roman', Times, serif;
}

@media print {
    .sidebar, .topbar, .filters, .page-title .btn, .btn-group, .pagination, .btn {
        display: none !important;
    }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .card { box-shadow: none; border: none; }
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.alert-success { background: #e8f7ef; color: #0f5132; border: 1px solid #b7e4c7; }
.alert-danger { background: #fdecea; color: #7a1f17; border: 1px solid #f5c2c0; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    align-items: end;
}
.filters .filter-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
}
.filters input, .filters select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
    background: #fff;
}

.user-meta { text-align: right; }
.user-meta strong { display: block; }
.user-meta span { color: var(--muted); font-size: .88rem; }

.pagination { margin-top: 16px; }
.pagination nav > div { justify-content: center; }

@media (max-width: 980px) {
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .text, .sidebar .label, .sidebar .chevron { display: none; }
    .main, .sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed); }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 14px; }
}
