:root {
    --school-green: #0f8a3b;
    --school-green-dark: #08662b;
    --school-yellow: #ffd54a;
    --school-yellow-soft: #fff3bf;
    --body-bg: #f6fbf7;
    --card-bg: rgba(255,255,255,.78);
    --text-main: #17351f;
    --muted: #718276;
    --border-soft: rgba(15,138,59,.12);
    --shadow-soft: 0 20px 60px rgba(15, 138, 59, .14);
}

[data-bs-theme="dark"] {
    --body-bg: #09140d;
    --card-bg: rgba(20, 34, 25, .78);
    --text-main: #effaf1;
    --muted: #aebdb2;
    --border-soft: rgba(255,255,255,.12);
    --shadow-soft: 0 20px 60px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Noto Sans Thai', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top left, rgba(255,213,74,.24), transparent 32%), var(--body-bg);
    color: var(--text-main);
    overflow-x: hidden;
}
a { text-decoration: none; }
img { max-width: 100%; }

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    display: grid;
    place-items: center;
    transition: opacity .4s ease, visibility .4s ease;
}
.page-loader.loaded { opacity: 0; visibility: hidden; }
.loader-logo {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.25);
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.loader-logo.brand-logo-image {
    padding: 6px;
    background: rgba(255,255,255,.92);
    color: var(--school-green);
}
.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}


.topbar { background: var(--school-green-dark); color: #fff; }
.school-navbar {
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-soft);
}
[data-bs-theme="dark"] .school-navbar { background: rgba(9,20,13,.82); }
.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    color: #fff;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
    flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: .78rem; }
.nav-link { font-weight: 600; color: var(--text-main); }
.nav-link:hover { color: var(--school-green); }

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}
.shadow-soft { box-shadow: var(--shadow-soft); }
.min-vh-75 { min-height: 75vh; }
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15,138,59,.12), rgba(255,213,74,.16));
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: rgba(255,213,74,.26);
    right: -160px;
    top: -180px;
    filter: blur(8px);
}
.eyebrow, .section-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--school-green);
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .86rem;
}
.hero-title {
    font-size: clamp(2.4rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text-main);
}
.hero-subtitle { color: var(--school-green); font-weight: 700; font-size: 1.25rem; }
.hero-image { position: relative; padding: 1rem; }
.hero-image img { aspect-ratio: 4/3; object-fit: cover; }
.hero-badge {
    position: absolute;
    left: -16px;
    bottom: 36px;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1.1rem;
    background: #fff;
    color: var(--school-green-dark);
    border-radius: 20px;
    font-weight: 700;
}
.hero-badge i { font-size: 1.8rem; color: var(--school-yellow); }

