/* ──────────────────────────────────────────────────────────────
   Mintrix School Admin / Onboarding wizard styles
   Inspired by the Beacon "School setup" reference.
   ────────────────────────────────────────────────────────────── */

:root {
  --bg:          #fafaf9;
  --surface:     #ffffff;
  --surface-2:   #f7f7f6;
  --ink:         #111827;
  --ink-soft:    #374151;
  --muted:       #6b7280;
  --muted-2:     #9ca3af;
  --border:      #e5e7eb;
  --border-2:    #eef0ee;
  --accent:      #10b981;
  --accent-ink:  #047857;
  --accent-soft: #d1fae5;
  --warn:        #f59e0b;
  --warn-soft:   #fef3c7;
  --danger:      #ef4444;
  --rail-line:   #b91c1c;

  --r-md: 10px;
  --r-lg: 14px;

  --font-sans:   "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-serif:  "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --font-mono:   "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── App shell (wizard fullscreen) ─────────────────────────── */
.wiz {
  display: grid;
  grid-template-rows: 56px 1fr 64px;
  min-height: 100vh;
  background: white;
}

/* Top header */
.wiz-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.wiz-top__left { display: flex; align-items: center; gap: 14px; }
.wiz-brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  display: grid; place-items: center; overflow: hidden;
}
.wiz-brand-mark img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.wiz-crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-soft); font-weight: 500;
}
.wiz-crumbs__sep { color: var(--muted-2); }
.wiz-crumbs__current { color: var(--muted); }

.wiz-top__right {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--muted);
}
.wiz-top__step-counter { display: flex; align-items: center; gap: 6px; }
.wiz-top__step-counter .dot { width: 8px; height: 8px; border-radius: 50%; }
.wiz-top__step-counter--progress .dot { background: var(--warn); }
.wiz-top__step-counter--idle .dot     { background: var(--muted-2); }
.wiz-top__step-counter--done .dot     { background: var(--accent); }
.wiz-top__autosave {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
}
.wiz-top__autosave .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.wiz-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: white;
  display: grid; place-items: center;
  font-weight: 700; font-size: 11px;
}

/* Body grid */
.wiz-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 0;
}

/* Left rail */
.wiz-rail {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 22px 24px 26px;
  overflow-y: auto;
  position: relative;
}
.wiz-rail::before {
  /* The thin red accent line running down the rail's edge in the reference design */
  content: "";
  position: absolute;
  right: -1px; top: 0; bottom: 0;
  width: 2px;
  background: var(--rail-line);
  opacity: .55;
}
.wiz-rail__org {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 2px;
}
.wiz-rail__title {
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 16px;
  letter-spacing: -.2px;
}
.wiz-rail__progress {
  background: var(--border);
  height: 4px; border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}
.wiz-rail__progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  border-radius: 4px;
  transition: width .3s ease;
}
.wiz-rail__progress-meta {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--muted);
  margin-bottom: 22px;
  font-family: var(--font-mono);
}

.wiz-chapter { margin-bottom: 18px; }
.wiz-chapter__head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.wiz-chapter__label {
  font-family: var(--font-serif); font-style: italic;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .2px;
}
.wiz-chapter__time { font-size: 11.5px; color: var(--muted-2); font-family: var(--font-mono); }
.wiz-chapter__title {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 8px;
  letter-spacing: -.1px;
}
.wiz-chapter__title em {
  font-style: italic; font-family: var(--font-serif);
  font-weight: 500; color: var(--ink-soft);
}

.wiz-step {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  margin: 2px -9px;
  font-size: 13.2px;
  color: var(--ink-soft);
  transition: background .14s;
}
.wiz-step:hover { background: var(--surface-2); cursor: pointer; }
.wiz-step--current {
  background: var(--surface-2);
  font-weight: 600;
}
.wiz-step__num {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  background: white;
  flex: 0 0 22px;
}
.wiz-step--current .wiz-step__num {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  font-weight: 700;
}
.wiz-step--done .wiz-step__num {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.wiz-step--skipped .wiz-step__num {
  background: var(--surface-2);
  color: var(--muted-2);
  border-style: dashed;
}
.wiz-step__title { flex: 1; }
.wiz-step__optional {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
}

.wiz-checkpoint {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--muted-2);
  padding: 8px 9px;
  margin: 4px -9px 8px;
  border-radius: 8px;
}
.wiz-checkpoint i { color: var(--muted-2); }
.wiz-checkpoint.is-reached { color: var(--accent-ink); }
.wiz-checkpoint.is-reached i { color: var(--accent); }


