* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #0f172a;
  background: #f5f7fb;
}
a { color: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid #dbe3ef;
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #0f172a;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1;
}
.brand-copy, .brand-copy strong, .brand-copy span { display: block; }
.brand-copy { min-width: 0; }
.brand-copy strong { color: #0f172a; font-size: 15px; line-height: 1.25; }
.brand-copy span { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; line-height: 1.35; }
.topbar nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn, button {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.secondary, button.secondary { background: #e2e8f0; color: #0f172a; }
.btn.outline, button.outline { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; }
.hero {
  padding: 76px clamp(18px, 4vw, 56px) 36px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 58%, #0f766e 100%);
  color: #fff;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: #38bdf8; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 66px); line-height: 1.05; letter-spacing: 0; }
h2 { margin: 0 0 16px; font-size: clamp(26px, 4vw, 42px); line-height: 1.12; }
h3 { margin: 0 0 10px; font-size: 20px; }
.hero p { color: #e0f2fe; font-size: 18px; line-height: 1.7; }
.hero-card, .panel {
  background: #fff;
  color: #0f172a;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15,23,42,.08);
}
.hero-card { padding: 24px; background: #ffffff; position: relative; z-index: 2; }
.hero-card h3 { color: #0f172a; }
.hero-card .note { color: #334155; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stats div { padding: 14px; border-radius: 8px; background: #eff6ff; border: 1px solid #bfdbfe; }
.stats strong { display: block; font-size: 28px; }
main { max-width: 1180px; margin: 0 auto; padding: 36px clamp(18px, 4vw, 56px) 80px; }
.section { margin-top: 28px; }
.grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: start; }
.panel { padding: 24px; }
.student-toolbar { display: grid; grid-template-columns: 1fr 190px; gap: 10px; margin: 18px 0 10px; }
.student-count { margin: 0 0 12px; color: #0f172a; font-size: 13px; font-weight: 800; }
.student-group { margin: 18px 0 8px; padding: 8px 10px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.student-list { display: grid; gap: 10px; }
.student-card {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  background: #fff;
  color: #0f172a;
  border: 1px solid #dbe3ef;
}
.student-card strong, .student-card small { display: block; }
.student-card small { color: #64748b; font-weight: 600; margin-top: 4px; }
.student-card.additional { border-color: #93c5fd; background: #eff6ff; }
.student-card.test { border-color: #f59e0b; background: #fffbeb; }
.student-card.active { border-color: #0f172a; box-shadow: 0 0 0 2px #0f172a inset; }
.verify-box { display: grid; gap: 12px; margin-top: 18px; }
label { display: grid; gap: 8px; font-size: 12px; color: #475569; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 13px;
  color: #0f172a;
  background: #fff;
  font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.full { grid-column: 1 / -1; }
.radio-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.radio-card {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.radio-card input { width: auto; margin-right: 8px; }
.note { color: #64748b; line-height: 1.7; }
.message { margin-top: 16px; padding: 14px; border-radius: 8px; font-weight: 700; }
.message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.message.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.message.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.hidden { display: none !important; }
#photoPreview { width: 112px; height: 138px; object-fit: cover; border: 1px solid #cbd5e1; border-radius: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.print-doc {
  width: min(100%, 900px);
  margin: 22px auto;
  padding: 30px;
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #111827;
}
.print-doc header, .print-doc footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 18px;
}
.print-doc footer { border-top: 2px solid #0f172a; border-bottom: 0; padding-top: 16px; margin-top: 20px; margin-bottom: 0; }
.print-doc header img { width: 76px; height: 76px; object-fit: contain; }
.doc-row { display: grid; grid-template-columns: 130px 1fr; gap: 18px; }
.student-photo { width: 120px; height: 148px; object-fit: cover; border: 1px solid #94a3b8; }
.doc-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid #cbd5e1; }
.doc-grid div { padding: 9px; border-right: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1; }
.doc-grid span { display: block; color: #64748b; font-size: 10px; text-transform: uppercase; font-weight: 800; }
.doc-grid strong { display: block; margin-top: 4px; font-size: 13px; }
.print-doc table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.print-doc th, .print-doc td { border: 1px solid #cbd5e1; padding: 10px; text-align: left; }
.signature { display: flex; align-items: center; gap: 12px; text-align: right; }
.stamp {
  width: 84px;
  height: 84px;
  border: 3px double #1d4ed8;
  border-radius: 50%;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  transform: rotate(-12deg);
  font-size: 9px;
  line-height: 1;
  text-align: center;
  opacity: .85;
}
.stamp span { border-top: 1px solid #1d4ed8; border-bottom: 1px solid #1d4ed8; padding: 4px 0; width: 70%; }
.id-card-doc {
  width: min(100%, 900px);
  margin: 22px auto;
  padding: 30px;
  background: #fff;
  border: 1px solid #cbd5e1;
}
.id-card {
  width: 520px;
  max-width: 100%;
  min-height: 324px;
  margin: 0 auto;
  border: 1px solid #0f172a;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15,23,42,.12);
}
.id-card-band {
  padding: 16px 20px;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #0f766e);
}
.id-card-band span, .id-card-band strong { display: block; }
.id-card-band span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #bae6fd; }
.id-card-band strong { margin-top: 4px; font-size: 18px; letter-spacing: 0; }
.id-card-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  padding: 20px;
}
.id-photo-wrap {
  width: 120px;
  height: 148px;
  border: 1px solid #94a3b8;
  background: #f8fafc;
}
.id-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.id-label {
  margin: 0 0 6px;
  color: #0f766e;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.id-details h2 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.12;
}
.id-details dl { margin: 0; display: grid; gap: 7px; }
.id-details div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; }
.id-details dt { color: #64748b; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.id-details dd { margin: 0; color: #0f172a; font-size: 12px; font-weight: 800; }
.id-card-footer {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid #cbd5e1;
  background: #f8fafc;
}
.id-card-footer .stamp {
  width: 64px;
  height: 64px;
  font-size: 7px;
}
.id-card-footer p {
  margin: 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.55;
  font-weight: 700;
}
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { border-bottom: 1px solid #e2e8f0; padding: 12px; text-align: left; vertical-align: top; }
.admin-table button { padding: 8px 10px; margin: 2px; }
.admin-dashboard {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.metric-card {
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}
.metric-card span, .metric-card small { display: block; }
.metric-card span {
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.metric-card strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.05;
}
.metric-card small {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.progress-block {
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.progress-track, .mini-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.progress-track div, .mini-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #22c55e);
}
.progress-track.fee div { background: linear-gradient(90deg, #1d4ed8, #38bdf8); }
.dept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dept-card {
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}
.dept-card strong, .dept-card span { display: block; }
.dept-card strong { font-size: 14px; }
.dept-card span { margin: 4px 0 10px; color: #475569; font-weight: 800; }
.dept-card.test { background: #fffbeb; border-color: #fde68a; }
.reset-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
}
.reset-panel .note { grid-column: 1 / -1; margin: 0; color: #92400e; }
@media (max-width: 820px) {
  .hero-inner, .grid, .form-grid, .radio-row, .student-toolbar, .metric-grid, .dept-grid { grid-template-columns: 1fr; }
  .topbar { position: static; align-items: flex-start; }
  .doc-row, .doc-grid { grid-template-columns: 1fr; }
}
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .topbar, .hero, main > .section:not(.print-zone), .actions, .no-print, #adminGate, #adminPanel { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-zone, #adminPrintArea { display: block !important; }
  .print-doc, .id-card-doc { width: 100%; margin: 0 0 18px; border: 0; page-break-after: always; box-shadow: none; }
  .print-doc {
    padding: 12px;
    font-size: 11px;
    line-height: 1.35;
  }
  .print-doc header {
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom-width: 1px;
  }
  .print-doc footer {
    padding-top: 8px;
    margin-top: 10px;
    border-top-width: 1px;
  }
  .print-doc header img {
    width: 52px;
    height: 52px;
  }
  .print-doc h2 {
    font-size: 24px;
    margin-bottom: 6px;
  }
  .print-doc p {
    margin: 5px 0;
    line-height: 1.35;
  }
  .receipt-doc {
    font-size: 10px;
    padding: 9px;
  }
  .receipt-doc .doc-row {
    grid-template-columns: 86px 1fr;
    gap: 10px;
  }
  .receipt-doc .student-photo {
    width: 78px;
    height: 96px;
  }
  .receipt-doc .doc-grid div {
    padding: 5px;
  }
  .receipt-doc .doc-grid span {
    font-size: 8px;
  }
  .receipt-doc .doc-grid strong {
    font-size: 10px;
    margin-top: 2px;
  }
  .receipt-doc table {
    margin-top: 8px;
  }
  .receipt-doc th,
  .receipt-doc td {
    padding: 5px;
  }
  .receipt-doc .stamp,
  .application-doc .stamp {
    width: 58px;
    height: 58px;
    font-size: 6px;
  }
  .receipt-doc footer,
  .application-doc footer {
    font-size: 9px;
  }
  .id-card { box-shadow: none; }
}
