/* ============================================
   Animet Ltd — School Directory Styles
   Retains original color themes with improved layout
   ============================================ */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* CSS Variables */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface2: #ede8df;
  --border: #d9d0c0;
  --navy: #1a2c4e;
  --navy-dark: #0e1d35;
  --gold: #c9a227;
  --gold-light: #faf6eb;
  --gold-dark: #a8861e;
  --text: #1a1a1a;
  --text-muted: #5c5a55;
  --text-light: #8a857c;
  --wa-green: #25D366;
  --wa-dark: #128C7E;
  --red: #b83227;
  --green: #1a6b3a;
  --shadow: 0 2px 20px rgba(26, 44, 78, 0.08);
  --shadow-lg: 0 8px 40px rgba(26, 44, 78, 0.14);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0d1420;
  --surface: #151f2e;
  --surface2: #1c2a3d;
  --border: #2a3d57;
  --navy: #2d4a73;
  --navy-dark: #0a111d;
  --gold: #d4b44a;
  --gold-light: #1f1a0d;
  --gold-dark: #e8c96a;
  --text: #eef2f7;
  --text-muted: #8fa3be;
  --text-light: #5c738f;
  --shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Playfair Display', serif; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--gold); color: #fff; }

img { max-width: 100%; height: auto; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ============================================
   Navigation
   ============================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  gap: 4px;
}

.brand-animet { color: var(--gold); }
.brand-ltd { color: var(--navy); }

.nav-links-desktop { display: flex; align-items: center; gap: 12px; }

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover { color: var(--navy); background: var(--surface2); }

.nav-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--navy);
  padding: 8px 18px;
  border-radius: 10px;
  transition: var(--transition);
}

.nav-cta:hover { background: var(--navy-dark); }

.nav-login-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  padding: 8px 18px;
  border-radius: 10px;
  transition: var(--transition);
}

.nav-login-btn:hover { background: var(--navy); color: #fff; }

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 3px 12px;
  cursor: pointer;
  font-family: inherit;
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background var(--transition);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}

[data-theme="dark"] .theme-toggle-track { background: var(--navy); }
[data-theme="dark"] .theme-toggle-thumb { background: var(--gold); transform: translateX(18px); }

.theme-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }

/* Mobile Nav */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 12px 24px 16px;
  gap: 4px;
  background: var(--surface);
}

.mobile-menu.active { display: flex; }

.mobile-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
}

.mobile-link:hover { background: var(--surface2); color: var(--navy); }

@media (max-width: 767px) {
  .nav-links-desktop { display: none; }
  .mobile-toggle { display: block; }
}

/* ============================================
   Layout
   ============================================ */

/*.container { max-width: 1200px; margin: 0 auto; padding: 0 10px; }
.section { padding: 56px 24px; }
.section-lg { padding: 72px 24px; } */

.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 1rem;
}

.section {
    padding-block: 3.5rem;
}

.section-lg {
    padding-block: 4.5rem;
}

/* ============================================
   Hero Banner
   ============================================ */

.hero-banner {
  background: var(--navy);
  padding: 48px 24px 52px;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
}

.hero-title em { color: var(--gold); font-style: normal; }

.hero-subtitle {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

@media (max-width: 767px) {
  .hero-title { font-size: 1.6rem; }
  .hero-stats { gap: 24px; }
}

/* ============================================
   Search Card
   ============================================ */

.search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -34px;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
}

.search-input-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color var(--transition);
}

.search-input-wrap:focus-within { border-color: var(--gold); }

.search-input {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
}

.search-input::placeholder { color: var(--text-light); }

/* Form Controls */
.form-select, .form-input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  min-width: 160px;
}

.form-select:focus, .form-input:focus { border-color: var(--navy); }

/* ============================================
   Section Headers
   ============================================ */

.section-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 10px;
}

.section-tag-line {
  height: 1px;
  width: 40px;
  background: var(--gold);
  opacity: 0.5;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 24px;
}