.quick-card, .stat-card, .teacher-card, .news-card, .dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
}
.quick-card:hover, .teacher-card:hover, .news-card:hover, .dashboard-card:hover { transform: translateY(-6px); }
.quick-card { padding: 2rem; }
.quick-card i { font-size: 2.4rem; color: var(--school-green); }
.quick-card h5 { margin-top: 1rem; font-weight: 800; }
.quick-card p { color: var(--muted); margin-bottom: 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; }
.about-section, .staff-section { background: rgba(15,138,59,.06); }
.check-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.check-list li { margin-bottom: .8rem; padding-left: 2rem; position: relative; }
.check-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--school-green); font-weight: 800; }
.stat-card { padding: 1.5rem; text-align: center; }
.stat-card strong { display: block; font-size: 2.2rem; color: var(--school-green); }
.stat-card span { color: var(--muted); font-weight: 600; }
.news-card { overflow: hidden; height: 100%; }
.news-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.news-card-body { padding: 1.4rem; }
.news-card h5 { margin-top: .8rem; font-weight: 800; line-height: 1.45; }
.news-card h5 a { color: var(--text-main); }
.news-card p { color: var(--muted); }
.text-bg-success-soft { background: rgba(15,138,59,.12); color: var(--school-green); }
.teacher-card { padding: 1.2rem; text-align: center; }
.teacher-card img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; margin-bottom: 1rem; border: 5px solid rgba(255,213,74,.5); }
.teacher-card h5 { font-weight: 800; margin-bottom: .25rem; }
.teacher-card p { color: var(--school-green); font-weight: 700; margin-bottom: .25rem; }
.teacher-card span { color: var(--muted); font-size: .9rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.gallery-item { overflow: hidden; border-radius: 18px; display: block; }
.gallery-item img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.08); }
.footer-section { background: rgba(255,255,255,.45); border-top: 1px solid var(--border-soft); }
[data-bs-theme="dark"] .footer-section { background: rgba(255,255,255,.04); }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: var(--muted); }
.social-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 12px; background: rgba(15,138,59,.12); color: var(--school-green); }
.footer-bottom { background: rgba(15,138,59,.08); }
.page-header { padding: 5rem 0; background: linear-gradient(135deg, var(--school-green), #0fb454); color: #fff; }
.page-header h1 { font-size: clamp(2rem, 5vw, 4rem); font-weight: 800; }
.content-body { line-height: 1.9; font-size: 1.05rem; }

.auth-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, rgba(15,138,59,.24), rgba(255,213,74,.28)), var(--body-bg); }
.auth-wrapper { width: 100%; max-width: 520px; padding: 1rem; }
.auth-card { padding: 2.4rem; }
.auth-logo { display: inline-flex; align-items: center; gap: .75rem; color: var(--text-main); font-weight: 800; }

.admin-body { background: var(--body-bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 290px; background: linear-gradient(180deg, var(--school-green-dark), #053f1b); color: #fff; }
.sidebar-inner { padding: 1.2rem; height: 100%; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; color: #fff; margin-bottom: 1.5rem; }
.sidebar-brand small { display: block; opacity: .8; }
.sidebar-menu { display: grid; gap: .35rem; }
.sidebar-menu a { color: rgba(255,255,255,.86); padding: .85rem 1rem; border-radius: 16px; display: flex; gap: .7rem; align-items: center; font-weight: 600; }
.sidebar-menu a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-card { margin-top: auto; padding: 1rem; border-radius: 18px; background: rgba(255,255,255,.12); display: grid; gap: .25rem; }
.admin-main { flex: 1; min-width: 0; padding: 1.2rem; }
.admin-topbar { padding: 1rem 1.2rem; display: flex; align-items: center; gap: 1rem; border-radius: 24px; position: sticky; top: 1rem; z-index: 20; }
.admin-content { padding-top: 1.2rem; }
.dashboard-card { padding: 1.4rem; display: flex; align-items: center; justify-content: space-between; }
.dashboard-card span { color: var(--muted); font-weight: 600; }
.dashboard-card strong { display: block; font-size: 2rem; font-weight: 800; }
.dashboard-card i { font-size: 2.4rem; }
.table-thumb { width: 72px; height: 52px; object-fit: cover; border-radius: 12px; }
.preview-image { max-width: 220px; border-radius: 18px; box-shadow: var(--shadow-soft); }

[data-animate] { opacity: 0; transform: translateY(22px); transition: opacity .55s ease, transform .55s ease; }
[data-animate].is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 991.98px) {
    .admin-shell { display: block; }
    .admin-sidebar { width: 290px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-badge { left: 24px; bottom: 24px; }
}
@media (max-width: 575.98px) {
    .brand-text strong { font-size: .92rem; }
    .brand-text small { display: none; }
    .hero-section { padding: 2rem 0; }
    .quick-card { padding: 1.4rem; }
    .auth-card { padding: 1.5rem; }
    .admin-main { padding: .7rem; }
    .admin-topbar { align-items: flex-start; }
}

.banner-slide {
    min-height: clamp(360px, 58vw, 640px);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 6vw, 5rem);
}
.banner-caption { max-width: 720px; color: #fff; }
.banner-caption h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); font-weight: 800; line-height: 1.05; margin: .7rem 0 1rem; }
.banner-caption p { font-size: clamp(1.1rem, 2vw, 1.55rem); opacity: .92; }
.download-card { transition: transform .25s ease, box-shadow .25s ease; }
.download-card:hover { transform: translateY(-6px); }
.download-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(15,138,59,.12);
    color: var(--school-green);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.gallery-grid-wide { grid-template-columns: repeat(5, 1fr); }
.gallery-admin-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}
.sidebar-menu a i { min-width: 1.25rem; }
@media (max-width: 991.98px) { .gallery-grid-wide { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 575.98px) { .gallery-grid-wide { grid-template-columns: repeat(2, 1fr); } .banner-slide { min-height: 420px; } }

.info-mini-card,
.about-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 26px;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
    overflow: hidden;
}
.info-mini-card:hover,
.about-card:hover { transform: translateY(-6px); }
.info-mini-card { padding: 1.6rem; }
.info-mini-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15,138,59,.16), rgba(255,213,74,.35));
    color: var(--school-green);
    font-size: 1.7rem;
    margin-bottom: 1rem;
}
.info-mini-card h5 { font-weight: 800; }
.info-mini-card p,
.about-card-body p { color: var(--muted); margin-bottom: 0; }
.about-card-image { position: relative; }
.about-card-image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.about-card-image span {
    position: absolute;
    left: 1rem;
    bottom: -24px;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    color: #fff;
    box-shadow: var(--shadow-soft);
    font-size: 1.6rem;
}
.about-card-body { padding: 2.2rem 1.4rem 1.4rem; }
.school-info-cover { max-height: 430px; object-fit: cover; }
.school-info-content h2,
.school-info-content h3,
.school-info-content h4 { font-weight: 800; color: var(--school-green-dark); margin-top: 1.3rem; }
[data-bs-theme="dark"] .school-info-content h2,
[data-bs-theme="dark"] .school-info-content h3,
[data-bs-theme="dark"] .school-info-content h4 { color: var(--school-yellow); }
.school-info-content img { border-radius: 18px; box-shadow: var(--shadow-soft); }
.school-info-list .list-group-item { color: var(--text-main); border-color: var(--border-soft); }
.school-info-list .list-group-item:hover { color: var(--school-green); background: rgba(15,138,59,.08) !important; }
.breadcrumb-light .breadcrumb-item::before { color: rgba(255,255,255,.75); }

