/* DepEd District Website - Main Stylesheet */
/* Theme: Warm Orange Gradient - Professional & Accessible */

:root {
    --primary: #E8630A;
    --primary-light: #F28C45;
    --primary-dark: #C0480A;
    --primary-gradient: linear-gradient(135deg, #E8630A 0%, #F5A623 100%);
    --primary-gradient-v: linear-gradient(180deg, #E8630A 0%, #F5A623 100%);
    --secondary: #003087; /* DepEd Blue */
    --secondary-light: #1a4fa0;
    --accent: #FFD700;
    --text-dark: #1a1a2e;
    --text-medium: #444;
    --text-light: #666;
    --bg-light: #FFF8F2;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --border: #e8d5c0;
    --shadow: 0 2px 15px rgba(232,99,10,0.12);
    --shadow-hover: 0 8px 30px rgba(232,99,10,0.22);
    --radius: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.65;
    min-height: 100vh;
}

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

/* ========== TOPBAR ========== */
.topbar {
    background: var(--secondary);
    color: #fff;
    font-size: 0.8rem;
    padding: 5px 0;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar i { margin-right: 5px; color: var(--accent); }

/* ========== NAVBAR ========== */
.navbar {
    /* background set via inline style from PHP for customization */
    background: var(--primary-gradient);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.brand-title {
    font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1.2;
    white-space: nowrap;
}
.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2px;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    text-decoration: none;
    color: rgba(255,255,255,0.92);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.nav-links a i { font-size: 0.85rem; }
.btn-login {
    background: rgba(255,255,255,0.22) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    border-radius: 25px !important;
    padding: 8px 20px !important;
}
.btn-login:hover { background: rgba(255,255,255,0.35) !important; }
.btn-admin {
    background: var(--secondary) !important;
    color: #fff !important;
    border-radius: 8px !important;
}
.user-nav { color: rgba(255,255,255,0.9) !important; }

/* Dropdown */
.has-dropdown { position: relative; }
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-radius: 0 0 var(--radius) var(--radius);
    border-top: 3px solid var(--primary);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 999;
}
.dropdown-right { left: auto; right: 0; }
.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown li a {
    display: block;
    padding: 10px 18px;
    border-radius: 0;
    color: var(--text-medium);
}
.dropdown li a:hover { background: var(--bg-light); color: var(--primary); }

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background: #fff;
    transition: var(--transition);
}

/* ========== HERO BANNER ========== */
.hero-banner {
    background: var(--primary-gradient);
    color: #fff;
    padding: 14px 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}
/* 3-column banner: left logos | center text | right logos+seal */
.hero-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
    width: 100%;
    flex-wrap: nowrap;
}
/* Center text grows, logos stay fixed */
.hero-text { flex: 1; min-width: 0; }
.hero-logos-left  { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.hero-logos-right { display: flex; gap: 14px; align-items: center; flex-shrink: 0; flex-direction: row; }
/* Keep old .hero-logos class working */
.hero-logos { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.hero-logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
    flex-shrink: 0;
}
.hero-logo-sm {
    height: 65px;
    width: auto;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
}
.hero-seal-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: rgba(255,255,255,0.85);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}
.hero-seal-link:hover { color: #FFE58A; }
/* Hierarchical banner text */
.hero-text { line-height: 1.25; text-align: center; }
.hero-deped {
    font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.25);
    letter-spacing: 1.5px;
}
.hero-region {
    font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-size: 0.78rem;
    font-weight: 700;
    margin: 0 0 1px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.92;
}
.hero-division {
    font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0 0 4px;
    letter-spacing: 1.5px;
    opacity: 0.88;
}
.hero-district {
    font-family: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0 0 6px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    color: #FFE58A;
    line-height: 1.1;
}
.hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}
.hero-edit-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-weight: 600;
}
.hero-edit-btn:hover { background: rgba(255,255,255,0.35); }