/* ============================================
   School Cards Grid
   ============================================ */

.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.school-card {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.school-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--navy), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.school-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.school-card:hover::before { transform: scaleX(1); }

.school-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.school-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: var(--navy);
}

.school-card:nth-child(3n) .school-avatar { background: var(--green); }
.school-card:nth-child(3n+2) .school-avatar { background: var(--gold); }

.school-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  flex: 1;
  transition: color var(--transition);
}

.school-card:hover .school-name { color: var(--gold); }

.curriculum-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--gold-light);
  color: var(--gold-dark);
  width: fit-content;
}

.school-branches {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
}

.school-branches strong { color: var(--navy); }

/* ============================================
   FAQ Section
   ============================================ */

.faq-container { max-width: 800px; margin: 0 auto; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }

.faq-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover { border-color: var(--gold); }

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: color var(--transition);
}

.faq-item.active .faq-question { color: var(--gold); }

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-chevron { transform: rotate(180deg); color: var(--gold); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer-inner {
  padding: 0 20px 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.active .faq-answer { max-height: 600px; }

/* ============================================
   School Detail Page
   ============================================ */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: var(--transition);
}

.back-btn:hover { border-color: var(--navy); color: var(--navy); }

.detail-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--navy);
  line-height: 1.2;
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.detail-pill {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--gold-light);
  color: var(--gold-dark);
}

.detail-pill.secondary { background: var(--surface2); color: var(--text-muted); }

/* Branch Cards */
.branch-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 14px;
}

.branch-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.branch-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  transition: var(--transition);
  flex-wrap: wrap;
}

.branch-card:hover {
  transform: translateX(4px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.branch-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.branch-info { flex: 1; min-width: 180px; }

.branch-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.branch-phone { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.branch-hours { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }

.branch-actions { display: flex; gap: 8px; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); }

.btn-gold { background: var(--gold-light); color: var(--navy); border: 1px solid var(--gold); }
.btn-gold:hover { background: var(--gold); color: #fff; }

/* Bulk Orders Banner */
.bulk-banner {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 16px;
  margin: 20px 0;
}

.bulk-banner p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }
.bulk-banner a { color: var(--navy); font-weight: 600; }

.bulk-contacts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }

.bulk-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}

.bulk-contact strong { color: var(--text); }
.bulk-contact em { font-size: 0.75rem; color: var(--text-muted); font-style: normal; }

.bulk-wa {
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.3);
}

/* Hours Note */
.hours-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hours-note svg { flex-shrink: 0; margin-top: 2px; color: var(--gold); }
.hours-note strong { color: var(--text); }