.brand-logo-image {
    padding: 4px;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border-soft);
}
.brand-logo-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
.sidebar-brand .brand-logo-image { background: rgba(255,255,255,.18); }
.school-logo-preview {
    width: 148px;
    height: 148px;
    border-radius: 34px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(135deg, rgba(15,138,59,.12), rgba(255,213,74,.28));
    display: grid;
    place-items: center;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.school-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.school-logo-preview span { font-size: 2.4rem; font-weight: 800; color: var(--school-green); }

.event-section {
    background: linear-gradient(135deg, rgba(15,138,59,.06), rgba(255,213,74,.12));
}
.calendar-card,
.event-mini-card,
.event-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
    transition: transform .25s ease, box-shadow .25s ease;
    overflow: hidden;
}
.calendar-card { padding: 1.5rem; }
.calendar-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.calendar-card-header i {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    color: #fff;
    font-size: 1.8rem;
}
.calendar-card-header strong { display: block; font-weight: 800; }
.calendar-card-header small { color: var(--muted); }
.event-timeline { display: grid; gap: .9rem; }
.event-timeline-item {
    position: relative;
    display: grid;
    gap: .2rem;
    padding: .85rem .9rem .85rem 2.4rem;
    border-radius: 18px;
    background: rgba(15,138,59,.06);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}