/* Main pane */
.wiz-main {
  padding: 36px 56px 80px;
  overflow-y: auto;
}
.wiz-main__crumb {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.wiz-heading {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -.4px;
  line-height: 1.2;
}
.wiz-heading em {
  font-style: italic;
  color: var(--ink-soft);
}
.wiz-sub {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 700px;
  line-height: 1.6;
  margin: 0 0 28px;
}

/* Form card */
.wiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  max-width: 920px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.wiz-section {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: .2px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-2);
}
.wiz-section:not(:first-child) { margin-top: 28px; }

.wiz-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.wiz-row {
  margin-bottom: 16px;
}
.wiz-row label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.wiz-row label .req { color: var(--danger); margin-left: 2px; }
.wiz-row input[type=text],
.wiz-row input[type=email],
.wiz-row input[type=password],
.wiz-row input[type=tel],
.wiz-row input[type=url],
.wiz-row input[type=number],
.wiz-row select,
.wiz-row textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .14s;
}
.wiz-row input:focus,
.wiz-row select:focus,
.wiz-row textarea:focus {
  border-color: var(--ink);
}
.wiz-row .hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.wiz-row .hint .ok { color: var(--accent-ink); font-weight: 500; }

/* Bottom action bar */
.wiz-bottom {
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.wiz-bottom__left a {
  color: var(--muted);
  font-size: 13.5px;
}
.wiz-bottom__left a:hover { color: var(--ink); }
.wiz-bottom__right { display: flex; align-items: center; gap: 10px; }
.wiz-bottom__hint {
  color: var(--muted-2);
  font-size: 12px;
  margin-right: 6px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background .14s, border-color .14s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn--ghost { border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ink); }
.btn--primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn--primary:hover { filter: brightness(1.1); color: white; }
.btn--warn {
  background: white;
  border-color: var(--border);
}
.btn--danger-solid {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn--danger-solid:hover { filter: brightness(.95); color: white; }

/* ── Chip input (sections etc.) ─────────────────────────── */
.chip-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 6px 8px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  min-height: 36px;
  transition: border-color .14s, box-shadow .14s;
  cursor: text;
}
.chip-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}
.chip-input__chips { display: contents; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  color: var(--accent-ink);
  border-radius: 6px;
  padding: 3px 4px 3px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.chip button {
  background: rgba(255,255,255,.7);
  border: 0;
  width: 18px; height: 18px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--accent-ink);
  font-size: 14px;
  line-height: 1;
  display: grid; place-items: center;
}
.chip button:hover { background: white; color: var(--danger); }
.chip-input__entry {
  flex: 1; min-width: 100px;
  border: 0; outline: 0;
  padding: 4px 6px;
  font-size: 13px;
  background: transparent;
}
.chip-input__hidden { display: none; }

/* Small polish — give panel-mini-forms a subtle inner border on top */
.wiz-mini-form {
  position: relative;
}
.wiz-mini-form::before {
  content: "Add new";
  position: absolute;
  top: -8px; left: 12px;
  background: var(--surface-2);
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .8px;
  color: var(--muted);
  text-transform: uppercase;
}

/* List rows: subtle hover */
.wiz-list li { transition: background .12s; border-radius: 6px; }
.wiz-list li:hover { background: rgba(16, 185, 129, .04); }

/* Panel polish */
.wiz-panel { transition: border-color .14s; }
.wiz-panel:hover { border-color: #d4d4d3; }

/* Wider, more breathing room for wizard main pane */
.wiz-main { padding: 36px 56px 100px; }

/* Form panels inside step pages should not let inputs touch edges */
.wiz-card .wiz-row + .wiz-section { margin-top: 32px; }

/* Banner inside form (e.g. "Sessions and classes save together") */
.wiz-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 24px;
}
.wiz-banner i { color: var(--accent-ink); }

/* Checkpoint celebration page */
.checkpoint-card {
  background: var(--accent-soft);
  border: 1px solid #a7f3d0;
  border-radius: 18px;
  padding: 56px 48px;
  text-align: center;
  max-width: 760px;
  margin: 40px auto 0;
}
.checkpoint-tick {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-grid; place-items: center;
  color: white;
  font-size: 28px;
  margin-bottom: 24px;
}
.checkpoint-chapter-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--accent-ink);
  margin-bottom: 12px;
  letter-spacing: .3px;
}
.checkpoint-title {
  font-family: var(--font-serif);
  font-size: 38px;
  color: var(--accent-ink);
  margin: 0 0 14px;
  font-weight: 500;
  letter-spacing: -.5px;
}
.checkpoint-description {
  color: var(--accent-ink);
  opacity: .85;
  font-size: 15px;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}