/* Detail Actions */
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn-detail {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-detail-primary { background: var(--navy); color: #fff; }
.btn-detail-primary:hover { background: var(--navy-dark); }

.btn-detail-primary:disabled {
  background: var(--surface2);
  color: var(--text-muted);
  cursor: default;
  opacity: 0.7;
}

.btn-detail-secondary { background: var(--gold); color: #fff; }
.btn-detail-secondary:hover { background: var(--gold-dark); }

/* ============================================
   Contact Page
   ============================================ */

.contact-hero { background: var(--navy); padding: 48px 24px 40px; text-align: center; }
.contact-hero .hero-title { text-align: center; }
.contact-hero .hero-subtitle { max-width: 520px; margin: 0 auto; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: -20px;
  position: relative;
  z-index: 10;
}

@media (max-width: 767px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
}

.contact-card:hover { border-color: var(--red); }

.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.contact-icon.whatsapp { background: var(--wa-green); }
.contact-icon.phone { background: var(--navy); }
.contact-icon.email { background: var(--red); }
.contact-icon.location { background: #6b4c9a; }

.contact-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}

.contact-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-top: auto;
}

.btn-whatsapp { background: var(--wa-green); color: #fff; }
.btn-whatsapp:hover { background: var(--wa-dark); }

.btn-email { background: var(--red); color: #fff; }
.btn-email:hover { opacity: 0.9; }

.hours-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hours-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.hours-banner strong { color: #fff; font-size: 0.95rem; }
.hours-banner span { color: rgba(255,255,255,0.6); font-size: 0.85rem; }

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.branch-card-sm {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}

.branch-card-sm:hover {
  transform: translateY(-2px);
  border-color: var(--red);
  box-shadow: var(--shadow-lg);
}

.branch-card-sm .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.branch-card-sm .name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}

/* ============================================
   Admin Dashboard
   ============================================ */

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.admin-nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav-left { display: flex; align-items: center; gap: 10px; }

.admin-nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.admin-nav-brand .gold { color: var(--gold); }

.admin-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--navy);
  color: #fff;
}

.admin-nav-right { display: flex; align-items: center; gap: 12px; }

.btn-logout {
  padding: 7px 14px;
  border: 1.5px solid var(--red);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover { background: var(--red); color: #fff; }

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2d4a73);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

/* Admin Header */
.admin-header {
  background: var(--navy);
  padding: 36px 24px 32px;
}

.admin-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.admin-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: #fff;
}

.admin-header p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  max-width: 480px;
  margin-top: 6px;
}

.admin-stats-inline {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.admin-stat-inline .number {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.admin-stat-inline .number.green { color: #4ade80; }
.admin-stat-inline .number.gold { color: var(--gold); }
.admin-stat-inline .label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-number.navy { color: var(--navy); }
.stat-number.green { color: var(--green); }
.stat-number.gold { color: var(--gold); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Filter Row */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.filter-row .search-input-wrap { flex: 1; min-width: 220px; }

.btn-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1.5px solid var(--border);
}

.btn-filter-secondary {
  background: var(--surface2);
  color: var(--text-muted);
}

.btn-filter-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Schools Table */
.schools-table { display: flex; flex-direction: column; gap: 10px; }

/* Table Header */
.schools-table-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.schools-table-header + .school-row {
  border-radius: 0 0 var(--radius) var(--radius);
}

.schools-table-header + .school-row:not(:last-child) {
  border-radius: 0;
}

.header-cell {
  flex-shrink: 0;
  text-align: center;
}

.header-avatar {
  width: 40px;
  flex-shrink: 0;
}

.header-info {
  flex: 1;
  min-width: 180px;
  text-align: left;
}

.header-status {
  min-width: 80px;
}

.header-branches {
  min-width: 100px;
  max-width: 140px;
}

.header-qr {
  min-width: 40px;
}

.header-downloads {
  min-width: 50px;
}

.header-brochure {
  min-width: 80px;
}

.header-actions {
  min-width: 200px;
  margin-left: auto;
  text-align: right;
}

/* Responsive table headers */
@media (max-width: 1023px) {
  .header-branches,
  .header-downloads {
    display: none;
  }
  .header-status,
  .header-qr,
  .header-brochure {
    min-width: auto;
    padding: 0 4px;
  }
  .header-actions {
    min-width: 140px;
  }
}

@media (max-width: 767px) {
  .header-status,
  .header-qr,
  .header-brochure,
  .header-downloads,
  .header-branches {
    display: none;
  }
  .header-actions {
    min-width: auto;
    margin-left: 0;
    text-align: left;
  }
  .schools-table-header {
    padding: 10px 14px;
  }
}


.school-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  transition: var(--transition);
  flex-wrap: wrap;
}

.school-row:hover {
  border-color: var(--gold);
  transform: translateX(2px);
}

.school-row.has-brochure { border-color: rgba(26, 107, 58, 0.3); }

.row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.row-info { flex: 1; min-width: 180px; }
.row-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.row-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 50px;
  flex-shrink: 0;
}

.status-pill.linked { background: #d4edda; color: #155724; }
.status-pill.none { background: var(--surface2); color: var(--text-light); }

.row-actions { display: flex; gap: 8px; margin-left: auto; }

.btn-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-row-edit { background: var(--navy); color: #fff; }
.btn-row-edit:hover { background: var(--navy-dark); }
.btn-row-edit.green { background: var(--green); }

.btn-row-delete {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
}

.btn-row-delete:hover { background: var(--red); color: #fff; }

/* ============================================
   Pagination
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); }
.page-btn:disabled { opacity: 0.4; cursor: default; }
.page-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0d1b2e 0%, #1a2c4e 60%, #3d3420 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(26, 44, 78, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
  animation: cardSlideIn 0.5s ease-out;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
}

.login-brand .gold { color: var(--gold); }

.login-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  margin-top: -12px;
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  text-align: center;
  color: var(--navy);
  margin-bottom: 4px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Password field with eye icon inside */
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .form-input,
.password-wrap input[type="password"],
.password-wrap input[type="text"] {
  width: 100%;
  padding: 12px 44px 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.password-wrap .form-input:focus,
.password-wrap input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 44, 78, 0.1);
}

[data-theme="dark"] .password-wrap .form-input:focus,
[data-theme="dark"] .password-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(45, 74, 115, 0.2);
}

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.toggle-pw:hover {
  color: var(--navy);
  background: var(--surface2);
}

.toggle-pw:active {
  transform: translateY(-50%) scale(0.95);
}

/* Email input styling */
.form-group > .form-input,
.form-group > input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group > .form-input:focus,
.form-group > input[type="email"]:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26, 44, 78, 0.1);
}

[data-theme="dark"] .form-group > .form-input:focus,
[data-theme="dark"] .form-group > input[type="email"]:focus {
  box-shadow: 0 0 0 3px rgba(45, 74, 115, 0.2);
}

.form-group > .form-input::placeholder,
.password-wrap input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}

