/* schools.css — Schools portal styles (PRD §13.4 + §34.3.6/7) | Ticket: T2-066-C */

body.schools-body {
  background: linear-gradient(180deg, var(--slate-50) 0%, #EFF6FF 100%);
  min-height: 100vh;
}

/* ── Login screen ───────────────────────────────────────────── */
.schools-login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem var(--gutter);
}

.schools-login-card {
  width: 100%;
  max-width: 440px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elev);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.schools-login-header {
  text-align: center;
  margin-bottom: 1.8rem;
}
.schools-login-header .icon { font-size: 2.6rem; line-height: 1; }
.schools-login-header h1 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--slate-900);
  margin: 0.7rem 0 0.3rem;
}
.schools-login-header p { color: var(--slate-500); margin: 0; font-size: 0.95rem; }

.field-group { margin-bottom: 1.1rem; }
.field-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}
.field-group input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  color: var(--slate-900);
}
.field-group input:focus { outline: none; border-color: var(--teal-500); }

.error-banner {
  background: var(--rose-100);
  color: #991B1B;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--rose-500);
  display: none;
}
.error-banner.is-visible { display: block; }

.login-help {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--slate-500);
}
.login-help a { color: var(--teal-700); font-weight: 700; text-decoration: none; }
.login-help a:hover { text-decoration: underline; }

/* ── Dashboard layout ───────────────────────────────────────── */
.dashboard-header {
  background: white;
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 30;
}
.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
  max-width: 1180px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.dashboard-school-block { display: flex; align-items: center; gap: 0.7rem; }
.dashboard-school-block .icon { font-size: 1.8rem; }
.dashboard-school-block .name { font-weight: 900; font-size: 1.1rem; color: var(--slate-900); }
.dashboard-school-block .code { font-size: 0.8rem; color: var(--slate-500); font-family: monospace; }
.dashboard-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-sm {
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

.dashboard-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 3rem;
}

.privacy-banner {
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  color: var(--teal-900);
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* ── KPI grid ───────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.kpi-card .label {
  font-size: 0.8rem;
  color: var(--slate-500);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.kpi-card .value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--slate-900);
  line-height: 1;
}
.kpi-card .sub {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 0.3rem;
}
.kpi-card.is-accent::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal-600);
}

/* ── Chart cards ────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.chart-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-card);
}
.chart-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--slate-800);
  margin: 0 0 1rem;
}
.chart-card canvas { width: 100% !important; max-height: 260px; }
.chart-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--slate-500);
  font-size: 0.9rem;
}

/* ── Stage bars ─────────────────────────────────────────────── */
.stage-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.stage-bar-label { font-weight: 700; color: var(--slate-700); font-size: 0.9rem; }
.stage-bar-track {
  background: var(--slate-100);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}
.stage-bar-fill {
  background: linear-gradient(90deg, var(--teal-500) 0%, var(--teal-700) 100%);
  height: 100%;
  border-radius: 999px;
}
.stage-bar-value {
  text-align: end;
  font-weight: 800;
  color: var(--slate-700);
  font-size: 0.9rem;
}

/* ── Skeleton + states ──────────────────────────────────────── */
.is-loading .dashboard-content { opacity: 0.4; pointer-events: none; }
.dashboard-content { transition: opacity 0.2s ease; }

.toast {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-start: 50%;
  transform: translateX(50%);
  background: var(--slate-900);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: var(--shadow-elev);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.is-visible { opacity: 1; }
.toast.is-error { background: var(--rose-500); }
.toast.is-success { background: var(--teal-700); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.modal-backdrop.is-open { display: flex; }
.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.7rem;
  width: min(440px, calc(100vw - 2rem));
  box-shadow: var(--shadow-elev);
}
.modal-card h3 { margin: 0 0 1rem; font-size: 1.2rem; font-weight: 900; color: var(--slate-900); }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 1rem; justify-content: flex-end; }

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