.engines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 36px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}
.engine-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}
.engine-card__icon { color: var(--accent-ink); font-size: 18px; margin-bottom: 10px; }
.engine-card__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.engine-card__sub { font-size: 12px; color: var(--muted); }

/* ── Wizard helpers for steps 2-10 ───────────────────────── */
.wiz-side-by-side {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
@media (max-width: 980px) { .wiz-side-by-side { grid-template-columns: 1fr; } }

.wiz-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.wiz-panel__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.wiz-panel__head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.wiz-panel__sub {
  color: var(--muted); font-size: 12.5px; margin: 0; font-family: var(--font-serif); font-style: italic;
}

.wiz-list { list-style: none; padding: 0; margin: 0; }
.wiz-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--border-2);
  font-size: 13.5px;
}
.wiz-list li:first-child { border-top: 0; }
.wiz-list .grow { flex: 1; min-width: 0; }
.wiz-list .small { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.wiz-list .pill {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted);
  font-family: var(--font-mono); letter-spacing: .2px;
}
.wiz-list .pill--core      { background: #dbeafe; color: #1e40af; }
.wiz-list .pill--elective  { background: #ede9fe; color: #6d28d9; }
.wiz-list .pill--co        { background: var(--accent-soft); color: var(--accent-ink); }
.wiz-list .pill--active    { background: var(--accent-soft); color: var(--accent-ink); }
.wiz-list .pill--inactive  { background: #f3f4f6; color: var(--muted); }

.icon-btn {
  background: transparent; border: 0; padding: 6px;
  color: var(--muted); cursor: pointer; border-radius: 6px;
  display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.danger:hover { background: #fef2f2; color: var(--danger); }

/* Day tiles for operating schedule */
.day-tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 0;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all .14s;
}
.day-tile__abbr  { font-size: 11.5px; font-weight: 700; letter-spacing: .5px; }
.day-tile__state { font-size: 11px; color: var(--muted); margin-top: 2px; }
.day-tile.is-open {
  background: var(--ink); color: white; border-color: var(--ink);
}
.day-tile.is-open .day-tile__state { color: rgba(255,255,255,.7); }
.day-tile input { display: none; }

.preset-row { display: flex; gap: 8px; }

/* Toggle switch (used in step 3 / 4) */
.toggle-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 10px;
}
.toggle-row__icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--accent-ink);
}
.toggle-row__body { flex: 1; }
.toggle-row__title { font-weight: 600; font-size: 14px; }
.toggle-row__sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.switch__slider::before {
  content: "";
  position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch__slider { background: var(--accent); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); }

/* Inline mini-modal (for "add" forms inside a panel) */
.wiz-mini-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 12px;
}
.wiz-mini-form__row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.wiz-mini-form input,
.wiz-mini-form select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
}

.wiz-banner--ok {
  background: var(--accent-soft);
  border-color: #a7f3d0;
  color: var(--accent-ink);
}
.wiz-banner--ok i { color: var(--accent-ink); }

/* Stub step "coming next" message */
.stub-card {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border: 1px dashed #a7f3d0;
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  max-width: 640px;
}
.stub-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--accent-ink);
}
.stub-card p { color: var(--muted); margin-bottom: 18px; font-size: 13.5px; }


/* ── Dashboard (non-wizard) ────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.shell-side {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;               /* the nav scrolls internally, footer stays pinned */
}
.shell-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 16px;
  border-bottom: 1px solid var(--border-2);
}
.shell-brand__mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #a7f3d0;
  overflow: hidden;
  display: grid; place-items: center;
}
.shell-brand__mark img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.shell-brand__title { font-weight: 700; font-size: 13.5px; }
.shell-brand__sub   { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }

