/* ============================================================
   Anurima School — Global Design System
   Subject grounding: a school's daily rhythm — timetables,
   ruled notebook pages, the red-pen mark a teacher leaves on
   good work. Not generic "education" globe/cap iconography.
   ============================================================ */

/* ============================================================
   Anurima — Global Design System
   Subject grounding: an academic partner to 175+ schools,
   not a school itself. Clean, data-driven, internationally
   credible — closer to an IB/Cambridge-style curriculum body
   than a local school site. The storytelling identity is kept,
   but expressed with restraint: chapter-style section labels
   and a single narrative "thread" line, not playful scribbles.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400..600;1,6..72,400..500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Palette ---- */
  --indigo:     #1B2430; /* Ink — primary text / headings / nav */
  --indigo-ink: #11161D; /* darker Ink for hover/pressed */
  --marigold:   #B8902E; /* Gold — used sparingly, stats + small highlights */
  --marigold-deep: #93701F;
  --paper:      #FAFAF8; /* warm white background */
  --paper-line: #E3E0D6; /* hairline divider color */
  --forest:     #2F5D50; /* Pine — single accent, CTAs / links */
  --charcoal:   #333B46; /* body text (Slate) */
  --rose:       #B6483F; /* alerts / admin accent */
  --white:      #FFFFFF;

  /* ---- Type ---- */
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* ---- Layout ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 2px 14px rgba(27, 36, 48, 0.06);
  --shadow-pop:  0 10px 30px rgba(27, 36, 48, 0.14);
  --container-w: 1140px;
}

/* ---- Reset ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--indigo); text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--indigo);
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 64px 0; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--marigold-deep);
  font-weight: 600;
  margin-bottom: 0.6em;
}
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---- Signature element: a thin gold rule under key headings ----
   Restrained version of the old hand-drawn scribble — same
   wrapper class, used by existing pages, now reads as a single
   deliberate underscore rather than a playful squiggle. */
.scribble-wrap { position: relative; display: inline-block; }
.scribble-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.22em;
  height: 3px;
  background: var(--marigold);
}

/* ---- Chapter label: the storytelling identity, expressed as
   a report's section marker rather than decoration. Used for
   the homepage's narrative-chapter structure. ---- */
.chapter-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--marigold-deep);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.8em;
}
.chapter-label::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--marigold-deep);
  display: inline-block;
}

/* ---- Narrative thread: a single vertical line connecting
   chapter sections, evoking a continuous story running through
   the page. Deliberately thin and quiet. ---- */
.thread-section { position: relative; }
.thread-section::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--paper-line);
}
@media (max-width: 720px) { .thread-section::before { display: none; } }

/* ---- Stats band: report-style metric strip, mono numerals ---- */
.stats-band {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--paper-line);
  border-bottom: 1px solid var(--paper-line);
}
.stats-band .stat {
  flex: 1 1 200px;
  padding: 28px 24px;
  border-right: 1px solid var(--paper-line);
}
.stats-band .stat:last-child { border-right: none; }
.stats-band .stat-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--indigo);
  letter-spacing: -0.01em;
}
.stats-band .stat-label {
  font-size: 0.82rem;
  color: var(--charcoal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* ---- Ruled-notebook divider (used between public sections) ---- */
.ruled-divider {
  height: 28px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    var(--paper-line) 28px
  );
  background-color: transparent;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--marigold); color: var(--indigo-ink); }