/* ========== GALLERY — PNVSCA split layout ========== */
.gallery-section { background: #111; line-height: 0; }

/* Outer wrapper: full-width, flex row */
.gallery-split-wrap {
    position: relative;
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    background: #111;
}

/* Main slide area — full width */
.gallery-main {
    position: relative;
    flex: 1;
    overflow: hidden;
    line-height: 0;
}

/* Slides */
.gallery-slide { display: none; position: relative; width: 100%; height: 500px; }
.gallery-slide.active { display: block; }
.gallery-slide.gallery-hidden-slide { opacity: 0.45; }
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-link-wrap { display: block; height: 100%; }
/* Caption always overlays the image — JS positions it at the rendered image's bottom edge */
.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0; /* JS overrides this for non-cover fits */
    background: linear-gradient(transparent, rgba(0,0,0,0.82));
    color: #fff;
    padding: 60px 24px 20px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
    transition: bottom 0.3s ease;
}
.gallery-caption a { pointer-events: auto; }
.gallery-cap-content { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; flex: 1; }
.gallery-cap-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.gallery-cap-text { font-size: 0.95rem; font-weight: 400; opacity: 0.9; }
.gallery-read-more {
    color: #FFD700;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid rgba(255,215,0,0.5);
    padding: 5px 12px;
    border-radius: 20px;
    transition: var(--transition);
}
.gallery-read-more:hover { background: rgba(255,215,0,0.2); }
.gallery-hidden-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.7);
    color: #ffc107;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 15;
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(232,99,10,0.8);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-nav:hover { background: var(--primary); transform: translateY(-50%) scale(1.1); }
.gallery-nav.prev { left: 18px; }
.gallery-nav.next { right: 18px; }
.gallery-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 10;
}
.gallery-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: var(--transition);
}
.gallery-dot.active { background: var(--accent); transform: scale(1.3); }
.gallery-add-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

/* ========== MAIN CONTENT AREA ========== */
.main-content { padding: 40px 0; }
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* ========== DASHBOARD CARDS ========== */
.section-title {
    font-family: 'Source Serif 4', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.section-title i { color: var(--primary); }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}
.card-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 15px 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 20px; }

/* Enrolment stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.personnel-breakdown-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-box {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    border: 2px solid var(--border);
    transition: var(--transition);
}
.stat-box:hover { border-color: var(--primary); transform: translateY(-2px); }
.stat-box .stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}
.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-box.male .stat-num { color: var(--secondary); }
.stat-box.female .stat-num { color: #e91e8c; }

/* School enrolment table */
.enrolment-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.enrolment-table th {
    background: var(--primary-gradient);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
}
.enrolment-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
}
.enrolment-table tr:last-child td { border-bottom: none; }
.enrolment-table tr:hover td { background: var(--bg-light); }
.level-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}
.level-badge.elementary { background: #e3f2fd; color: #1565c0; }
.level-badge.secondary { background: #fce4ec; color: #c62828; }

/* ========== CALENDAR ========== */
.calendar-widget { font-size: 0.88rem; }
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--primary);
}
.cal-nav { background: none; border: none; cursor: pointer; color: var(--primary); font-size: 1rem; padding: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-name {
    text-align: center;
    font-weight: 700;
    color: var(--text-light);
    padding: 5px 0;
    font-size: 0.75rem;
}
.cal-day {
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.cal-day:hover { background: var(--bg-light); }
.cal-day.today { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.has-event { font-weight: 700; color: var(--primary); position: relative; }
.cal-day.has-event::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    margin: 2px auto 0;
}
.cal-day.today.has-event::after { background: #fff; }
.cal-day.other-month { opacity: 0.35; }

/* Events list */
.events-list { list-style: none; }
.event-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.event-item:last-child { border-bottom: none; }
.event-date-badge {
    background: var(--primary-gradient);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    min-width: 45px;
    flex-shrink: 0;
}
.event-date-badge .day { font-size: 1.2rem; font-weight: 800; display: block; }
.event-date-badge .month { font-size: 0.65rem; text-transform: uppercase; }
.event-info h5 { font-size: 0.9rem; font-weight: 700; margin-bottom: 3px; }
.event-info p { font-size: 0.78rem; color: var(--text-light); }

/* Quick Links */
.quick-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.quick-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-medium);
    font-size: 0.83rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.quick-link-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
}
.quick-link-item i { color: var(--primary); font-size: 1rem; flex-shrink: 0; }
.quick-link-item:hover i { color: #fff; }

/* ========== PAGES ========== */
.page-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 40px 0;
    margin-bottom: 40px;
}
.page-header h1 {
    font-family: 'Source Serif 4', serif;
    font-size: 2rem;
    margin-bottom: 5px;
}
.breadcrumb {
    font-size: 0.85rem;
    opacity: 0.85;
}
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Tabs */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 3px; }
.tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.tab-btn { white-space: nowrap; flex-shrink: 0; margin-bottom: 0; }
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.tab-btn.active, .tab-btn:hover { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll > table { margin-bottom: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
    background: var(--secondary);
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 700;
    position: sticky;
    top: 0;
}
.data-table td { padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-light); }
.data-table tr:last-child td { border-bottom: none; }
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.88rem;
    color: var(--text-medium);
}
.form-control, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: #fff;
    transition: var(--transition);
}
.form-control:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,99,10,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
}
.btn-primary:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.btn-secondary {
    background: var(--secondary);
    color: #fff;
}
.btn-secondary:hover { background: var(--secondary-light); }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: 7px 10px; }

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 35px;
    max-width: 550px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: translateY(20px);
    transition: var(--transition);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-lg { max-width: 800px; }