/* Login extras row */
.login-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--navy);
  cursor: pointer;
  border-radius: 4px;
}

.forgot-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.forgot-link:hover {
  color: var(--gold);
  text-decoration: underline;
}

[data-theme="dark"] .forgot-link {
  color: var(--gold);
}

[data-theme="dark"] .forgot-link:hover {
  color: var(--gold-dark);
}

/* Field errors */
.field-error {
  font-size: 0.78rem;
  color: var(--red);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-error::before {
  content: '⚠';
  font-size: 0.9rem;
}

.form-error {
  font-size: 0.85rem;
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fdecea;
  border: 1px solid #f5c6cb;
  color: #a93226;
  animation: shakeIn 0.3s ease-out;
}

@keyframes shakeIn {
  0% { transform: translateX(-8px); opacity: 0; }
  50% { transform: translateX(4px); }
  100% { transform: translateX(0); opacity: 1; }
}

.btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 4px;
}

.btn-submit:hover {
  background: var(--navy-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 44, 78, 0.25);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-back {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-back:hover {
  background: var(--surface2);
  color: var(--navy);
  border-color: var(--navy);
}

.login-hint {
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
  .login-brand { font-size: 1.4rem; }
  .login-title { font-size: 1.3rem; }
  .login-extras { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ============================================
   Modal (School Edit)
   ============================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.98);
  animation: modalIn 0.25s forwards;
}

@keyframes modalIn { to { transform: scale(1); } }

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--navy);
  padding: 20px 28px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #fff;
  margin: 0;
}

.modal-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 50px;
  margin-top: 4px;
  background: var(--surface2);
  color: var(--text-light);
}