.shell-nav {
  display: flex; flex-direction: column; gap: 2px; margin-top: 14px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;   /* scroll long menus; keep footer visible */
  scrollbar-width: thin;
}
.shell-nav::-webkit-scrollbar { width: 7px; }
.shell-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.shell-nav a, .shell-nav .shell-nav__sub {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  text-decoration: none;
}
.shell-nav a:hover, .shell-nav .shell-nav__sub:not(.shell-nav__sub--disabled):hover {
  background: var(--surface-2);
}
.shell-nav a.is-active, .shell-nav .shell-nav__sub.is-active {
  background: var(--surface-2); font-weight: 600; color: var(--ink);
  position: relative;
}
.shell-nav a.is-active::before, .shell-nav .shell-nav__sub.is-active::before {
  content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.shell-nav a .ico, .shell-nav .shell-nav__sub .ico {
  width: 16px; text-align: center; color: var(--muted);
}
.shell-nav a.is-active .ico, .shell-nav .shell-nav__sub.is-active .ico { color: var(--accent-ink); }

.shell-nav__group {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border-2);
}
.shell-nav__group-label {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .14s, color .14s;
}
.shell-nav__group-label:hover { background: var(--surface-2); color: var(--ink-soft); }
.shell-nav__group-label i { color: var(--muted-2); font-size: 12px; }
.shell-nav__group-label .chev {
  margin-left: auto;
  transition: transform .2s ease;
}
.shell-nav__group.is-open .shell-nav__group-label .chev { transform: rotate(180deg); }
.shell-nav__group.is-current .shell-nav__group-label {
  color: var(--accent-ink);
}
.shell-nav__group.is-current .shell-nav__group-label i { color: var(--accent-ink); }

.shell-nav__group-body {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.shell-nav__group.is-open .shell-nav__group-body { display: flex; }

.shell-nav__sub { padding-left: 18px; }
.shell-nav__sub--disabled { color: var(--muted-2); cursor: not-allowed; }
.shell-nav__sub--disabled .ico { color: var(--muted-2); }
.shell-nav__pill {
  margin-left: auto;
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* ── Permission-toggle row (used in menu access, dept perms, user perms) ── */
.perm-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  transition: background .12s;
}
.perm-row:last-child { border-bottom: 0; }
.perm-row:hover { background: rgba(16, 185, 129, .04); }
.perm-row__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--ink-soft);
  font-size: 14px;
  flex: 0 0 auto;
}
.perm-row__body { flex: 1; min-width: 0; }
.perm-row__title { font-weight: 600; font-size: 14px; }
.perm-row__sub   { color: var(--muted); font-size: 12.5px; margin-top: 2px; font-family: var(--font-mono); }

.perm-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.perm-toolbar .left { display: flex; align-items: center; gap: 14px; }
.perm-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 13.5px;
  min-width: 240px;
}
.perm-toolbar .stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.perm-toolbar .stat strong { color: var(--accent-ink); font-weight: 700; }

.perm-actions {
  display: flex; align-items: center; gap: 8px;
}

.shell-side__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-2);
  font-size: 12px; color: var(--muted);
}

/* ── Settings page polish (cards + tables) ───────────── */
.settings-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 6px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 22px;
}
.settings-bar a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.settings-bar a.is-active { background: white; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.settings-bar a:not(.is-active):hover { color: var(--ink-soft); }

.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th, .settings-table td {
  text-align: left;
  padding: 12px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
}
.settings-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  font-weight: 600; color: var(--muted); background: var(--surface-2);
}
.settings-table tbody tr:last-child td { border-bottom: 0; }
.settings-table tbody tr:hover { background: rgba(16,185,129,.03); }

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.group-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.group-card__title { font-weight: 700; font-size: 14.5px; }
.group-card__sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.group-card .chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

.shell-main { padding: 78px 28px 28px; }   /* top padding clears the fixed .top-navbar */

