/* /home/k12/public/assets/css/school.css
   Cloudflare-inspired design system: flat surfaces, 1px borders, 4px radii,
   Inter typography, blue links, restrained orange accents, and dense tables. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --p: #0f2c59;
  --s: #f59e0b;
  --a: #0d9488;
  --d: #091933;

  --bg: #f7f7f7;
  --card: #ffffff;
  --ink: #1d1d1d;
  --body: #404040;
  --muted: #6b6b6b;
  --border: #d9d9d9;
  --border-light: #e8e8e8;
  --border-strong: #bdbdbd;
  --link: #0051c3;
  --green: #1b7f4b;
  --red: #bd1d1d;
  --amber: #b35c00;

  --radius: 4px;
  --radius-sm: 3px;
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.16);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-family: var(--font);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.font-serif { font-family: var(--font) !important; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--ink);
  background: #f2f2f2;
  border-radius: 2px;
  padding: 1px 4px;
}

.k-ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   LOADER
   ------------------------------------------------------------------------- */
#k12-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(29, 29, 29, 0.55);
}
#k12-loader.active { display: flex; }
#k12-loader img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  padding: 4px;
  animation: k12Pulse 0.85s ease-in-out infinite;
}
#k12-loader span {
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@keyframes k12Pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.85; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* -------------------------------------------------------------------------
   TOP NAVIGATION
   ------------------------------------------------------------------------- */