.modal-close {
    position: absolute;
    top: 15px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}
.modal-close:hover { color: var(--primary); }
.modal-header { text-align: center; margin-bottom: 25px; }
.modal-header img { height: 55px; margin-bottom: 10px; }
.modal-header h2 { font-family: 'Source Serif 4', serif; color: var(--secondary); }
.modal-header p { color: var(--text-light); font-size: 0.85rem; }
.modal h3 { margin-bottom: 20px; color: var(--primary-dark); }

/* Login modal */
.login-modal { max-width: 420px; }

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ========== ABOUT PAGE ========== */
.about-section { margin-bottom: 40px; }
.vmg-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.vmg-card-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}
.vmg-card-body { padding: 25px; font-size: 0.95rem; line-height: 1.8; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.directory-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
}
.directory-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin-bottom: 12px;
}
.directory-card .dir-name { font-weight: 700; margin-bottom: 4px; }
.directory-card .dir-position { font-size: 0.8rem; color: var(--text-light); }

/* ========== SCHOOL PAGE ========== */
.school-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 25px; }
.school-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
}
.school-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.school-card-header {
    background: var(--primary-gradient);
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}
.school-card-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
}
.school-card-body { padding: 18px; }
.school-info-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.87rem;
    color: var(--text-medium);
}
.school-info-row i { color: var(--primary); width: 16px; flex-shrink: 0; }

/* ========== ISSUANCES PAGE ========== */
.issuance-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.search-input { flex: 1; min-width: 200px; }
.year-select { width: 120px; }