/* Fixed top navbar over the main content area (right of the 240px sidebar) */
.top-navbar {
  position: fixed; top: 0; left: 240px; right: 0; height: 54px; z-index: 450;
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.top-navbar__spacer { flex: 1 1 auto; }
.top-navbar__school {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700; color: var(--ink);
}
.top-navbar__school i { color: var(--accent, #0f766e); font-size: 13px; }
.top-navbar__select {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-2, #e2e8f0);
  border-radius: 9px; padding: 5px 10px;
}
.top-navbar__select select {
  border: 0; background: transparent; font-size: 12.5px; font-weight: 600;
  color: var(--ink, #0f172a); cursor: pointer; max-width: 190px;
}
.shell-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.shell-top h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.shell-top .sub { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); margin-top: 4px; }

/* ── Modal base (used by all generic modals) ─────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 24, 39, .55);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal-backdrop.is-open { display: flex; animation: fadeIn .15s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(2, 32, 18, .15), 0 4px 14px rgba(2, 32, 18, .08);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid var(--border);
  animation: mxRise .18s ease-out;
  display: flex; flex-direction: column;
}
.modal--lg { max-width: 760px; }

/* Responsive — let the modal body scroll, never overflow the viewport. */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }
  .modal,
  .modal--lg {
    max-width: 100%;
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }
  .modal__head { padding: 14px 16px; }
  .modal__head h3 { font-size: 15px; }
  .modal__body { padding: 16px; }
  .modal__foot {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal__foot .btn { flex: 1 1 auto; justify-content: center; }
  .form-grid-2,
  .form-grid-3,
  .wiz-grid-2 { grid-template-columns: 1fr !important; }
}
@keyframes mxRise {
  from { transform: translateY(8px) scale(.985); opacity: 0; }
  to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

/* When a <form> wraps both body and foot inside the modal, it must itself
   become a flex column so the body can scroll and the foot stays pinned.
   Without this, the foot is pushed off-screen on tall forms. */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal__head {
  padding: 18px 22px;
  border-bottom: 1px solid #d1fae5;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 60%, #ffffff 100%);
  position: relative;
}
.modal__head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 80%);
  opacity: .35;
}
.modal__head h3 {
  margin: 0;
  font-size: 16px; font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  line-height: 1.2;
}
.modal__head h3 i { color: var(--accent-ink); }
.modal__sub {
  display: block;
  font-size: 12px; font-weight: 500; color: var(--muted);
  margin-top: 4px; letter-spacing: .2px;
}

.modal__close {
  background: rgba(16, 185, 129, .08);
  border: 1px solid transparent;
  color: var(--accent-ink);
  font-size: 18px; cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  transition: background .14s, border-color .14s;
  flex: 0 0 auto;
  line-height: 1;
  padding: 0;
}
.modal__close:hover { background: rgba(16, 185, 129, .15); border-color: #a7f3d0; }

.modal__body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
  flex: 0 0 auto;
}

/* Danger-headed variant (used by confirm-delete) */
.modal--danger .modal__head {
  background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 60%, #ffffff 100%);
  border-bottom-color: #fecaca;
}
.modal--danger .modal__head::after {
  background: linear-gradient(90deg, var(--danger) 0%, transparent 80%);
}
.modal--danger .modal__head h3 i { color: var(--danger); }
.modal--danger .modal__close { background: rgba(239, 68, 68, .08); color: #991b1b; }
.modal--danger .modal__close:hover { background: rgba(239, 68, 68, .15); border-color: #fecaca; }

.welcome-modal {
  background: var(--surface);
  border-radius: 18px;
  width: 100%; max-width: 720px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 32, 18, .25);
}
.welcome-modal__head {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 60%, #ffffff 100%);
  padding: 28px 32px 22px;
  border-bottom: 1px solid #d1fae5;
  position: relative;
}
.welcome-modal__head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 80%);
  opacity: .35;
}
.welcome-modal__eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--accent-ink);
  font-size: 13px;
  margin-bottom: 6px;
}
.welcome-modal__title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: -.5px;
}
.welcome-modal__sub {
  color: var(--muted);
  font-size: 14px;
  max-width: 540px;
  line-height: 1.55;
}

.welcome-modal__body { padding: 28px 32px 32px; }
.welcome-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.welcome-option {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  font-family: inherit;
}
.welcome-option:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, .12);
}
.welcome-option__ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 16px;
  margin-bottom: 14px;
}
.welcome-option__title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}
.welcome-option__sub {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.welcome-option__cta {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: space-between;
}
.card__head h2 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card__body { padding: 18px; }

.empty {
  padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13.5px;
}
.empty strong { color: var(--ink-soft); display: block; font-size: 14.5px; margin-bottom: 4px; }

.messages { margin-bottom: 18px; }
.message {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  border: 1px solid;
}
.message--success { background: var(--accent-soft); border-color: #bbf7d0; color: var(--accent-ink); }
.message--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.message--info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.message--warning { background: var(--warn-soft); border-color: #fde68a; color: #92400e; }

/* Login screen */
.login-screen {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(16, 185, 129, .08) 0%, transparent 60%),
    radial-gradient(50% 40% at 100% 100%, rgba(16, 185, 129, .06) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 30px;
  max-width: 420px; width: 100%;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .03);
}
.login-card__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-card__brand .shell-brand__mark { width: 40px; height: 40px; }

/* Proper boxed inputs for forms that aren't inside the wizard's .wiz-card */
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 12px; font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: .2px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
  background: white;
}
.field .hint { font-size: 11.5px; color: var(--muted); }

/* Pretty primary submit at full width (login + similar) */
.btn--block {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
}
