:root {
  --saffron: #e8a04a;
  --saffron-deep: #c47a22;
  --teal: #3d8f86;
  --teal-soft: #e7f4f2;
  --green: #2f7d4e;
  --ink: #2a3136;
  --ink-strong: #1c2328;
  --paper: #f4f1ea;
  --sky: #eef4f8;
  --card: #ffffff;
  --rule: #e2ddd4;
  --muted: #5c656c;
  --ok: #1f6b40;
  --err: #b4232c;
  --wa: #3d8f86;
  --wa-bg: #eef6f4;
  --wa-mine: #e7f3ea;
  --accent: #3d8f86;
  --header-bg: #fff8ef;
  --shadow: 0 8px 28px rgba(42, 49, 54, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Noto Sans Devanagari", "Noto Sans", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 280px at 8% -8%, #fff3e0 0%, transparent 58%),
    radial-gradient(800px 320px at 100% 0%, #e4f2f4 0%, transparent 50%),
    linear-gradient(180deg, var(--sky) 0%, var(--paper) 42%, #f7f5f0 100%);
  line-height: 1.55;
}

.tricolor {
  height: 8px;
  background: linear-gradient(90deg, #f0b35a 0 33.3%, #fff 33.3% 66.6%, #5da56a 66.6%);
}

.office-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.2rem;
  padding: 0.42rem 1.35rem;
  background: #fffefb;
  border-bottom: 1px solid #eadfce;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #3a4a3e;
  line-height: 1.45;
}
.office-bar span + span { color: #4a554c; }

.kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #2f7d4e;
  background: #eaf5ee;
  border: 1px solid #cfe3d6;
  padding: 0.16rem 0.55rem;
  border-radius: 4px;
  margin: 0 0 0.5rem;
}

.site-header {
  background: var(--header-bg);
  color: var(--ink-strong);
  padding: 1.05rem 1.35rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid #eadfce;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.emblem {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}
.brand h1 {
  font-family: "Tiro Devanagari Marathi", "Noto Serif Devanagari", serif;
  font-size: 1.22rem;
  margin: 0;
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--ink-strong);
  line-height: 1.4;
  max-width: 52rem;
}
.brand p { margin: 0.2rem 0 0; color: var(--muted); font-size: 1rem; }
.brand .tag {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 99px;
  padding: 0.18rem 0.6rem;
  font-weight: 700;
}

.wrap { width: min(1080px, calc(100% - 1.6rem)); margin: 1.4rem auto 3rem; }
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1.5rem 1rem 2.6rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: linear-gradient(180deg, #f0c27a, #7eb9b2);
}

.hero {
  padding: 1.55rem 1.55rem 1.4rem 1.85rem;
}
.hero h2,
.page-title {
  font-family: "Tiro Devanagari Marathi", serif;
  font-size: 1.65rem;
  margin: 0 0 0.45rem;
  color: var(--ink-strong);
  font-weight: 400;
}
.lede { margin: 0; color: var(--muted); line-height: 1.65; max-width: 46rem; font-size: 1.05rem; }

.notice {
  margin: 1.1rem 0 0;
  padding: 0.95rem 1.1rem;
  background: #fff7ea;
  border-left: 4px solid var(--saffron-deep);
  color: #4a3a22;
  border-radius: 0 12px 12px 0;
  font-size: 1.02rem;
}
.notice strong { color: var(--ink-strong); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  margin-top: 1.2rem;
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .brand h1 { font-size: 1.28rem; }
  .site-header { padding: 0.9rem 1rem; }
}

.school-card {
  padding: 1.2rem 1.25rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.school-card h3 {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.18rem;
  color: var(--ink-strong);
}
.prefix {
  display: inline-block;
  background: var(--teal-soft);
  color: #1f4f4a;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  font-size: 0.82rem;
}
.links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }

a.btn, button.btn, .btn {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset;
}
a.btn.secondary, button.btn.secondary {
  background: #5b7c8a;
}
a.btn.ghost, button.btn.ghost {
  background: #fff;
  color: var(--ink-strong);
  border: 1px solid #d5d0c8;
  box-shadow: none;
}
a.btn.green { background: var(--green); }
a.btn.wa { background: #4aa090; }

.form {
  padding: 1.45rem 1.5rem 1.7rem 1.85rem;
}
label {
  display: block;
  font-weight: 700;
  margin: 1.05rem 0 0.4rem;
  font-size: 1.08rem;
  color: var(--ink-strong);
}
.hint { font-weight: 400; color: var(--muted); font-size: 0.92rem; }
input[type="text"], input[type="tel"], input[type="number"], input[type="password"],
input[type="date"], select, input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.72rem 0.8rem;
  border: 1px solid #d4cfc6;
  border-radius: 12px;
  background: #fff;
  color: var(--ink-strong);
}
input:focus, select:focus {
  outline: 2px solid #b7ddd8;
  border-color: var(--teal);
}
.row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.9rem; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.err {
  background: #fdecee;
  color: var(--err);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  margin: 0.7rem 0;
  font-weight: 650;
}
.ok {
  background: #e8f6ee;
  color: var(--ok);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 650;
}

.stamp {
  width: 180px;
  height: 180px;
  border: 4px solid #c9a36a;
  color: #6a4e22;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(-6deg);
  margin: 0.5rem auto 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #fffaf2;
}
.stamp small { display: block; font-size: 0.72rem; letter-spacing: 0.1em; }
.stamp strong { font-size: 1.05rem; color: var(--ink-strong); }

.pay-box { text-align: center; padding: 1.5rem 1.2rem 1.7rem; }
.pay-box img.qr {
  width: 220px; height: 220px; background: #fff; padding: 10px;
  border: 1px solid var(--rule); border-radius: 16px;
}
.vpa {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0.7rem 0 0.2rem;
  color: var(--ink-strong);
}
.amount { font-size: 2.1rem; color: var(--saffron-deep); margin: 0; font-weight: 800; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
th, td { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--rule); text-align: left; color: var(--ink); }
th { background: #f7f3ec; font-weight: 700; color: var(--ink-strong); }
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  font-size: 0.78rem;
  background: #eef1f3;
  color: #3a444c;
}
.badge.paid { background: #ddf5e6; color: #145c32; }
.badge.awaiting_payment { background: #fff0d6; color: #7a4300; }
.badge.school_collected { background: #e3eefc; color: #1c3d7a; }
.badge.matched { background: #ddf5e6; color: #145c32; }
.badge.unmatched { background: #f8e6dc; color: #7a3414; }
.badge.mobile_mismatch { background: #fff4c8; color: #6a5200; }
.badge.received, .badge.docs_verified { background: #e7eef8; color: #243044; }
.badge.ready_for_inward { background: #ddf5e6; color: #145c32; }
.badge.inward_done, .badge.approved { background: #d4f0e0; color: #0d4a28; }
.badge.certificate_ready { background: #e7eef8; color: #243044; }
.badge.delivered, .badge.stub_logged, .badge.mapped { background: #ddf5e6; color: #145c32; }
.badge.queued { background: #fff0d6; color: #7a4300; }
.badge.payment_received { background: #e3eefc; color: #1c3d7a; }
.badge.document_submitted { background: #e7eef8; color: #243044; }
.badge.certificate_sent { background: #d4f0e0; color: #0d4a28; }
.badge.failed { background: #f8e6dc; color: #7a3414; }
.ivr-list { margin: 0; padding-left: 1.2rem; }
.ivr-list li { margin: 0.7rem 0; }
pre.ivr {
  white-space: pre-wrap;
  background: #f7f4ee;
  border: 1px solid var(--rule);
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: "Noto Sans Devanagari", system-ui, sans-serif;
  margin: 0.4rem 0 0;
  color: var(--ink);
}

.wrap.wide { width: min(1240px, calc(100% - 1.6rem)); }
.module-title {
  font-family: "Tiro Devanagari Marathi", serif;
  color: var(--ink-strong);
  margin: 0 0 0.45rem;
  font-size: 1.55rem;
  font-weight: 400;
}
.staff-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}
.staff-nav a {
  text-decoration: none;
  color: var(--ink-strong);
  border: 1px solid #ddd8d0;
  background: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 99px;
  font-size: 0.92rem;
}
.staff-nav a.on {
  background: var(--teal-soft);
  color: #1f4f4a;
  border-color: #b7d8d3;
  font-weight: 700;
}
.fee-inline { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.fee-inline input[type="text"], .fee-inline input[type="date"] { width: auto; min-width: 5.5rem; padding: 0.35rem 0.45rem; }
.login-checks { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; margin: 0.4rem 0; }
.assign-block { border-bottom: 1px solid var(--rule); padding: 0.8rem 0; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin: 0.9rem 0 1.1rem; }
.checklist div { padding: 0.65rem 0.75rem; border-radius: 12px; background: #f7f4ee; }
@media (max-width: 640px) { .checklist { grid-template-columns: 1fr; } }

.admin-bar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.1rem; }
.filters { display: flex; gap: 0.65rem; flex-wrap: wrap; align-items: end; }
.filters label { margin-top: 0; font-size: 0.95rem; }

.chat-page {
  min-height: 100vh;
  background:
    radial-gradient(700px 240px at 10% 0%, #fff3e0 0%, transparent 55%),
    linear-gradient(180deg, #f7f4ee 0%, #f4f1ea 100%);
}
.chat-page .wrap { margin-bottom: 0; }
.chat-shell {
  max-width: 440px;
  margin: 1.1rem auto 1.4rem;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}
.chat-head {
  background: var(--teal-soft);
  color: var(--ink-strong);
  padding: 0.9rem 1.05rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border-bottom: 1px solid #d5e8e4;
}
.chat-head .dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff;
  color: var(--teal);
  border: 1px solid #c9e4df;
  display: grid; place-items: center; font-weight: 800;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  background: var(--wa-bg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.bubble {
  max-width: 88%;
  padding: 0.65rem 0.8rem;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: 1.02rem;
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgba(42, 49, 54, 0.05);
}
.bubble.bot { background: #fff; align-self: flex-start; border: 1px solid #e4ecea; }
.bubble.user { background: var(--wa-mine); align-self: flex-end; border: 1px solid #d5e8d9; }
.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f7f5f1;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}
.chat-form input[type="text"] { flex: 1; min-width: 140px; }
.chat-form input[type="file"] { flex: 1 1 100%; }
.chat-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 1rem 1.6rem;
}
.chat-note a { color: var(--teal); font-weight: 700; }

.pack-qrs { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; }
.pack-qrs figure { margin: 0; text-align: center; }
.pack-qrs img {
  width: 180px; height: 180px; background: #fff; padding: 10px;
  border: 1px solid var(--rule); border-radius: 16px;
}
.url { font-size: 0.88rem; word-break: break-all; color: var(--muted); }

.print-sheet { background: #fff; padding: 1.5rem; }
@media print {
  .no-print, .site-header, .tricolor, .footer { display: none !important; }
  body { background: #fff; }
  .print-sheet { box-shadow: none; border: 2px solid #000; }
}

.steps { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.95rem 0 0; }
.steps span {
  background: #fff;
  border: 1px solid #e4ddd2;
  color: var(--ink);
  padding: 0.28rem 0.7rem;
  border-radius: 99px;
  font-size: 0.88rem;
}
.muted { color: var(--muted); }
.empty { padding: 1.6rem; text-align: center; color: var(--muted); }
nav.crumb { margin: 0 0 0.9rem; font-size: 0.95rem; color: var(--muted); }
nav.crumb a { color: var(--teal); font-weight: 700; }

/* ---- पडताळणी (verification) screen ---- */
.vf-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0; }
.vf-tabs a { padding: 0.45rem 0.8rem; border-radius: 999px; background: #fff; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 600; }
.vf-tabs a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.vf-count { display: inline-block; min-width: 1.6em; padding: 0 0.35em; border-radius: 999px; background: rgba(0,0,0,0.08); text-align: center; }
.vf-table-wrap { overflow-x: auto; }
.vf-table td, .vf-table th { vertical-align: top; }
.vf-pill { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.85rem; background: #eee; }
.vf-pill.ocr-done, .vf-pill.v-verified { background: #dff1e6; color: var(--ok); }
.vf-pill.ocr-failed, .vf-pill.v-needs_review, .vf-pill.v-reverify { background: #f9e1e2; color: var(--err); }
.vf-pill.ocr-pending, .vf-pill.ocr-running, .vf-pill.v-draft { background: #fff3cd; color: #856404; }
.vf-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; }
.vf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.vf-docs { position: sticky; top: 0.5rem; }
.vf-doc-tabs, .vf-tools { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; align-items: center; }
.vf-doc-tabs button, .vf-tools button { border: 1px solid var(--rule); background: #fff; border-radius: 8px; padding: 0.35rem 0.7rem; cursor: pointer; font: inherit; }
.vf-doc-tabs button.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.vf-viewer { height: 72vh; overflow: hidden; border: 1px solid var(--rule); border-radius: 10px; background: #f3f3f3; cursor: grab; display: flex; align-items: center; justify-content: center; }
.vf-viewer img { max-width: 100%; max-height: 100%; transform-origin: center; user-select: none; }
.vf-viewer iframe { width: 100%; height: 100%; border: 0; }
.vf-viewer[hidden], .vf-field[hidden], .vf-section[hidden] { display: none; }
.vf-note { font-size: 0.85rem; margin-top: 0.4rem; }
.vf-legend { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; font-size: 0.82rem; }
.vf-legend .lg { padding: 0.1rem 0.5rem; border-radius: 6px; border-left: 5px solid; background: #fafafa; }
.lg.high { border-color: #2f9e5b; } .lg.low { border-color: #e0a526; } .lg.empty { border-color: #b8b8b8; }
.lg.edited { border-color: #3a6fd8; } .lg.printed { border-color: var(--saffron-deep); }
.vf-section { border: 1px solid var(--rule); border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0 0 0.8rem; }
.vf-section legend { font-weight: 700; padding: 0 0.3rem; }
.vf-field { border-left: 5px solid #b8b8b8; padding: 0.35rem 0.6rem; margin: 0.35rem 0; background: #fcfcfc; border-radius: 6px; }
.vf-field.high { border-left-color: #2f9e5b; } .vf-field.low { border-left-color: #e0a526; background: #fffaf0; }
.vf-field.edited { border-left-color: #3a6fd8; } .vf-field.bad { background: #fdf0f0; }
.vf-field label { margin-top: 0; text-align: left; }
.vf-field small { display: block; line-height: 1.35; margin-top: 0.15rem; }
.vf-field input[readonly] { background: #eef2f1; color: var(--muted); }
.err-text { color: var(--err); font-weight: 600; } .warn-text { color: #8a6100; } .hint-text { color: #245e9e; }
.src-text { color: var(--muted); font-size: 0.78rem; }
.vf-actions { position: sticky; bottom: 0; background: var(--card); padding: 0.7rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; border-top: 1px solid var(--rule); }
.vf-review { flex: 1 1 220px; }
.vf-review textarea { width: 100%; font: inherit; padding: 0.4rem; border: 1px solid var(--rule); border-radius: 8px; margin: 0.3rem 0; }
.vf-audit { margin-top: 1rem; }
@media (max-width: 1000px) {
  .vf-grid { grid-template-columns: 1fr; }
  .vf-docs { position: static; }
  .vf-viewer { height: 55vh; }
}
.vf-conflict { margin: 0.3rem 0; padding: 0.4rem; border: 1px dashed var(--err); border-radius: 6px; background: #fff6f6; }
.vf-pick { margin: 0.2rem 0.3rem 0 0; border: 1px solid var(--rule); background: #fff; border-radius: 6px; padding: 0.2rem 0.5rem; cursor: pointer; font: inherit; }

/* ==================================================================================================
   v4 — responsive safety + tidier layout (UI only; 2026-09-25). Nothing may be cut or overflow the screen
   from 320 px phones to wide laptops: long words/links wrap, media shrinks, wide tables scroll inside
   their own box (never the page), controls stay full-width and ≥ 44 px tall for thumbs.
   ================================================================================================== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
main, .panel, .form, td, th, p, li, label, .notice, .err, .ok, .bubble { overflow-wrap: anywhere; min-width: 0; }
img, svg, video, canvas, iframe { max-width: 100%; }
img { height: auto; }
input[type="search"], input[type="email"], input[type="url"], textarea {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 0.72rem 0.8rem;
  border: 1px solid #d4cfc6; border-radius: 12px; background: #fff; color: var(--ink-strong);
}
input, select, textarea, button { max-width: 100%; }
select[size] { padding: 0.35rem; }
select[size] option { padding: 0.45rem 0.5rem; border-radius: 8px; white-space: normal; }
a.btn, button.btn, .btn { min-height: 44px; text-align: center; line-height: 1.3; }
.links .btn, p > .btn + .btn { margin-top: 0.35rem; }
a { color: var(--teal); }

/* tables: readable on phones — the table scrolls inside its own box, the page never scrolls sideways */
.tbl { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
@media (max-width: 760px) {
  main table:not(.keep) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  th, td { padding: 0.55rem 0.55rem; font-size: 0.95rem; }
}

/* header / page frame: compact on phones, brand shown once */
@media (max-width: 720px) {
  .tricolor { height: 6px; }
  .office-bar { justify-content: center; text-align: center; padding: 0.35rem 0.8rem; font-size: 0.74rem; }
  .office-bar span + span { display: none; }
  .site-header { padding: 0.75rem 0.9rem; gap: 0.7rem; align-items: flex-start; }
  .emblem { width: 44px; height: 44px; flex: 0 0 44px; }
  .brand h1 { font-size: 1.02rem; line-height: 1.45; }
  .brand p { font-size: 0.88rem; }
  .brand .tag { font-size: 0.7rem; margin-top: 0.3rem; }
  .wrap, .wrap.wide { width: calc(100% - 1rem); margin: 0.8rem auto 2rem; }
  .panel { border-radius: 14px; }
  .panel::before { width: 5px; }
  .hero { padding: 1.1rem 1rem 1.1rem 1.3rem; }
  .form { padding: 1rem 0.95rem 1.2rem 1.25rem; }
  .hero h2, .page-title { font-size: 1.35rem; line-height: 1.35; }
  .module-title { font-size: 1.3rem; }
  label { font-size: 1rem; margin-top: 0.85rem; }
  .notice { font-size: 0.97rem; padding: 0.8rem 0.9rem; }
  .lede { font-size: 1rem; }
  .form .btn, .hero .btn, .actions .btn { width: 100%; }
  .stamp { width: 150px; height: 150px; }
  .footer { font-size: 0.82rem; padding: 1.2rem 0.8rem 2rem; }
  .fee-inline input[type="text"], .fee-inline input[type="date"] { width: 100%; }
  .filters > * { flex: 1 1 100%; }
  .admin-bar { align-items: stretch; }
  .chat-shell { height: calc(100dvh - 1rem); margin: 0.5rem auto; border-radius: 14px; }
  .staff-nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.3rem; -webkit-overflow-scrolling: touch; }
  .staff-nav a { white-space: nowrap; }
}
@media (max-width: 380px) {
  .brand .tag { display: none; }
  .hero h2, .page-title { font-size: 1.22rem; }
}

/* ---------- parent pages: numbered sections, clean steps, status timeline ---------- */
.sec { border: 1px solid var(--rule); border-radius: 14px; padding: 0.9rem 1rem 1rem; margin: 1rem 0 0; background: #fffdf9; }
.sec > h3 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.2rem; font-size: 1.08rem; color: var(--ink-strong); }
.sec > h3 .n { flex: 0 0 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--teal); color: #fff;
  display: grid; place-items: center; font-size: 0.95rem; font-weight: 800; }
.sec > label:first-of-type { margin-top: 0.6rem; }
.filebox { border: 1px dashed #cfc7ba; border-radius: 12px; padding: 0.55rem 0.7rem 0.7rem; margin-top: 0.7rem; background: #fff; }
.filebox label { margin-top: 0; }
.actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.steps.numbered { counter-reset: st; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 0.5rem; }
.steps.numbered span { counter-increment: st; border-radius: 12px; padding: 0.55rem 0.7rem; display: flex; gap: 0.5rem; align-items: center; background: #fbf8f2; }
.steps.numbered span::before { content: counter(st); flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--saffron);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; }
.picker { max-width: 620px; }
.chosen { margin-top: 0.6rem; }
.timeline { list-style: none; margin: 1rem 0 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 2.4rem; }
.timeline li::before { content: "…"; position: absolute; left: 0; top: 0.05rem; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: #eef1f3; color: var(--muted); display: grid; place-items: center; font-weight: 800; }
.timeline li.done::before { content: "✔"; background: #ddf5e6; color: var(--ok); }
.timeline li::after { content: ""; position: absolute; left: 0.83rem; top: 1.85rem; bottom: 0.1rem; width: 2px; background: var(--rule); }
.timeline li:last-child::after { display: none; }
.timeline .t { font-weight: 700; color: var(--ink-strong); }
.timeline .d { float: right; color: var(--muted); font-size: 0.9rem; margin-left: 0.5rem; }
.kv { width: 100%; max-width: 560px; margin: 0 auto; text-align: left; }
.kv td:first-child { color: var(--muted); white-space: nowrap; width: 38%; }
@media (max-width: 480px) { .kv td:first-child { white-space: normal; } }
@media print { .actions, .no-print { display: none !important; } }

/* ---------- document picker: camera or file, preview ---------- */
.real-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.real-file.show { position: static; width: 100%; height: auto; opacity: 1; pointer-events: auto; margin-top: .4rem; }
.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .45rem; }
.pick-row .btn { width: 100%; font-size: .98rem; padding: .6rem .5rem; }
.pick-row .btn.cam { background: var(--green); }
.pick-state { margin-top: .45rem; font-size: .92rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pick-state.ok { color: var(--ok); font-weight: 650; }
.pick-state img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.filebox { position: relative; }
.filebox label.sub { margin-top: .9rem; padding-top: .7rem; border-top: 1px dashed var(--rule); font-size: .98rem; }
@media (max-width: 340px) { .pick-row { grid-template-columns: 1fr; } }
.sec > h3 { flex-wrap: wrap; }
.sec > h3 .hint { flex: 1 1 100%; padding-left: 2.45rem; font-weight: 400; }
label.btn.ghost, .btn.ghost { background: #fff; color: var(--ink-strong); border: 1px solid #d5d0c8; box-shadow: none; }
label.btn { margin: 0; font-size: 1rem; }

/* ---------- v5: school + office pages (UI only) ---------- */
section.panel:not(.form):not(.hero) { padding: 1.1rem 1.2rem 1.2rem 1.55rem; }
.panel > h3, .panel.form > h3 { margin: 0 0 0.7rem; font-size: 1.12rem; color: var(--ink-strong); }
.panel + .panel, .panel + section, section + .panel { margin-top: 1rem; }
.admin-bar .kicker { margin-bottom: 0.3rem; }
.admin-bar .muted { margin: 0.2rem 0 0; }
details > summary { cursor: pointer; color: var(--teal); font-weight: 650; margin-top: 0.35rem; }
details[open] > form { margin-top: 0.4rem; display: grid; gap: 0.4rem; }
td form { margin: 0.2rem 0; }
td .btn { padding: 0.45rem 0.8rem; min-height: 38px; }
.vf-table-wrap { border-radius: 12px; }
@media (min-width: 761px) {
  table.cards tbody tr:hover td { background: #fbf8f2; }
}
@media (max-width: 760px) {
  section.panel:not(.form):not(.hero) { padding: 0.9rem 0.8rem 1rem 1.15rem; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  main table.cards { overflow: visible; }
  table.cards thead { display: none; }
  table.cards tr { border: 1px solid var(--rule); border-radius: 12px; padding: 0.55rem 0.75rem; margin: 0 0 0.7rem; background: #fff;
    box-shadow: 0 1px 3px rgba(42, 49, 54, 0.05); }
  table.cards td { border: 0; padding: 0.3rem 0; }
  table.cards td[data-label]::before { content: attr(data-label); display: block; font-size: 0.8rem; font-weight: 700;
    color: var(--muted); letter-spacing: 0.02em; }
  table.cards td:empty { display: none; }
  table.cards .fee-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  table.cards .fee-inline label, table.cards .fee-inline .btn { grid-column: 1 / -1; }
  table.cards .fee-inline input[type="text"] { max-width: none !important; }
  .filters input, .filters select { max-width: none !important; }
  .admin-bar { margin-bottom: 0.8rem; }
}
@media (max-width: 760px) {
  table.cards tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.8rem; }
  table.cards td:first-child, table.cards td:last-child { grid-column: 1 / -1; }
  table.cards td:first-child { font-weight: 700; color: var(--ink-strong); border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; margin-bottom: 0.2rem; }
  table.cards td:last-child { border-top: 1px dashed var(--rule); margin-top: 0.3rem; padding-top: 0.5rem; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .filters select, .filters .btn { grid-column: 1 / -1; }
}
@media (min-width: 761px) {
  .filters select { width: auto; min-width: 12rem; }
  .filters input[type="text"] { width: 7rem; }
  .fee-inline select { width: auto; padding: 0.35rem 0.45rem; }
  .fee-inline { gap: 0.4rem 0.5rem; }
  table.cards td { vertical-align: middle; }
}
@media (max-width: 760px) {
  .filters > * { min-width: 0; }
  .filters > div select, .filters > div input { width: 100%; min-width: 0; }
  .filters > a.btn { grid-column: auto; }
}