.modal-status.linked { background: #d4edda; color: #155724; }

.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

.modal-close:hover { color: #fff; }

.modal-body { padding: 28px; }

.form-row { margin-bottom: 20px; }

.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.form-row .form-input,
.form-row .form-select { width: 100%; }

.form-help {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toggle-label input { width: 16px; height: 16px; accent-color: var(--green); }

/* Branch Checkboxes */
.branch-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.branch-check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.branch-check-label:has(input:checked) {
  border-color: var(--navy);
  background: rgba(26, 44, 78, 0.06);
  color: var(--navy);
}

[data-theme="dark"] .branch-check-label:has(input:checked) {
  background: rgba(45, 74, 115, 0.15);
  color: var(--text);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg);
  transition: var(--transition);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--navy);
  background: rgba(26, 44, 78, 0.04);
}

.drop-zone-title { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.drop-zone-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 12px;
}

.file-info.new { background: var(--surface2); border: 1px solid var(--border); }
.file-info.existing { background: rgba(26, 107, 58, 0.07); border: 1px solid rgba(26, 107, 58, 0.25); }

.file-name { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.file-size { font-size: 0.75rem; color: var(--text-muted); }
.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.file-warning {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer .btn-cancel {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}

.modal-footer .btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition);
}

.modal-footer .btn-save:hover { background: var(--navy-dark); }

/* ============================================
   Delete Modal
   ============================================ */

.delete-modal .modal-box { max-width: 420px; padding: 32px 28px; text-align: center; }

.delete-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fdecea;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--red);
}

.delete-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 8px;
}

.delete-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.delete-desc .name { color: var(--red); font-weight: 600; }

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  max-width: 400px;
}

.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }
.toast.info { background: var(--navy); color: #fff; }

/* ============================================
   Loading & Back to Top
   ============================================ */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--navy-dark); transform: translateY(-2px); }

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg { margin: 0 auto 16px; color: var(--text-light); }
.empty-state h3 { font-family: 'Playfair Display', serif; color: var(--navy); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 16px; }
.empty-state button {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}

.footer-container { max-width: 1200px; margin: 0 auto; text-align: center; }

.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.footer-brand-ltd { color: var(--gold); }

.footer-copy { font-size: 0.82rem; color: var(--text-muted); }
.footer-copy a { color: var(--text-muted); }
.footer-copy a:hover { text-decoration: underline; }

.footer-line {
  height: 1px;
  max-width: 200px;
  margin: 16px auto 0;
  background: var(--gold);
  opacity: 0.2;
}

.footer-powered {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.footer-powered a {
    color: var(--gold-dark);
    text-decoration: none;
}
.footer-powered a:hover {
    text-decoration: underline;
}

/* ============================================
   Admin Sidebar
   ============================================ */

.admin-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 150;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-sidebar.no-transition {
  transition: none !important;
}

.admin-sidebar.open {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
.sidebar-inner:hover::-webkit-scrollbar-thumb { background: var(--border); }

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  background: var(--surface2);
  color: var(--navy);
}

.sidebar-item.active {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.sidebar-item.active svg { stroke: #fff; }

.sidebar-item svg {
  flex-shrink: 0;
  color: currentColor;
  stroke: currentColor;
}

/* Submenu Toggle */
.sidebar-toggle-submenu {
  justify-content: flex-start;
}

.sidebar-toggle-submenu .submenu-chevron {
  margin-left: auto;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.sidebar-toggle-submenu[aria-expanded="true"] .submenu-chevron {
  transform: rotate(90deg);
}

/* Submenu */
.sidebar-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 44px;
  animation: submenuSlide 0.2s ease-out;
}

.sidebar-submenu.open {
  display: flex;
}

@keyframes submenuSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar-subitem:hover {
  background: var(--surface2);
  color: var(--navy);
}

.sidebar-subitem.active {
  background: rgba(26, 44, 78, 0.08);
  color: var(--navy);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-subitem.active {
  background: rgba(45, 74, 115, 0.15);
  color: var(--text);
}

.subitem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.sidebar-subitem:hover .subitem-dot,
.sidebar-subitem.active .subitem-dot {
  background: var(--navy);
}

[data-theme="dark"] .sidebar-subitem.active .subitem-dot {
  background: var(--gold);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2d4a73);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 1px;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 140;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-sidebar.open ~ .sidebar-overlay {
  opacity: 1;
  visibility: visible;
}

/* Main Content Area */
.admin-main {
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar.open ~ .admin-main {
  margin-left: 260px;
}

/* Sidebar Toggle Button in Nav */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-right: 4px;
}

.sidebar-toggle:hover {
  background: var(--surface2);
  color: var(--navy);
}

.sidebar-toggle:active {
  transform: scale(0.95);
}

/* ============================================
   User Popup (Google-style)
   ============================================ */

.user-menu-wrap {
  position: relative;
}

.admin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2d4a73);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}

.admin-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 12px rgba(26, 44, 78, 0.25);
}

.admin-avatar:active {
  transform: scale(0.98);
}

/* Google-style popup */
.user-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
  animation: popupSlide 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-popup-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
}