.event-timeline-item:hover { background: rgba(15,138,59,.11); }
.event-timeline-item .dot {
    position: absolute;
    left: .95rem;
    top: 1.15rem;
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(15,138,59,.08);
}
.event-timeline-item strong { font-weight: 800; }
.event-timeline-item small { color: var(--muted); }
.event-mini-card {
    display: flex;
    gap: 1rem;
    padding: 1.2rem;
}
.event-mini-card:hover,
.event-card:hover { transform: translateY(-6px); }
.event-mini-date,
.event-date-badge {
    background: var(--event-color, var(--school-green));
    color: #fff;
    box-shadow: var(--shadow-soft);
}
.event-mini-date {
    width: 74px;
    height: 74px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    line-height: 1;
}
.event-mini-date strong { display: block; font-size: 1.55rem; }
.event-mini-date span { font-size: .75rem; opacity: .92; }
.event-mini-card h5 { font-weight: 800; line-height: 1.4; }
.event-mini-card h5 a,
.event-card h5 a { color: var(--text-main); }
.event-mini-card p { color: var(--muted); margin-bottom: .5rem; }
.event-card-image { position: relative; }
.event-card-image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.event-date-badge {
    position: absolute;
    left: 1rem;
    bottom: -26px;
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    text-align: center;
    line-height: 1;
}
.event-date-badge strong { display: block; font-size: 1.6rem; }
.event-date-badge span { font-size: .78rem; opacity: .92; }
.event-card-body { padding: 2.4rem 1.4rem 1.4rem; }
.event-card-body h5 { font-weight: 800; line-height: 1.45; }
.event-card-body p { color: var(--muted); }
.event-meta { display: grid; gap: .35rem; }

@media (max-width: 575.98px) {
    .event-mini-card { flex-direction: column; }
    .event-mini-date { width: 64px; height: 64px; }
}

/* Calendar-only events module */
.school-calendar {
    border: 1px solid var(--border-soft);
    border-radius: 26px;
    overflow: hidden;
    background: var(--card-bg);
}
.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-weekdays div {
    padding: .85rem .5rem;
    text-align: center;
    font-weight: 800;
    color: var(--school-green-dark);
    background: linear-gradient(135deg, rgba(15,138,59,.10), rgba(255,213,74,.22));
    border-right: 1px solid var(--border-soft);
}
[data-bs-theme="dark"] .calendar-weekdays div { color: var(--school-yellow); }
.calendar-weekdays div:last-child { border-right: 0; }
.calendar-day {
    min-height: 132px;
    padding: .75rem;
    border-top: 1px solid var(--border-soft);
    border-right: 1px solid var(--border-soft);
    background: rgba(255,255,255,.36);
}
[data-bs-theme="dark"] .calendar-day { background: rgba(255,255,255,.035); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-empty { background: rgba(148,163,184,.07); }
.calendar-day.is-today {
    background: linear-gradient(135deg, rgba(15,138,59,.12), rgba(255,213,74,.18));
    box-shadow: inset 0 0 0 2px rgba(15,138,59,.32);
}
.calendar-day-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-weight: 900;
    color: var(--text-main);
    background: rgba(15,138,59,.08);
    margin-bottom: .55rem;
}
.calendar-day.is-today .calendar-day-number {
    background: var(--school-green);
    color: #fff;
}
.calendar-event-list { display: grid; gap: .45rem; }
.calendar-event-item {
    padding: .55rem .65rem;
    border-radius: 14px;
    background: rgba(15,138,59,.10);
    border: 1px solid rgba(15,138,59,.14);
    color: var(--text-main);
}
.calendar-event-item strong {
    display: block;
    font-size: .88rem;
    line-height: 1.35;
    font-weight: 800;
}
.calendar-event-item small {
    display: block;
    color: var(--muted);
    font-size: .76rem;
    margin-top: .25rem;
}
.school-calendar.home .calendar-day { min-height: 110px; padding: .55rem; }
.school-calendar.home .calendar-event-item strong,
.school-calendar.admin .calendar-event-item strong { font-size: .8rem; }
.school-calendar.home .calendar-event-item small,
.school-calendar.admin .calendar-event-item small { font-size: .72rem; }
.school-calendar.admin .calendar-day { min-height: 112px; }
.event-list-simple { display: grid; gap: .85rem; }
.event-list-item {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .85rem;
    border-radius: 18px;
    background: rgba(15,138,59,.07);
    border: 1px solid var(--border-soft);
}
.event-list-date {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    color: #fff;
    font-weight: 900;
    flex: 0 0 auto;
}
.event-list-item strong { display: block; font-weight: 800; line-height: 1.35; }
.event-list-item small { display: block; color: var(--muted); margin-top: .2rem; }

