/* ============================================================
   SKPS – Sanskar Kids Public School | Kid-friendly theme
   ============================================================ */
:root {
  --primary: #1d4ed8;
  --primary-dark: #16368f;
  --primary-light: #eaf1ff;
  --accent: #ff8a00;
  --accent-dark: #e07400;
  --accent-light: #fff3e0;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #facc15;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f6f8fc;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --font: 'Segoe UI', 'Trebuchet MS', Verdana, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
.container { width: min(1150px, 92%); margin: 0 auto; }

h1, h2, h3, h4 { line-height: 1.25; }
.section { padding: 56px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head h2 { font-size: 1.9rem; color: var(--primary-dark); }
.section-head h2 span { color: var(--accent); }
.section-head p { color: var(--muted); margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  font-weight: 700; font-size: .95rem; border: 2px solid transparent;
  cursor: pointer; transition: .2s; text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn-light { background: #fff; color: var(--primary); }

/* ---------- Topbar ---------- */
.topbar { background: var(--primary-dark); color: #dbe6ff; font-size: .82rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; gap: 10px; flex-wrap: wrap; }
.topbar-left span, .topbar-right span { margin-right: 16px; }
.topbar-admin { color: var(--yellow); font-weight: 600; margin-left: 10px; }
.topbar-admin:hover { text-decoration: underline; }

/* ---------- Header / Nav ---------- */
.site-header { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 56px; height: 56px; }
.brand-name { display: block; font-weight: 800; color: var(--primary-dark); font-size: 1.12rem; line-height: 1.2; }
.brand-tag { display: block; font-size: .74rem; color: var(--accent); font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 9px 13px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: .93rem; }
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }
.main-nav a.active { background: var(--primary); color: #fff; }
.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; font-size: 1.6rem; background: none; border: 0; color: var(--primary-dark); cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  background: linear-gradient(120deg, rgba(22,54,143,.92), rgba(29,78,216,.82)),
              url('../img/hero-bg.svg') center/cover no-repeat;
  padding: 96px 0 110px;
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.9rem); margin-bottom: 14px; }
.hero p { font-size: 1.08rem; max-width: 640px; margin: 0 auto 28px; color: #e3ecff; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.hero-badges span {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Hero slider ---------- */
.hero-slider { position: relative; height: clamp(420px, 62vh, 640px); overflow: hidden; background: var(--primary-dark); }
.hero-slider .slides { position: absolute; inset: 0; }
.hero-slider .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; visibility: hidden; transform: scale(1.06);
  transition: opacity .9s ease, transform 6.5s linear, visibility 0s linear .9s;
}
.hero-slider .slide.active { opacity: 1; visibility: visible; transform: scale(1); transition-delay: 0s; z-index: 1; }
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(10,20,60,.78) 0%, rgba(15,42,117,.55) 45%, rgba(15,42,117,.12) 100%);
  display: flex; align-items: center;
}
.slide-content { text-align: left; color: #fff; max-width: 760px; }
.slide-content h1 { font-size: clamp(1.6rem, 4.2vw, 2.9rem); margin-bottom: 12px; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.slide-content p { font-size: clamp(.95rem, 1.6vw, 1.12rem); color: #e3ecff; max-width: 560px; margin-bottom: 24px; }
.slide-content .hero-actions { justify-content: flex-start; }
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--primary-dark); font-size: 1.15rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: .2s;
}
.slider-arrow:hover { background: var(--accent); color: #fff; }
.slider-arrow.prev { left: 18px; }
.slider-arrow.next { right: 18px; }
.slider-dots { position: absolute; bottom: 18px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 9px; }
.slider-dots .dot {
  width: 11px; height: 11px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.5); transition: .25s;
}
.slider-dots .dot.active { background: var(--accent); width: 30px; border-radius: 999px; }

/* ---------- Cards / grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; transition: .2s; border: 1px solid transparent;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary-light); }
.card h3 { color: var(--primary-dark); margin-bottom: 8px; font-size: 1.08rem; }
.card p { color: var(--muted); font-size: .93rem; }

.icon-circle {
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-light); color: var(--accent-dark); margin-bottom: 16px;
}
.icon-circle svg { width: 28px; height: 28px; }
.icon-circle.blue { background: var(--primary-light); color: var(--primary); }

/* stats */
.stats-band { background: linear-gradient(120deg, var(--primary-dark), var(--primary)); color: #fff; padding: 44px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat b { font-size: 2rem; display: block; color: var(--yellow); }
.stat span { font-size: .9rem; color: #dbe6ff; }

/* ---------- Page banner ---------- */
.page-banner {
  background: linear-gradient(120deg, rgba(22,54,143,.94), rgba(29,78,216,.85)), url('../img/hero-bg.svg') center/cover;
  color: #fff; text-align: center; padding: 54px 0;
}
.page-banner h1 { font-size: 2rem; }
.page-banner .crumb { color: #cfe0ff; font-size: .9rem; margin-top: 6px; }
.page-banner .crumb a { color: var(--yellow); }

/* ---------- Tables / forms ---------- */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
.table th { background: var(--primary-light); color: var(--primary-dark); font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.table tr:hover td { background: #fafcff; }

.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: .88rem; }
.form-group label .req { color: var(--red); }
.form-group input, .form-group select, .form-group textarea {
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .95rem; background: #fcfdff; transition: .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hint { font-size: .8rem; color: var(--muted); }

/* compact inline forms (fee generation etc.) */
.inline-form .form-grid { grid-template-columns: 1fr 1fr auto; align-items: end; }
.inline-form .form-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr auto; }

/* alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: .92rem; font-weight: 500; }
.alert-success { background: #e7f8ee; color: #14713a; border: 1px solid #b8e8c9; }
.alert-danger  { background: #fdeaea; color: #a51f1f; border: 1px solid #f5c2c2; }
.alert-warning { background: #fff7e0; color: #8a6100; border: 1px solid #f3ddA0; }

/* badges */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-success { background: #e7f8ee; color: #14713a; }
.badge-warning { background: #fff3d6; color: #92600a; }
.badge-danger  { background: #fdeaea; color: #a51f1f; }
.badge-info    { background: #e5f0ff; color: #1d4ed8; }

/* notices list */
.notice-item { display: flex; gap: 16px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin-bottom: 14px; }
.notice-date {
  flex: 0 0 64px; height: 64px; border-radius: 12px; background: var(--primary-light);
  color: var(--primary-dark); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
}
.notice-date b { font-size: 1.3rem; line-height: 1; }
.notice-date span { font-size: .68rem; text-transform: uppercase; }
.notice-item h3 { font-size: 1.02rem; color: var(--primary-dark); }
.notice-item h3 .tag { font-size: .68rem; background: var(--accent-light); color: var(--accent-dark); padding: 2px 9px; border-radius: 99px; margin-left: 8px; vertical-align: middle; }
.notice-item p { color: var(--muted); font-size: .9rem; margin-top: 4px; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.gallery-item { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.gallery-item img { width: 100%; height: 190px; object-fit: cover; transition: .3s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption { padding: 10px 14px; font-size: .88rem; font-weight: 600; color: var(--primary-dark); }

/* contact page */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 36px; }
.contact-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; text-align: center; }
.contact-card .icon-circle { margin: 0 auto 14px; }
.map-box { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 30px; }
.map-box iframe { width: 100%; height: 320px; border: 0; display: block; }

/* ---------- CTA strip / footer ---------- */
.cta-strip { background: linear-gradient(120deg, var(--accent), #ff6a00); color: #fff; padding: 34px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.cta-inner h3 { font-size: 1.35rem; }
.cta-inner p { color: #ffeeda; }

.footer { background: #101a33; color: #b9c4dd; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 34px; padding: 48px 0 34px; }
.footer h4 { color: #fff; margin-bottom: 14px; font-size: 1.02rem; }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.footer-brand img { width: 46px; height: 46px; }
.footer-brand h4 { margin: 0; }
.footer-brand p { color: var(--accent); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.footer-about { font-size: .88rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: #b9c4dd; font-size: .9rem; }
.footer-links a:hover { color: var(--yellow); }
.footer-contact { list-style: none; font-size: .9rem; }
.footer-contact li { margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid #223054; padding: 16px 0; font-size: .82rem; text-align: center; color: #7f8db1; }

/* ---------- ADMIN ---------- */
body.admin { background: #eef2f9; }
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #101a33; color: #cbd6ef; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: #2a3c66 transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a3c66; border-radius: 4px; }
.sidebar .side-brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid #223054; }
.sidebar .side-brand img { width: 40px; height: 40px; }
.sidebar .side-brand b { color: #fff; font-size: .95rem; display: block; line-height: 1.2; }
.sidebar .side-brand small { color: var(--accent); font-size: .68rem; text-transform: uppercase; letter-spacing: .5px; }
.side-nav { padding: 14px 10px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; color: #cbd6ef;
  padding: 10px 13px; border-radius: 9px; font-size: .9rem; font-weight: 500; margin-bottom: 3px;
}
.side-nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.side-nav a:hover { background: #1b2a4d; color: #fff; }
.side-nav a.active { background: var(--primary); color: #fff; }
.side-nav .nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: #5f6f96; margin: 14px 10px 6px; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: #fff; padding: 14px 26px; display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 8px rgba(0,0,0,.05); position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 1.15rem; color: var(--primary-dark); }
.admin-topbar .who { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 26px; max-width: 1200px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; display: flex; gap: 15px; align-items: center; }
.stat-card .icon-circle { margin: 0; width: 50px; height: 50px; }
.stat-card b { font-size: 1.5rem; display: block; line-height: 1.1; }
.stat-card span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-card.link { transition: .2s; }
.stat-card.link:hover { transform: translateY(-3px); }

.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 1.05rem; color: var(--primary-dark); margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions a, .row-actions button { padding: 5px 11px; border-radius: 7px; font-size: .76rem; font-weight: 700; border: 0; cursor: pointer; }
.act-view { background: #e5f0ff; color: var(--primary); }
.act-edit { background: #fff3d6; color: #92600a; }
.act-del { background: #fdeaea; color: #a51f1f; }
.act-ok { background: #e7f8ee; color: #14713a; }
.act-wa { background: #dcfce7; color: #15803d; }
.act-wa::before { content: "\1F4AC "; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, rgba(22,54,143,.95), rgba(29,78,216,.85)), url('../img/hero-bg.svg') center/cover;
  padding: 24px;
}
.login-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 38px 34px; width: 100%; max-width: 400px; text-align: center; }
.login-card img { width: 74px; height: 74px; margin: 0 auto 12px; }
.login-card h1 { font-size: 1.3rem; color: var(--primary-dark); margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.login-card .form-group { text-align: left; margin-bottom: 15px; }
.login-card .btn { width: 100%; }

/* gallery admin thumb */
.thumb { width: 86px; height: 60px; object-fit: cover; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-3, .grid-4, .contact-cards, .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid, .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    padding: 12px 5%; box-shadow: 0 12px 20px rgba(0,0,0,.1); gap: 4px;
  }
  .main-nav.open { display: flex; }
  /* Mobile: icon-only menu rail stays on the LEFT */
  .admin-layout { flex-direction: row; }
  .sidebar { width: 62px; min-width: 62px; height: 100vh; position: sticky; top: 0; overflow-y: auto; overflow-x: hidden; }
  .sidebar .side-brand { padding: 10px 4px; justify-content: center; }
  .sidebar .side-brand img { width: 36px; height: 36px; }
  .sidebar .side-brand b, .sidebar .side-brand small { display: none; }
  .side-nav { flex-direction: column; flex-wrap: nowrap; overflow-x: hidden; padding: 8px 6px; gap: 4px; }
  .side-nav a { justify-content: center; gap: 0; padding: 12px 0; font-size: 0; position: relative; border-radius: 10px; }
  .side-nav a svg { width: 21px; height: 21px; }
  .side-nav .nav-label { display: none; }
  .side-nav a > span { position: absolute !important; top: 3px; right: 5px; margin-left: 0 !important; padding: 1px 6px !important; font-size: .6rem !important; }
  .admin-topbar { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .admin-topbar .who { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .form-grid, .contact-cards, .gallery-grid, .stats-grid, .stat-cards, .footer-grid { grid-template-columns: 1fr; }
  .inline-form .form-grid, .inline-form .form-grid.cols-4 { grid-template-columns: 1fr; }
  .topbar-left span:nth-child(2) { display: none; }
  .admin-content { padding: 16px; }
  .admin-topbar { padding: 12px 16px; }
}

/* ---------- Hero slider: mobile & touch ---------- */
@media (max-width: 768px) {
  .hero-slider { height: min(80vh, 540px); }
  .hero-slider .slide { transform: none; transition: opacity .8s ease, visibility 0s linear .8s; }
  .hero-slider .slide.active { transform: none; }
  .slide-overlay {
    background: linear-gradient(180deg, rgba(10,20,60,.30) 0%, rgba(10,20,60,.55) 55%, rgba(10,20,60,.88) 100%);
    align-items: flex-end;
  }
  .slide-content { padding-bottom: 56px; }
  .slide-content p { margin-bottom: 18px; }
  .slide-content .hero-actions { justify-content: flex-start; }
  .slide-content .btn { padding: 11px 18px; font-size: .95rem; }
  .slider-arrow { display: none; }
  .slider-dots { bottom: 16px; }
}
@media (hover: none) and (pointer: coarse) {
  .hero-slider { touch-action: pan-y; }
}