.sch-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}
.sch-nav-inner {
  max-width: 1200px;
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sch-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.sch-brand:hover { text-decoration: none; }
.sch-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.sch-brand-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.sch-brand-motto {
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.sch-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  padding: 7px 10px;
  border-radius: 3px;
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--ink);
  background: #f2f2f2;
  text-decoration: none;
}
.term-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 4px 0 9px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--body);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.term-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 6px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--link);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.term-edit:hover { background: #f0f7ff; }

/* -------------------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------------------- */
.sbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.sbtn:hover {
  background: #f7f7f7;
  border-color: var(--border-strong);
  text-decoration: none;
}
.sbtn:active { background: #f0f0f0; }
.sbtn:focus-visible {
  outline: 2px solid rgba(0, 81, 195, 0.45);
  outline-offset: 1px;
}
.sbtn-primary {
  background: var(--p);
  border-color: var(--p);
  color: #fff;
}
.sbtn-primary:hover {
  background: color-mix(in srgb, var(--p) 88%, #000 12%);
  border-color: color-mix(in srgb, var(--p) 88%, #000 12%);
  color: #fff;
}
.sbtn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}
.sbtn-secondary:hover { background: #f7f7f7; }
.sbtn-accent {
  background: #fff;
  border-color: #b6cdea;
  color: var(--link);
}
.sbtn-accent:hover { background: #f0f7ff; border-color: #8bb4e8; }
.sbtn-light {
  background: #fff;
  border-color: var(--border);
  color: var(--ink);
}
.sbtn-light:hover { background: #f7f7f7; }
.sbtn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}
.sbtn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.7);
}
.sbtn-danger {
  background: #fff;
  border-color: #efc4c4;
  color: var(--red);
}
.sbtn-danger:hover { background: #fdf2f2; border-color: #e5a5a5; }
.sbtn-cta {
  background: var(--s);
  border-color: var(--s);
  color: #1d1d1d;
}
.sbtn-cta:hover {
  background: color-mix(in srgb, var(--s) 90%, #000 10%);
  border-color: color-mix(in srgb, var(--s) 90%, #000 10%);
  color: #1d1d1d;
}
.sbtn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 3px;
}

.sch-hero .sbtn-secondary {
  background: var(--s);
  border-color: var(--s);
  color: #1d1d1d;
}
.sch-hero .sbtn-secondary:hover {
  background: color-mix(in srgb, var(--s) 90%, #000 10%);
  border-color: color-mix(in srgb, var(--s) 90%, #000 10%);
  color: #1d1d1d;
}
.sch-nav .sbtn-primary {
  background: var(--s);
  border-color: var(--s);
  color: #1d1d1d;
}
.sch-nav .sbtn-primary:hover {
  background: color-mix(in srgb, var(--s) 90%, #000 10%);
  border-color: color-mix(in srgb, var(--s) 90%, #000 10%);
  color: #1d1d1d;
}

/* -------------------------------------------------------------------------
   CLAIM BANNER
   ------------------------------------------------------------------------- */
.claim-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: #1d1d1d;
  border-bottom: 1px solid #333;
  color: #fff;
  font-size: 12.5px;
}

/* -------------------------------------------------------------------------
   PUBLIC HERO
   ------------------------------------------------------------------------- */
.sch-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 24px 72px;
  background-color: var(--d);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  border-bottom: 3px solid var(--s);
  color: #fff;
}
.sch-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 2px;
  background: transparent;
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-eyebrow-main { display: inline-flex; align-items: center; gap: 7px; }
.hero-eyebrow-edit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 3px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 2px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.hero-eyebrow-edit:hover { background: rgba(255, 255, 255, 0.1); }
.sch-hero h1 {
  max-width: 620px;
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(36px, 4.2vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.sch-hero p {
  max-width: 540px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 16px;
  line-height: 1.65;
}
.hero-media-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: var(--d);
}
.hero-carousel { height: 360px; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease;
}
.hero-slide.active { opacity: 1; visibility: visible; z-index: 1; }
.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-slide img.hero-contain { object-fit: contain; }
.hero-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #fff;
  text-align: center;
}
.hero-empty img { width: 110px; height: 110px; object-fit: contain; }
.hero-empty .font-serif { font-size: 20px; font-weight: 600; }
.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: rgba(9, 25, 51, 0.55);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.12s ease;
}
.hero-nav:hover { background: rgba(9, 25, 51, 0.82); }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 5;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
}
.hero-carousel--admin .hero-dots { bottom: 54px; }
.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.75;
}
.hero-dot.active { background: #fff; opacity: 1; }
.hero-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  padding: 3px 8px;
  border-radius: 2px;
  background: rgba(9, 25, 51, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-slide-tools {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hero-add-tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  display: flex;
  gap: 6px;
}
.about-contain { object-fit: contain !important; background: var(--d); }
.inline-img-tools {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   SECTIONS, SURFACES & PILLARS
   ------------------------------------------------------------------------- */
.sch-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.surface-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.section-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--s);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.section-eyebrow-row .section-eyebrow { margin-bottom: 0; }
.section-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
  color: var(--link);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.section-edit-link:hover { background: #f0f7ff; border-color: #8bb4e8; }
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.pillar-card {
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: border-color 0.12s ease;
}
.pillar-card:hover { border-color: var(--border-strong); }
.pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  background: #f2f2f2;
  border-radius: 3px;
  color: var(--p);
}
.pillar-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
.pillar-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------------------- */
.sch-footer {
  margin-top: 48px;
  padding: 32px 24px;
  background: #1d1d1d;
  border-top: 1px solid #333;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}
.sch-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.sch-footer strong { color: #fff; font-weight: 600; }

/* -------------------------------------------------------------------------
   AUTH TABS & FORMS
   ------------------------------------------------------------------------- */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 20px;
  padding: 2px;
  background: #f2f2f2;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.auth-tab {
  padding: 8px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border-light), 0 1px 1px rgba(0, 0, 0, 0.03);
}

.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.fg { margin-bottom: 14px; }
.fg label {
  display: block;
  margin-bottom: 6px;
  color: var(--body);
  font-size: 12px;
  font-weight: 600;
}
.fg input,
.fg select,
.fg textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.fg textarea { min-height: 90px; resize: vertical; }
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  outline: none;
  border-color: var(--p);
  box-shadow: 0 0 0 2px rgba(0, 81, 195, 0.12);
}
.fg input[type="checkbox"],
.fg input[type="radio"] { width: auto; min-height: 0; }

.inline-search {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.inline-search:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px rgba(0, 81, 195, 0.12); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.inline-form input {
  flex: 1;
  min-width: 140px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}
.inline-form input:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 2px rgba(0, 81, 195, 0.12); }
.inline-form .input-code { flex: 0 0 86px; min-width: 86px; }
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  text-transform: none;
  cursor: pointer;
}
.pill--dismiss button {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}
.pill--dismiss button:hover { opacity: 1; }

/* -------------------------------------------------------------------------
   TABLES
   ------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.k12-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.k12-table th {
  padding: 10px 12px;
  background: #fafafa;
  border-bottom: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.k12-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--body);
  vertical-align: middle;
}
.k12-table tbody tr:last-child td { border-bottom: 0; }
.k12-table tbody tr:hover { background: #fafafa; }
.k12-table strong { color: var(--ink); font-weight: 600; }

/* -------------------------------------------------------------------------
   TAGS, PILLS, CHIPS & UTILITIES
   ------------------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}
.pill-blue { background: #eaf2fb; color: #0051c3; }
.pill-green { background: #e7f4ec; color: var(--green); }
.pill-amber { background: #fff4e0; color: var(--amber); }
.pill-red { background: #fdecec; color: var(--red); }
.pill-slate { background: #f2f2f2; color: var(--body); }

.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  background: #f2f2f2;
  color: var(--body);
  font-size: 11px;
  font-weight: 500;
}
.chip--muted { color: var(--muted); }

.muted { color: var(--muted); }
.cell-sub { font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.student-link { color: var(--link); font-size: 13px; font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* -------------------------------------------------------------------------
   SECTION HEADERS
   ------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.section-title .k-ico,
.card-title .k-ico { color: var(--p); }
.section-sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

/* -------------------------------------------------------------------------
   PORTAL SHELL
   ------------------------------------------------------------------------- */
.thick-card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.campus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.campus-tile {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--body);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.campus-tile:hover { background: #fafafa; border-color: var(--border-strong); }
.campus-tile .tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
  background: #f2f2f2;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--p);
}
.campus-tile .tile-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.campus-tile .tile-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.campus-tile.active {
  background: #fff;
  border-color: var(--p);
  box-shadow: inset 0 3px 0 var(--s);
}
.campus-tile.active .tile-icon { background: #eef2f7; color: var(--p); border-color: #d7e2f0; }
.campus-tile.active .tile-title { color: var(--ink); }
.campus-tile.active .tile-sub { color: var(--muted); }

.portal-pane { display: none; }
.portal-pane.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.portal-pane.active { animation: fadeIn 0.15s ease; }

/* -------------------------------------------------------------------------
   CLASS CARDS & ROSTER
   ------------------------------------------------------------------------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 16px;
}
.class-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  transition: border-color 0.12s ease;
}
.class-card:hover { border-color: var(--border-strong); }
.class-card--click { cursor: pointer; }
.class-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.class-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.class-card-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}
.class-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.class-card-meta strong { color: var(--body); font-weight: 500; }
.class-card-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.class-card-progress { margin-top: 12px; }
.class-card-progress small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.class-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.class-card-open {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  color: var(--link);
  font-size: 12px;
  font-weight: 500;
}

/* -------------------------------------------------------------------------
   DASHBOARD
   ------------------------------------------------------------------------- */
.dash-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.dash-side {
  position: sticky;
  top: 80px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.dash-side-section {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.dash-side-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.dash-side-section h3 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-stat {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}
.dash-stat:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-stat-value {
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.dash-stat--danger .dash-stat-value { color: var(--red); }
.dash-stat-label { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.dash-stat small { color: var(--muted); font-size: 11px; }
.dash-stat-of { color: var(--muted); font-size: 13px; font-weight: 500; }
.dash-term-box {
  padding: 14px;
  margin-bottom: 10px;
  background: #1d1d1d;
  border-radius: 3px;
  color: #fff;
}
.dash-term-session { color: rgba(255, 255, 255, 0.68); font-size: 11px; font-weight: 500; }
.dash-term-name { color: #fff; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.dash-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f2f2f2;
  font-size: 12.5px;
}
.dash-line:last-of-type { border-bottom: 0; }
.dash-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-section {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.dash-section h2 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; }
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.dash-metric {
  padding: 12px;
  border-right: 1px solid var(--border-light);
  text-align: left;
}
.dash-metric:last-child { border-right: 0; }
.dash-metric strong { display: block; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.2; }
.dash-metric span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dash-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* -------------------------------------------------------------------------
   PROGRESS & SEGMENTED CONTROLS
   ------------------------------------------------------------------------- */
.progress-track {
  height: 4px;
  overflow: hidden;
  background: #e8e8e8;
  border-radius: 2px;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--s);
  transition: width 0.35s ease;
}
.progress-track--thin { height: 3px; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  background: #f2f2f2;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.segmented--sm .seg-btn { padding: 4px 8px; font-size: 11.5px; }
.seg-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border-light), 0 1px 1px rgba(0, 0, 0, 0.03);
}
.seg-count {
  display: inline-flex;
  justify-content: center;
  min-width: 18px;
  padding: 0 4px;
  border-radius: 2px;
  background: #e5e5e5;
  color: var(--body);
  font-size: 10px;
  font-weight: 600;
}
.seg-btn.active .seg-count { background: var(--p); color: #fff; }

/* -------------------------------------------------------------------------
   RESULTS SETTINGS & RELEASE
   ------------------------------------------------------------------------- */
.release-card { border-top: 3px solid var(--s); }
.release-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 16px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.release-current-info { min-width: 0; }
.release-term {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.release-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 3px;
  background: var(--s);
  border-color: var(--s);
  color: #1d1d1d;
  font-size: 13px;
  font-weight: 600;
}
.release-btn:hover { background: color-mix(in srgb, var(--s) 90%, #000 10%); border-color: color-mix(in srgb, var(--s) 90%, #000 10%); color: #1d1d1d; }
.info-strip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 11px;
  background: #f0f7ff;
  border: 1px solid #d0e2f7;
  border-radius: 3px;
  color: #1d3b5c;
  font-size: 12.5px;
  font-weight: 500;
}
.info-strip .k-ico { margin-top: 1px; }

.shortlink-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
}
.shortlink-url {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

/* -------------------------------------------------------------------------
   MODALS, TUTORIAL & TOAST
   ------------------------------------------------------------------------- */
.kmodal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.kmodal.open { display: flex; }
#class-detail-modal { z-index: 550; }
#student-profile-modal { z-index: 600; }
.kmodal-box {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.kmodal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.kmodal-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}
.tutorial-overlay.open { display: flex; }
.tutorial-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
}
.ktoast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: 380px;
  padding: 10px 14px;
  border-radius: 3px;
  background: #1d1d1d;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.ktoast.show { opacity: 1; transform: translateY(0); }
.ktoast.err { background: #8f1d1d; }

/* Floating admin toolbar shown while a school or platform admin previews
   the public site. Kept clear of the bottom-right toast. */
.site-admin-bar {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 450;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100vw - 40px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(9, 25, 51, 0.94);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}
.site-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 4px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.9;
}
.site-admin-bar .sbtn-light { background: #fff; }

/* -------------------------------------------------------------------------
   HELP TOOLTIPS
   ------------------------------------------------------------------------- */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}
.help-tip:hover,
.help-tip:focus-visible {
  border-color: var(--link);
  background: #f0f7ff;
  color: var(--link);
  outline: none;
}
.help-pop {
  position: absolute;
  z-index: 1200;
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 3px;
  background: #1d1d1d;
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}
.help-pop[hidden] { display: none; }

/* -------------------------------------------------------------------------
   PARENT / STUDENT TERM CARDS
   ------------------------------------------------------------------------- */
.term-list { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.term-card {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
}
.term-card--live { border-color: var(--p); }
.term-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.term-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.term-sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.term-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.promotion-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fafafa;
  border-left: 3px solid var(--border);
  border-radius: 2px;
  color: var(--body);
  font-size: 12.5px;
}
.promotion-strip--yes { background: #f0f9f4; border-left-color: var(--green); color: #145c38; }
.promotion-strip--no { background: #fdf2f2; border-left-color: var(--red); color: #8a1f1f; }
.parent-empty {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 6px;
  padding: 20px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--muted);
}
.parent-empty svg { flex-shrink: 0; margin-top: 2px; }
.parent-empty strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.parent-empty p { margin: 3px 0 0; font-size: 12.5px; }
.parent-empty--locked { background: #fffaf0; border-color: #f3d9a8; color: #8a5a00; }
.parent-empty--locked strong { color: #8a5a00; }
.term-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.term-summary div { display: flex; flex-direction: column; gap: 1px; }
.term-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.term-summary strong { color: var(--ink); font-size: 14px; font-weight: 600; }

/* -------------------------------------------------------------------------
   SIGNUP LINKS, PAYROLL & EMPTY STATES
   ------------------------------------------------------------------------- */
.signup-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.coming-soon {
  margin-bottom: 12px;
  padding: 12px;
  background: #fffaf0;
  border: 1px solid #f3d9a8;
  border-radius: 3px;
}
.coming-soon h4 { margin: 6px 0 4px; color: #8a5a00; font-size: 13px; font-weight: 600; }
.coming-soon p { margin: 0; color: #8a5a00; font-size: 12.5px; }
.support-box {
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}
.support-box strong { color: var(--ink); font-size: 13px; font-weight: 600; }
.support-box p { margin: 4px 0 10px; color: var(--muted); font-size: 12.5px; }
.empty-state {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 3px;
  color: var(--muted);
  text-align: center;
}

/* -------------------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { position: static; }
}
@media (max-width: 860px) {
  .sch-hero { padding: 48px 16px 56px; }
  .sch-hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-carousel { height: 280px; }
  .sch-section { padding: 40px 16px; }
  .surface-card { padding: 20px; }
  .sch-footer { padding: 28px 16px; }
}
@media (max-width: 680px) {
  .sch-nav-inner { padding: 9px 14px; }
  .sch-brand img { width: 30px; height: 30px; }
  .sch-brand-name { font-size: 14.5px; }
  .sch-brand-motto { font-size: 10.5px; }
  .term-pill { height: 28px; white-space: normal; }
  .sch-hero { padding: 40px 14px 48px; }
  .sch-section { padding: 32px 14px; }
  .surface-card { padding: 16px; }
  .thick-card { padding: 16px; }
  .campus-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .campus-tile { padding: 12px; }
  .campus-tile .tile-icon { width: 28px; height: 28px; margin-bottom: 6px; }
  .campus-tile .tile-title { font-size: 13px; }
  .campus-tile .tile-sub { font-size: 11px; }
  .dash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-metric { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
  .dash-metric:nth-child(2n) { border-right: 0; }
  .dash-metric:nth-child(n+3) { border-bottom: 0; }
  .term-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .release-current { flex-direction: column; align-items: flex-start; }
  .release-btn { width: 100%; }
  .kmodal { padding: 12px; }
  .kmodal-box { padding: 16px; }
  .hero-carousel { height: 250px; }
  .hero-carousel--admin .hero-dots { bottom: 50px; }
  .site-admin-bar { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .site-admin-bar .sbtn { flex: 1 1 auto; }
  .site-admin-badge { flex: 1 1 100%; padding: 2px 4px; }
  .k12-table th, .k12-table td { padding: 8px 8px; font-size: 12px; }
  .dash-class-table th:nth-child(3), .dash-class-table td:nth-child(3),
  .dash-class-table th:nth-child(4), .dash-class-table td:nth-child(4) { display: none; }
  .release-table th:nth-child(3), .release-table td:nth-child(3) { display: none; }
  .fee-status-table th:nth-child(2), .fee-status-table td:nth-child(2),
  .fee-status-table th:nth-child(3), .fee-status-table td:nth-child(3),
  .fee-status-table th:nth-child(4), .fee-status-table td:nth-child(4),
  .fee-status-table th:nth-child(5), .fee-status-table td:nth-child(5) { display: none; }
  .fee-status-table .sbtn-sm { padding: 0 7px; height: 26px; font-size: 11px; }
  .fee-status-table .sbtn-sm .k-ico { display: none; }
  .fee-status-table .row-actions { gap: 4px; }
  .dash-payments-table th:nth-child(3), .dash-payments-table td:nth-child(3) { display: none; }
  .fee-ledger-table th:nth-child(2), .fee-ledger-table td:nth-child(2),
  .fee-ledger-table th:nth-child(4), .fee-ledger-table td:nth-child(4) { display: none; }
  .fee-ledger-table .sbtn-sm { padding: 0 7px; height: 26px; font-size: 11px; }
  .parent-payments-table th:nth-child(3), .parent-payments-table td:nth-child(3),
  .parent-payments-table th:nth-child(4), .parent-payments-table td:nth-child(4) { display: none; }
  .parent-payments-table .sbtn-sm { padding: 0 7px; height: 26px; font-size: 11px; }
  .parent-payments-table .sbtn-sm .k-ico { display: none; }
  #class-detail-modal .col-index,
  #class-detail-modal .col-adm,
  #class-detail-modal .col-results,
  #class-detail-modal .col-fee { display: none; }
  #class-detail-modal .pos-input { width: 58px !important; }
  #class-detail-modal .promo-select { max-width: 105px; }
  .sch-footer-inner { align-items: flex-start; flex-direction: column; gap: 8px; }
}