.user-popup-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), #2d4a73);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-popup-info {
  min-width: 0;
  overflow: hidden;
}

.user-popup-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popup-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-popup-divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.user-popup-actions {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
}

.user-popup-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.user-popup-item:hover {
  background: var(--surface2);
  color: var(--navy);
}

.user-popup-item svg {
  flex-shrink: 0;
  color: var(--text-light);
  stroke: var(--text-light);
  transition: color var(--transition-fast);
}

.user-popup-item:hover svg {
  color: var(--navy);
  stroke: var(--navy);
}

/* ============================================
   Admin Nav Adjustments
   ============================================ */

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0;
}

.admin-nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-nav-left { display: flex; align-items: center; gap: 8px; }

/* ============================================
   Admin Row Columns & QR Button
   ============================================ */

.row-col-status,
.row-col-branches,
.row-col-qr,
.row-col-downloads,
.row-col-brochure {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  min-width: 80px;
  flex-shrink: 0;
}

.row-col-branches {
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.row-col-downloads {
  font-weight: 600;
  color: var(--navy);
  min-width: 50px;
}

.row-col-qr {
  min-width: 40px;
}

.qr-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.qr-status.yes {
  background: #d4edda;
  color: #155724;
}

.qr-status.no {
  background: #fdecea;
  color: #a93226;
}

/* QR Button */
.btn-row-qr {
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1.5px solid var(--gold);
}

.btn-row-qr:hover {
  background: var(--gold);
  color: #fff;
}

/* Responsive columns */
@media (max-width: 1023px) {
  .row-col-branches,
  .row-col-downloads {
    display: none;
  }
  .row-col-status,
  .row-col-qr,
  .row-col-brochure {
    min-width: auto;
    padding: 0 4px;
  }
}

@media (max-width: 767px) {
  .row-col-status,
  .row-col-qr {
    display: none;
  }
  .row-actions {
    margin-left: 0;
    width: 100%;
    margin-top: 8px;
  }
  .row-actions .btn-row {
    flex: 1;
    justify-content: center;
  }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 250;
    top: 0;
    width: 280px;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.2);
  }
  .admin-main {
    margin-left: 0 !important;
  }
  .sidebar-toggle {
    display: flex;
  }
}

@media (min-width: 1024px) {
  .admin-sidebar {
    transform: translateX(0);
    box-shadow: none;
  }
  .admin-sidebar.closed {
    transform: translateX(-100%);
  }
  .admin-main {
    margin-left: 260px;
  }
  .admin-sidebar.closed ~ .admin-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay {
    display: none;
  }
}

@media (max-width: 767px) {
  .section { padding: 40px 16px; }
  .detail-card { padding: 20px; }
  .detail-title { font-size: 1.4rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .schools-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-row .search-input-wrap { min-width: 100%; }
  .school-row { padding: 12px 14px; }
  .row-actions { margin-left: 0; width: 100%; margin-top: 8px; }
  .row-actions .btn-row { flex: 1; justify-content: center; }
  .login-card { padding: 28px 20px; }
  .modal-box { max-width: 100%; }
  .admin-header-inner { flex-direction: column; }
  .admin-stats-inline { width: 100%; justify-content: space-between; }
  .user-popup { width: 280px; right: -10px; }
  .admin-nav-inner { padding: 0 16px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .schools-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar.open ~ .admin-main {
    margin-left: 0;
  }
}

@media (min-width: 1024px) {
  .schools-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .schools-grid { grid-template-columns: repeat(4, 1fr); }
}