.btn-primary:hover { background: var(--marigold-deep); }
.btn-outline { background: transparent; color: var(--paper); border: 1.5px solid var(--paper); }
.btn-outline:hover { background: rgba(250, 246, 239, 0.12); }
.btn-dark { background: var(--indigo); color: var(--white); }
.btn-dark:hover { background: var(--indigo-ink); }
.btn-danger { background: var(--rose); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card-flat {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid #ECE4D2;
}

/* ---- Badges / status pills ---- */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-active   { background: #E4F0E7; color: var(--forest); }
.badge-suspended{ background: #F6E3E3; color: var(--rose); }
.badge-admin    { background: #F6E3E3; color: var(--rose); }
.badge-teacher  { background: #E4E3F0; color: var(--indigo); }
.badge-student  { background: #FBEBD3; color: var(--marigold-deep); }

/* ---- Forms ---- */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #E0D7C2;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--charcoal);
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--marigold);
  outline: none;
}
.field-hint { font-size: 0.78rem; color: #6B6880; margin-top: -10px; margin-bottom: 16px; }

/* ---- Alerts / flash messages ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
}
.alert-success { background: #E4F0E7; color: var(--forest); }
.alert-error   { background: #F6E3E3; color: var(--rose); }

/* ---- Public site navbar ---- */
.navbar {
  background: var(--indigo);
  padding: 16px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  flex-shrink: 0;
}
.logo-mark img { display: block; height: 26px; width: auto; }
.navbar-links { display: flex; gap: 28px; align-items: center; }
.navbar-links a { color: var(--paper); font-weight: 500; font-size: 0.93rem; }
.navbar-links a:hover { color: var(--marigold); }

/* ---- Hero (torn-paper edge instead of generic gradient) ---- */
.hero {
  background: var(--indigo);
  color: var(--paper);
  padding: 80px 0 110px;
  position: relative;
}
.hero h1 { color: var(--paper); }
.hero-sub { font-size: 1.1rem; color: #C9C6DC; max-width: 540px; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
/* Torn paper edge at the bottom of the hero, transitioning into --paper */
.hero-tear {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 36px;
  background: var(--paper);
  clip-path: polygon(
    0% 100%, 0% 40%, 4% 60%, 8% 30%, 13% 55%, 18% 20%, 23% 50%,
    28% 35%, 33% 60%, 38% 25%, 43% 50%, 48% 30%, 53% 55%, 58% 20%,
    63% 50%, 68% 35%, 73% 58%, 78% 25%, 83% 50%, 88% 30%, 93% 55%,
    97% 35%, 100% 50%, 100% 100%
  );
}

/* ---- Footer ---- */
footer {
  background: var(--indigo-ink);
  color: #B9B6CC;
  padding: 48px 0 28px;
  font-size: 0.88rem;
}
footer a { color: #D8D5E8; }
footer a:hover { color: var(--marigold); }
.footer-cols { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; margin-bottom: 24px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 18px; text-align: center; color: #8C89A3; }

/* ============================================================
   Dashboard shell (admin / teacher / student)
   ============================================================ */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 230px;
  background: var(--indigo);
  color: var(--paper);
  flex-shrink: 0;
  padding: 24px 0;
}
.dash-sidebar-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  padding: 0 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.dash-sidebar-role {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--marigold);
  display: block;
  margin-top: 4px;
}
.dash-nav a {
  display: block;
  padding: 11px 24px;
  color: #C9C6DC;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.dash-nav a:hover { background: rgba(255,255,255,0.06); color: var(--paper); }
.dash-nav a.active {
  background: rgba(232, 163, 61, 0.12);
  border-left-color: var(--marigold);
  color: var(--paper);
}
.dash-main { flex: 1; padding: 32px 36px; max-width: 100%; }
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
@media (max-width: 900px) { .dash-stats { grid-template-columns: repeat(2, 1fr); } .dash-main { padding: 24px 18px; } .dash-shell { flex-direction: column; } .dash-sidebar { width: 100%; } }
.dash-stat-num { font-family: var(--font-display); font-size: 2rem; color: var(--indigo); }
.dash-stat-label { font-size: 0.82rem; color: #6B6880; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-md); overflow: hidden; }
th, td { padding: 12px 16px; text-align: left; font-size: 0.88rem; border-bottom: 1px solid #F0EAD9; }
th { background: #F4EFE2; color: var(--indigo); font-weight: 600; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.table-wrap table { box-shadow: none; }

/* ---- Misc utilities ---- */
.text-center { text-align: center; }
.muted { color: #6B6880; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
