* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, sans-serif; }
body { background: #f4f6f9; color: #333; }

/* Auth */
.auth-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.auth-card { background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); width: 340px; }
.auth-card h1 { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.auth-card input { width: 100%; padding: .75rem; margin-bottom: 1rem; border: 1px solid #ddd; border-radius: 8px; }
.auth-card button { width: 100%; padding: .75rem; background: #4361ee; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; }
.auth-card button:hover { background: #3a53d0; }
.error { color: #e63946; text-align: center; margin-top: .5rem; font-size: .9rem; }
.hint { text-align: center; color: #999; margin-top: 1rem; font-size: .8rem; }

/* Nav */
.navbar { background: #1e293b; color: #fff; padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; }
.brand { font-weight: 700; font-size: 1.2rem; }
.nav-links a { color: #cbd5e1; text-decoration: none; margin-left: 1.5rem; font-size: .95rem; }
.nav-links a:hover { color: #fff; }

/* Layout */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

/* Buttons */
.btn-primary { background: #4361ee; color: #fff; border: none; padding: .6rem 1.2rem; border-radius: 6px; cursor: pointer; }
.btn-primary:hover { background: #3a53d0; }
.btn-secondary { background: #e5e7eb; border: none; padding: .6rem 1.2rem; border-radius: 6px; cursor: pointer; }
.btn-danger { background: #ef4444; color: #fff; border: none; padding: .4rem .8rem; border-radius: 6px; cursor: pointer; font-size: .85rem; }
.btn-small { background: #10b981; color: #fff; border: none; padding: .4rem .8rem; border-radius: 6px; cursor: pointer; font-size: .85rem; }

/* Table */
.data-table { width: 100%; background: #fff; border-collapse: collapse; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.data-table th, .data-table td { padding: .9rem 1rem; text-align: left; border-bottom: 1px solid #eee; }
.data-table th { background: #f9fafb; font-weight: 600; font-size: .9rem; color: #555; }
.data-table tr:last-child td { border-bottom: none; }
.data-table button { margin-right: .3rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.stat-card { background: #fff; padding: 1.5rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.stat-card h3 { font-size: .9rem; color: #666; margin-bottom: .5rem; }
.stat-number { font-size: 2rem; font-weight: 700; color: #4361ee; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal.hidden { display: none; }
.modal-content { background: #fff; padding: 2rem; border-radius: 12px; width: 480px; max-width: 90vw; max-height: 90vh; overflow-y: auto; }
.modal-content h2 { margin-bottom: 1rem; }
.modal-content input, .modal-content select { width: 100%; padding: .7rem; margin-bottom: .8rem; border: 1px solid #ddd; border-radius: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.filter-bar {
  display: flex; gap: .75rem; margin: 1rem 0; align-items: center; flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
  padding: .6rem .8rem; border: 1px solid #ddd; border-radius: 6px;
}
/* ===== Super Admin / Schools page ===== */

/* Section headings inside the modal form */
.modal-content h3 {
  font-size: .95rem;
  color: #4361ee;
  font-weight: 600;
  margin-top: .5rem;
  margin-bottom: .6rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid #eef1f6;
}

/* Slightly wider modal for the two-part school+admin form */
.modal-content {
  max-width: 520px;
}

/* School code badge */
.badge-code {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  font-size: .78rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 6px;
  letter-spacing: .02em;
}

/* Status pill (reusable for active/inactive) */
.pill {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
}
.pill-active   { background: #d1fae5; color: #065f46; }
.pill-inactive { background: #fee2e2; color: #991b1b; }

/* Super admin brand accent */
.navbar.superadmin {
  background: linear-gradient(90deg, #1e1b4b, #312e81);
}
.navbar.superadmin .brand {
  color: #fbbf24;
}

/* Empty-state row */
.data-table td.empty {
  text-align: center;
  color: #9ca3af;
  padding: 2rem 1rem;
  font-style: italic;
}

/* Destructive action button hover */
.btn-danger:hover {
  background: #dc2626;
}

/* Small helper text under inputs */
.form-hint {
  font-size: .78rem;
  color: #9ca3af;
  margin: -.4rem 0 .8rem;
}
/* ===== Dashboard charts ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.chart-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.chart-card.wide {
  grid-column: span 2;
}

@media (max-width: 720px) {
  .chart-card.wide { grid-column: span 1; }
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #eef1f6;
}

.chart-card canvas {
  max-height: 260px;
}