@media (max-width: 767.98px) {
    .school-calendar { border-radius: 20px; }
    .calendar-weekdays div { padding: .65rem .25rem; font-size: .8rem; }
    .calendar-day { min-height: 92px; padding: .45rem; }
    .calendar-day-number { width: 28px; height: 28px; border-radius: 10px; font-size: .85rem; }
    .calendar-event-item { padding: .42rem .48rem; border-radius: 12px; }
    .calendar-event-item strong { font-size: .72rem; }
    .calendar-event-item small { display: none; }
}

/* Google-like monthly activity calendar */
.gcal-calendar {
    width: 100%;
    overflow: hidden;
    border: 1px solid #dfe3ea;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}
[data-bs-theme="dark"] .gcal-calendar {
    background: rgba(17, 24, 39, .92);
    border-color: rgba(148, 163, 184, .25);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.gcal-toolbar {
    min-height: 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .35rem .6rem;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}
[data-bs-theme="dark"] .gcal-toolbar {
    background: rgba(30, 41, 59, .85);
    border-bottom-color: rgba(148, 163, 184, .25);
}
.gcal-toolbar-left,
.gcal-toolbar-right {
    display: flex;
    align-items: center;
    gap: .2rem;
}
.gcal-icon-btn,
.gcal-view-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #3f3f46;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.gcal-icon-btn:hover,
.gcal-view-icon.active,
.gcal-view-icon:hover {
    color: #111827;
    background: rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}
[data-bs-theme="dark"] .gcal-icon-btn,
[data-bs-theme="dark"] .gcal-view-icon { color: #e5e7eb; }
[data-bs-theme="dark"] .gcal-icon-btn:hover,
[data-bs-theme="dark"] .gcal-view-icon.active,
[data-bs-theme="dark"] .gcal-view-icon:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.gcal-title {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .45rem;
    margin-left: .35rem;
    border-radius: 10px;
    color: #111827;
    font-weight: 700;
    font-size: 1.12rem;
    text-decoration: none;
    line-height: 1.2;
}
.gcal-title:hover { background: rgba(15, 23, 42, .06); color: #111827; }
.gcal-title i { font-size: .62rem; color: #64748b; }
[data-bs-theme="dark"] .gcal-title,
[data-bs-theme="dark"] .gcal-title:hover { color: #f8fafc; }
.gcal-weekdays,
.gcal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.gcal-weekdays div {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .45rem .25rem;
    font-size: .78rem;
    font-weight: 700;
    color: #475569;
    background: #fff;
    border-right: 1px solid #e2e8f0;
}
.gcal-weekdays div:last-child { border-right: 0; }
[data-bs-theme="dark"] .gcal-weekdays div {
    background: rgba(17, 24, 39, .92);
    border-right-color: rgba(148, 163, 184, .22);
    color: #cbd5e1;
}
.gcal-day {
    min-height: 112px;
    padding: .28rem .34rem .45rem;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
}
.gcal-calendar.large .gcal-day { min-height: 142px; }
.gcal-calendar.admin .gcal-day { min-height: 120px; }
.gcal-day:nth-child(7n) { border-right: 0; }
.gcal-day.is-other-month { background: #fbfdff; color: #64748b; }
[data-bs-theme="dark"] .gcal-day {
    background: rgba(17, 24, 39, .92);
    border-color: rgba(148, 163, 184, .22);
}
[data-bs-theme="dark"] .gcal-day.is-other-month { background: rgba(15, 23, 42, .76); color: #94a3b8; }
.gcal-date-label {
    min-height: 30px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: .08rem;
}
.gcal-date-number {
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .22rem;
    border-radius: 999px;
    font-size: .88rem;
    line-height: 1;
    color: #111827;
    white-space: nowrap;
}
.gcal-day.is-other-month .gcal-date-number { color: #64748b; }
.gcal-day.is-today .gcal-date-number {
    color: #fff;
    background: #1967d2;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(25, 103, 210, .25);
}
[data-bs-theme="dark"] .gcal-date-number { color: #f8fafc; }
[data-bs-theme="dark"] .gcal-day.is-other-month .gcal-date-number { color: #94a3b8; }
.gcal-event-list {
    display: grid;
    gap: .18rem;
    align-items: start;
}
.gcal-event-pill {
    min-height: 18px;
    max-width: 100%;
    display: block;
    padding: .05rem .32rem;
    border-radius: 4px;
    background: #8f95dc;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(79, 70, 229, .18);
}
.gcal-empty-state {
    padding: 1rem;
    text-align: center;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
[data-bs-theme="dark"] .gcal-empty-state {
    color: #94a3b8;
    background: rgba(17, 24, 39, .92);
    border-top-color: rgba(148, 163, 184, .22);
}
.gcal-calendar.home .gcal-toolbar { min-height: 40px; }
.gcal-calendar.home .gcal-title { font-size: 1rem; }
.gcal-calendar.home .gcal-day { min-height: 96px; padding: .24rem .28rem .38rem; }
.gcal-calendar.home .gcal-event-pill,
.gcal-calendar.admin .gcal-event-pill { font-size: .72rem; }

@media (max-width: 991.98px) {
    .gcal-calendar.large .gcal-day { min-height: 120px; }
}
@media (max-width: 767.98px) {
    .gcal-calendar { border-radius: 18px; }
    .gcal-toolbar { padding: .28rem .45rem; }
    .gcal-title { font-size: .95rem; margin-left: .15rem; }
    .gcal-icon-btn,
    .gcal-view-icon { width: 30px; height: 30px; }
    .gcal-weekdays div { font-size: .68rem; padding: .38rem .1rem; }
    .gcal-day,
    .gcal-calendar.large .gcal-day,
    .gcal-calendar.home .gcal-day,
    .gcal-calendar.admin .gcal-day {
        min-height: 78px;
        padding: .18rem .2rem .3rem;
    }
    .gcal-date-number { min-width: 24px; height: 24px; font-size: .76rem; }
    .gcal-event-pill { font-size: .64rem; padding: .03rem .22rem; }
}
@media (max-width: 420px) {
    .gcal-toolbar-right { display: none; }
    .gcal-weekdays div { font-size: .62rem; }
    .gcal-day,
    .gcal-calendar.large .gcal-day,
    .gcal-calendar.home .gcal-day,
    .gcal-calendar.admin .gcal-day { min-height: 64px; }
    .gcal-event-pill { font-size: .58rem; }
}

/* Visitor statistics */
.visitor-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 10%, rgba(255, 213, 74, .18), transparent 28%),
        linear-gradient(135deg, rgba(15, 138, 59, .06), rgba(255, 213, 74, .08));
}
.visitor-stats-panel {
    padding: clamp(1.25rem, 3vw, 2.25rem);
    position: relative;
    overflow: hidden;
}
.visitor-stats-panel::after {
    content: '';
    position: absolute;
    right: -80px;
    bottom: -120px;
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: rgba(15, 138, 59, .08);
    pointer-events: none;
}
.visitor-stat-card {
    position: relative;
    z-index: 1;
    min-height: 150px;
    padding: 1.15rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    border-radius: 24px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--border-soft);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
[data-bs-theme="dark"] .visitor-stat-card {
    background: rgba(15, 23, 42, .55);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}
.visitor-stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(15, 138, 59, .26);
    box-shadow: 0 24px 54px rgba(15, 138, 59, .16);
}
.visitor-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    margin-bottom: .75rem;
    color: #fff;
    background: linear-gradient(135deg, var(--school-green), var(--school-yellow));
    box-shadow: 0 14px 28px rgba(15, 138, 59, .20);
}
.visitor-stat-card strong {
    display: block;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
    line-height: 1;
    font-weight: 900;
    color: var(--text-main);
}
.visitor-stat-card span {
    display: block;
    margin-top: .45rem;
    color: var(--muted);
    font-weight: 700;
}
@media (max-width: 575.98px) {
    .visitor-stat-card { min-height: 132px; padding: 1rem; }
    .visitor-stat-icon { width: 38px; height: 38px; border-radius: 14px; }
}

/* Admin: Home section ordering */
.home-section-table tbody tr {
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.home-section-table tbody tr.is-dragging {
    opacity: .65;
    transform: scale(.995);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .12);
}

.section-drag-handle {
    cursor: grab;
}

.section-drag-handle:active {
    cursor: grabbing;
}

.home-section-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(25, 135, 84, .16), rgba(255, 193, 7, .22));
    color: var(--bs-success);
    font-size: 1.25rem;
    flex: 0 0 46px;
}

/* Intro video setting and home section */
.video-card {
    border-radius: 24px;
    border: 1px solid var(--border-soft);
}
.video-card iframe {
    border: 0;
}
.video-placeholder {
    min-height: 220px;
    background: linear-gradient(135deg, rgba(25, 135, 84, .08), rgba(255, 193, 7, .14));
    border: 1px dashed rgba(25, 135, 84, .28);
}
[data-bs-theme="dark"] .video-placeholder {
    background: rgba(15, 23, 42, .42);
    border-color: rgba(255, 255, 255, .14);
}

/* Clear image banner module */
.hero-section-clean {
    background: linear-gradient(135deg, rgba(15,138,59,.08), rgba(255,213,74,.12));
}
.home-banner-carousel .carousel-inner {
    border: 1px solid var(--border-soft);
}
.banner-slide-clear {
    position: relative;
    width: 100%;
    min-height: clamp(320px, 38vw, 620px);
    background: #111827;
    overflow: hidden;
}
.banner-image-clear,
.banner-image-link {
    display: block;
    width: 100%;
    height: 100%;
}
.banner-image-clear {
    min-height: clamp(320px, 38vw, 620px);
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
    filter: none;
    transform: none;
}
.banner-caption-glass {
    position: absolute;
    left: clamp(1rem, 4vw, 3rem);
    bottom: clamp(1rem, 4vw, 3rem);
    max-width: min(720px, calc(100% - 2rem));
    padding: clamp(1rem, 2.5vw, 1.7rem);
    border-radius: 28px;
    background: rgba(4, 32, 16, .58);
    border: 1px solid rgba(255,255,255,.20);
    color: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
    backdrop-filter: blur(12px);
}
.banner-caption-glass h1 {
    font-size: clamp(1.55rem, 4vw, 3.6rem);
    font-weight: 900;
    line-height: 1.12;
    margin-bottom: .55rem;
    text-shadow: 0 3px 16px rgba(0,0,0,.28);
}
.banner-caption-glass p {
    font-size: clamp(1rem, 1.55vw, 1.3rem);
    margin-bottom: 0;
    opacity: .96;
}
.banner-control {
    width: 4.5rem;
}
.banner-control .carousel-control-prev-icon,
.banner-control .carousel-control-next-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 1.25rem;
    border-radius: 999px;
    background-color: rgba(0,0,0,.35);
    background-size: 1.1rem;
}
.banner-table-thumb {
    width: 104px;
    height: 56px;
    border-radius: 14px;
}
.banner-preview-admin {
    max-width: 360px;
    width: 100%;
    aspect-ratio: 16/7;
    object-fit: cover;
}
@media (max-width: 575.98px) {
    .banner-slide-clear,
    .banner-image-clear {
        min-height: 260px;
    }
    .banner-caption-glass {
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        max-width: none;
        border-radius: 20px;
    }
}