/* ========== ADMIN DASHBOARD ========== */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 120px);
    gap: 0;
}
.admin-sidebar {
    background: var(--secondary);
    color: #fff;
    padding: 25px 0;
}
.admin-sidebar h3 {
    padding: 0 20px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: var(--transition);
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}
.sidebar-link i { width: 18px; text-align: center; }
.admin-main { padding: 30px; background: #f0f2f5; }
.admin-page-title {
    font-family: 'Source Serif 4', serif;
    font-size: 1.6rem;
    margin-bottom: 25px;
    color: var(--text-dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.admin-stat {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}
.admin-stat .stat-num { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.admin-stat .stat-label { color: var(--text-light); font-size: 0.82rem; font-weight: 600; text-transform: uppercase; }
.admin-stat.blue { border-left-color: var(--secondary); }
.admin-stat.blue .stat-num { color: var(--secondary); }
.admin-stat.green { border-left-color: #28a745; }
.admin-stat.green .stat-num { color: #28a745; }

/* Widget container */
.widgets-area { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-widget {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.admin-widget-header {
    background: var(--primary-gradient);
    color: #fff;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-widget-body { padding: 18px; }

/* Reading profile */
.reading-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}
.reading-bar-label { width: 120px; flex-shrink: 0; font-weight: 600; }
.reading-bar-track {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.reading-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--primary-gradient);
}
.reading-bar-val { width: 45px; text-align: right; font-weight: 700; color: var(--primary); }

/* ========== FOOTER ========== */
.site-footer { background: var(--text-dark); color: rgba(255,255,255,0.85); }
.footer-main { padding: 50px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 30px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.footer-brand img { height: 45px; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-brand strong { display: block; color: #fff; font-size: 0.95rem; }
.footer-brand span { font-size: 0.78rem; opacity: 0.7; }
.footer-mantra {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--accent);
    line-height: 1.6;
    margin-bottom: 12px;
}
.footer-col h4 {
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 7px; }
.footer-links a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.88rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary-light); }
.footer-col p { font-size: 0.85rem; margin-bottom: 8px; display: flex; align-items: flex-start; gap: 8px; }
.footer-col p i { color: var(--primary-light); margin-top: 2px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 18px 0;
    font-size: 0.8rem;
    opacity: 0.65;
    display: flex;
    align-items: center;
}
.footer-bottom .container { display: flex; justify-content: space-between; width: 100%; }

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 10px; }
.hidden { display: none !important; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-secondary { background: var(--secondary); color: #fff; }
.badge-success { background: #28a745; color: #fff; }
.badge-info { background: #17a2b8; color: #fff; }

/* Loading spinner */
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
}

@media (max-width: 768px) {
    /* ----- Layout & spacing ----- */
    .container { padding: 0 14px; }
    .card-body { padding: 14px; }
    .card-header { padding: 12px 14px; font-size: 0.92rem; }

    /* ----- Topbar: hide date, shrink greeting ----- */
    .topbar { font-size: 0.7rem; }
    .topbar .container { justify-content: center; }
    .topbar .container span:last-child { display: none; }

    /* ----- Brand: never push hamburger off-screen ----- */
    .brand-title {
        font-size: 0.92rem;
        max-width: calc(100vw - 110px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ----- Mobile nav ----- */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-gradient);
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
        gap: 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .nav-links.open { display: flex; }
    .hamburger { display: flex; }
    .nav-links > li > a {
        color: rgba(255,255,255,0.92) !important;
        padding: 13px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links > li:last-child > a { border-bottom: none; }
    .nav-links a:hover, .nav-links a.active {
        background: rgba(255,255,255,0.15) !important;
        color: #fff !important;
    }
    .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-top: none;
        background: rgba(0,0,0,0.18);
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0 0 6px 0;
    }
    .dropdown li a {
        color: rgba(255,255,255,0.85) !important;
        padding: 11px 20px 11px 36px;
        font-size: 0.84rem;
        border-bottom: none;
    }
    .dropdown li a:hover { background: rgba(255,255,255,0.12) !important; color: #fff !important; }
    .has-dropdown:hover .dropdown { display: none; }
    .has-dropdown.open .dropdown { display: block; }

    /* ----- Hero ----- */
    .hero-text h1 { font-size: 1.4rem; }
    .hero-logo { height: 80px; }

    /* ----- Grids collapse ----- */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    .footer-bottom .container { flex-direction: column; gap: 5px; text-align: center; }
    .widgets-area { grid-template-columns: 1fr; }
    .school-grid { grid-template-columns: 1fr; }
    .directory-grid { grid-template-columns: 1fr 1fr; }
    .content-grid { gap: 18px; }
    .stats-grid-4 { grid-template-columns: 1fr 1fr; }
    .personnel-breakdown-grid { grid-template-columns: 1fr; gap: 16px; }

    /* ----- Tables: smaller text; scrolling handled by .table-scroll wrapper (JS) ----- */
    .data-table th, .data-table td,
    .enrolment-table th, .enrolment-table td { font-size: 0.8rem; padding: 9px 10px; }

    /* ----- Forms: 16px inputs prevent iOS auto-zoom ----- */
    .form-control, input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], textarea, select {
        font-size: 16px;
        padding: 11px 13px;
    }
    .btn { min-height: 42px; }
    .btn-sm { min-height: 36px; }

    /* ----- Modals: fit small screens ----- */
    .modal-overlay { padding: 10px; align-items: flex-start; padding-top: 24px; }
    .modal { padding: 22px 16px; max-height: calc(100vh - 48px); border-radius: 12px; }
    .modal-lg { max-width: 100%; }

    /* ----- Gallery: smaller nav buttons & caption ----- */
    .gallery-nav { width: 34px; height: 34px; font-size: 0.8rem; }
    .gallery-nav.prev { left: 8px; }
    .gallery-nav.next { right: 8px; }
    .gallery-caption { padding: 36px 12px 10px; }
    .gallery-cap-title { font-size: 0.8rem; }
    .gallery-cap-text { font-size: 0.74rem; }
    .gallery-read-more { font-size: 0.74rem; }

    /* ----- Headings & page titles ----- */
    h2, .section-title { font-size: 1.25rem; }
    .page-header h1 { font-size: 1.4rem; }

    /* ----- Org chart: allow horizontal pan ----- */
    .org-chart { font-size: 0.72rem; }

    /* ----- Collapse hardcoded inline grids (catch-all for page markup) ----- */
    div[style*="grid-template-columns:repeat(3,1fr)"],
    div[style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
    div[style*="display:grid;grid-template-columns:1fr 1fr;"] { grid-template-columns: 1fr !important; }
    /* ...but stat-box rows stay multi-column (they're compact) */
    .stats-grid[style*="repeat(3,1fr)"] { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-box { padding: 12px 8px; }
    .stat-num { font-size: 1.25rem; }
    .stat-label { font-size: 0.66rem; }
    .directory-grid { grid-template-columns: 1fr; }
    .card-body { padding: 12px; }
    .modal { padding: 18px 14px; }
    h2, .section-title { font-size: 1.12rem; }
    .stats-grid[style*="repeat(3,1fr)"] { grid-template-columns: 1fr 1fr !important; }
    .stats-grid-4 { grid-template-columns: 1fr 1fr; }
    .brand-title { font-size: 0.84rem; }
}

/* ========== ORG CHART ========== */
.org-chart { font-size: 0.82rem; overflow-x: auto; padding: 10px 0; }
.org-level { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 0; position: relative; }
.org-level-connector {
    display: flex;
    justify-content: center;
    margin: 0;
}
.org-level-connector::before {
    content: '';
    display: block;
    width: 2px;
    height: 28px;
    background: var(--border);
}
.org-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.org-node::before {
    content: '';
    display: block;
    width: 2px;
    height: 20px;
    background: var(--border);
}
.org-node:first-child::before,
.org-node.org-root::before { display: none; }
.org-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    min-width: 130px;
    max-width: 180px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: var(--transition);
}
.org-card:hover { box-shadow: var(--shadow-hover); border-color: var(--primary); }
.org-card img {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
    border: 2px solid var(--border);
}
.org-card .org-name { font-weight: 700; font-size: 0.8rem; color: var(--text-dark); margin-bottom: 2px; }
.org-card .org-pos  { font-size: 0.7rem; color: var(--text-light); line-height: 1.3; }
.org-card.org-psds  { border-color: var(--secondary); background: #f0f4ff; }
.org-card.org-head  { border-color: var(--primary); }
.org-horizontal { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.org-row-connector {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 20px;
}
.org-row-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--border);
}

/* Personnel org card */
.personnel-org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 10px;
}
.personnel-org-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px 10px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}
.personnel-org-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.personnel-org-card img, .personnel-org-card .personnel-avatar {
    width: 62px; height: 62px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    display: block;
    border: 2px solid var(--border);
}
.personnel-avatar {
    background: var(--primary-gradient);
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}
.personnel-org-card .p-name { font-weight: 700; font-size: 0.78rem; color: var(--text-dark); margin-bottom: 3px; }
.personnel-org-card .p-pos  { font-size: 0.7rem; color: var(--text-light); line-height: 1.3; margin-bottom: 5px; }
.personnel-org-card .p-contact { font-size: 0.7rem; color: var(--primary); }

/* Personnel section headers */
.personnel-section-hdr {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 12px 0 6px;
    border-bottom: 1px solid var(--border);
    margin: 10px 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== CUSTOM BG support (set via inline style on body/section) ========== */
.bg-custom-img {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ========== ORG CHART SCHOOL ========== */
.school-org-wrap { padding: 10px 0; }
.school-org-top {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}
.school-org-children {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 20px;
    position: relative;
}
.school-org-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 20px;
    background: var(--border);
}

/* ========== RESPONSIVE BANNER ==========
   Mobile: same elements, rearranged — all logos on one centered
   row, text gets the full width below them. */
@media (max-width: 768px) {
    .hero-content {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 18px;
    }
    .hero-logos-left  { order: 1; }
    .hero-logos-right { order: 2; }
    .hero-text {
        order: 3;
        flex-basis: 100%;
        min-width: 100%;
        text-align: center;
    }
    .hero-logo    { height: 48px !important; }
    .hero-logo-sm { height: 40px !important; }
    .hero-deped    { font-size: 0.95rem; letter-spacing: 0.5px; }
    .hero-region   { font-size: 0.68rem; }
    .hero-division { font-size: 0.66rem; }
    .hero-district { font-size: 1.25rem; }
    .hero-actions  { display: none; }
    .hero-banner   { padding: 14px 0 !important; }
    .gallery-slide { height: 240px; }
}

@media (max-width: 480px) {
    .hero-logo    { height: 40px !important; }
    .hero-logo-sm { height: 34px !important; }
    .hero-deped    { font-size: 0.85rem; }
    .hero-region   { font-size: 0.62rem; }
    .hero-division { font-size: 0.6rem; }
    .hero-district { font-size: 1.1rem; margin-bottom: 0; }
    .hero-content  { gap: 4px 12px; }
    .hero-banner   { padding: 12px 0 !important; }
    .quick-links-grid { grid-template-columns: 1fr 1fr; }
}
