:root {
  --brand: #0d6e6e;
  --brand-dark: #084c4c;
  --accent: #f2b84b;
  --navy: #102a43;
  --soft: #f3f8fa;
}
* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; color: #23313f; background: #fff; }
a { text-decoration: none; }
img { max-width: 100%; height: auto; }
.topbar, .footer-section { background: linear-gradient(90deg, var(--brand-dark), var(--navy)); }
.topbar .container { align-items: center; }
.topbar .container > div,
.topbar .container span { min-width: 0; overflow-wrap: anywhere; }
.text-primary-brand { color: var(--brand); }
.site-logo { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.navbar-brand { min-width: 0; max-width: min(100%, calc(100vw - 110px)); white-space: normal; }
.navbar-brand > div { min-width: 0; }
.navbar-brand .fw-bold,
.navbar-brand small { display: block; white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
.navbar-brand .fw-bold { font-size: 1.15rem; }
.navbar-toggler { flex-shrink: 0; }
.nav-link { font-weight: 500; }
.btn-brand { background: var(--brand); color: #fff; border-radius: 999px; padding: .7rem 1.2rem; }
.btn-brand:hover { background: var(--brand-dark); color: #fff; }
.hero-section { background: linear-gradient(rgba(16,42,67,.74), rgba(13,110,110,.56)), url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1600&q=80') center/cover; color: #fff; }
.hero-card, .feature-card, .news-card, .teacher-card, .gallery-card, .stats-card, .admin-card { background: #fff; border-radius: 22px; box-shadow: 0 16px 35px rgba(13, 35, 67, .08); border: 0; }
.feature-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; background: rgba(13,110,110,.1); color: var(--brand); font-size: 1.8rem; }
.section-title small { color: var(--brand); text-transform: uppercase; font-weight: 700; letter-spacing: .1em; }
.section-title h2 { margin-bottom: 0; }
.section-light { background: var(--soft); }
.badge-brand { background: rgba(242,184,75,.18); color: #7a5400; }
.card-img-top.cover { height: 220px; object-fit: cover; }
.teacher-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 22px 22px 0 0; }
.gallery-thumb { width: 100%; height: 240px; object-fit: cover; border-radius: 22px; }
.info-box { background: #fff; border-left: 5px solid var(--accent); border-radius: 18px; }
.footer-links a { color: rgba(255,255,255,.84); display: inline-block; padding: .2rem 0; }
.footer-links a:hover { color: #fff; }
.article-content img, .article-content iframe { max-width: 100%; height: auto; }
.article-content iframe { width: 100%; min-height: 380px; }
.admin-sidebar { min-height: 100vh; background: linear-gradient(180deg, var(--navy), var(--brand-dark)); }
.admin-sidebar a { color: rgba(255,255,255,.9); display: block; padding: .8rem 1rem; border-radius: 14px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(255,255,255,.12); color: #fff; }
.login-wrap { min-height: 100vh; background: linear-gradient(135deg, var(--navy), var(--brand)); }
.table img { object-fit: cover; }
.form-label { font-weight: 600; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--navy); }

@media (max-width: 991.98px) {
  .hero-section { text-align: center; }
  .hero-card { margin-top: .5rem; }
  .article-content iframe { min-height: 220px; }
  .navbar-collapse { padding-top: 1rem; }
  .navbar-nav { align-items: stretch !important; gap: .25rem !important; }
  .navbar-nav .nav-link,
  .navbar-nav .btn { width: 100%; }
  .navbar-nav .btn { margin-top: .5rem; }
}

@media (max-width: 767.98px) {
  .topbar { font-size: .875rem; }
  .topbar .container,
  .topbar .container > div,
  .topbar .container .d-flex { display: flex; flex-direction: column; align-items: flex-start !important; gap: .35rem !important; }
  .navbar { padding-top: .75rem; padding-bottom: .75rem; }
  .navbar-brand { max-width: calc(100vw - 92px); align-items: flex-start !important; }
  .site-logo { width: 44px; height: 44px; }
  .navbar-brand .fw-bold { font-size: 1rem; }
  .navbar-brand small { font-size: .78rem; }
  .hero-section .container { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .hero-section .display-5 { font-size: clamp(2rem, 7vw, 2.7rem); line-height: 1.2; }
  .hero-section .lead { font-size: 1rem; }
  .hero-section .badge { white-space: normal; }
  .hero-section .d-flex { flex-direction: column; align-items: stretch; }
  .hero-section .d-flex .btn { width: 100%; }
  .section-title h2,
  .d-flex .section-title h2 { font-size: 1.6rem; line-height: 1.25; }
  .card-img-top.cover { height: 200px; }
  .gallery-thumb { height: 190px; }
  .footer-section .d-flex { flex-direction: column; align-items: flex-start !important; }
}

@media (max-width: 575.98px) {
  .topbar { padding-top: .65rem !important; padding-bottom: .65rem !important; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  .hero-card,
  .feature-card,
  .news-card,
  .teacher-card,
  .gallery-card,
  .stats-card,
  .admin-card,
  .info-box { border-radius: 18px; }
  .section-title { margin-bottom: 1rem; }
  .d-flex.justify-content-between.align-items-end { align-items: flex-start !important; flex-direction: column; gap: 1rem; }
  .d-flex.justify-content-between.align-items-end .btn { width: 100%; }
  .stat-number { font-size: 1.75rem; }
}
