:root {
  /* Maharashtra / India Official Gov Palette */
  --saffron: #f97316;
  --saffron-deep: #ea580c;
  --saffron-dark: #c2410c;
  --saffron-soft: #fff7ed;
  --saffron-border: #fed7aa;
  
  --green: #15803d;
  --green-deep: #166534;
  --green-soft: #f0fdf4;
  --green-border: #bbf7d0;
  --emerald: #10b981;
  
  --navy: #0f172a;
  --slate: #1e293b;
  --slate-muted: #475569;
  
  --ink: #1e293b;
  --ink-strong: #0f172a;
  --paper: #f8fafc;
  --sky: #f1f5f9;
  --card: #ffffff;
  --rule: #e2e8f0;
  --rule-light: #f1f5f9;
  --muted: #64748b;
  --light-muted: #94a3b8;
  
  --ok: #15803d;
  --ok-bg: #ecfdf5;
  --ok-border: #a7f3d0;
  
  --err: #dc2626;
  --err-bg: #fef2f2;
  --err-border: #fecaca;
  
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  
  --wa: #25d366;
  --wa-dark: #128c7e;
  --wa-bg: #f0fdf4;
  --wa-mine: #dcf8c6;
  
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --teal-border: #99f6e4;
  
  --header-bg: #ffffff;
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 35px -6px rgba(15, 23, 42, 0.1), 0 8px 16px -4px rgba(15, 23, 42, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  font-family: "Plus Jakarta Sans", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 400px at 15% -5%, rgba(249, 115, 22, 0.08) 0%, transparent 60%),
    radial-gradient(800px 400px at 90% -5%, rgba(21, 128, 61, 0.07) 0%, transparent 55%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 45%, #f8fafc 100%);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* ==========================================================================
   Tricolor Ribbon & Gov Topbar
   ========================================================================== */
.tricolor {
  height: 5px;
  background: linear-gradient(90deg, #ff9933 0%, #ff9933 33.3%, #ffffff 33.3%, #ffffff 66.6%, #138808 66.6%, #138808 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.office-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.2rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-muted);
}
.office-bar-left, .office-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.office-title {
  font-weight: 700;
  color: var(--ink-strong);
}
.office-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--saffron-soft);
  color: var(--saffron-dark);
  border: 1px solid var(--saffron-border);
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
}
.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--saffron-soft);
  color: var(--saffron-dark);
  border: 1px solid var(--saffron-border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}
.status-btn:hover {
  background: var(--saffron);
  color: #ffffff;
  text-decoration: none;
}

/* ==========================================================================
   Header & Emblem Branding
   ========================================================================== */
.site-header {
  background: #ffffff;
  color: var(--ink-strong);
  padding: 0.65rem 1.4rem;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  position: relative;
  z-index: 20;
}
.emblem-wrap {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
.emblem {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.06));
}
.brand {
  flex: 1;
}
.brand h1 {
  font-family: "Tiro Devanagari Marathi", "Noto Serif Devanagari", serif;
  font-size: 1.28rem;
  margin: 0;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.brand p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 500;
}
.brand-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.brand .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--green-deep);
  background: var(--green-soft);
  border: 1px solid var(--green-border);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.65rem;
  font-weight: 700;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 1.8rem auto 3.5rem;
}
.wrap.wide {
  width: min(1320px, calc(100% - 2rem));
}
main, .panel, .form, td, th, p, li, label, .notice, .err, .ok, .bubble {
  overflow-wrap: anywhere;
  min-width: 0;
}

/* ==========================================================================
   Panels & Cards
   ========================================================================== */
.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.panel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--saffron) 0%, #fbbf24 45%, var(--green) 100%);
}
.panel:hover {
  box-shadow: var(--shadow-lg);
}
/* plain panel holding a heading / list / table: keep text clear of the coloured edge (01-10-2026) */
.panel.pad {
  padding: 1.1rem 1.2rem 1.1rem 1.5rem;
}

.hero {
  padding: 2rem 2rem 1.8rem 2.4rem;
  background:
    radial-gradient(ellipse at top right, rgba(249, 115, 22, 0.05) 0%, transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #fafaf9 100%);
}
.hero h2,
.page-title {
  font-family: "Tiro Devanagari Marathi", serif;
  font-size: 1.85rem;
  margin: 0.2rem 0 0.4rem;
  color: var(--ink-strong);
  font-weight: 600;
  line-height: 1.3;
}
.module-title {
  font-family: "Tiro Devanagari Marathi", serif;
  color: var(--ink-strong);
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 600;
}
.lede {
  margin: 0;
  color: var(--slate-muted);
  line-height: 1.7;
  max-width: 48rem;
  font-size: 1.05rem;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--saffron-dark);
  background: var(--saffron-soft);
  border: 1px solid var(--saffron-border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  margin: 0 0 0.6rem;
}

.prefix {
  display: inline-flex;
  align-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid var(--teal-border);
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */
a {
  color: var(--saffron-deep);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--saffron-dark);
  text-decoration: underline;
}

a.btn, button.btn, .btn {
  appearance: none;
  border: 1px solid transparent;
  background: linear-gradient(180deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 0.72rem 1.4rem;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: var(--transition);
  min-height: 46px;
  line-height: 1.3;
}
a.btn:hover, button.btn:hover, .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
  background: linear-gradient(180deg, #fb923c 0%, var(--saffron) 100%);
}
a.btn:active, button.btn:active, .btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.2);
}

a.btn.secondary, button.btn.secondary {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(30, 41, 59, 0.2);
}
a.btn.secondary:hover, button.btn.secondary:hover {
  background: linear-gradient(180deg, #475569 0%, #334155 100%);
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

a.btn.ghost, button.btn.ghost {
  background: #ffffff;
  color: var(--ink-strong) !important;
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow-sm);
}
a.btn.ghost:hover, button.btn.ghost:hover {
  background: var(--sky);
  border-color: var(--light-muted);
  box-shadow: var(--shadow);
}

a.btn.green, button.btn.green {
  background: linear-gradient(180deg, #16a34a 0%, var(--green) 100%);
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}
a.btn.green:hover, button.btn.green:hover {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.35);
}

a.btn.wa, button.btn.wa {
  background: linear-gradient(180deg, #25d366 0%, #16a34a 100%);
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.actions {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

/* ==========================================================================
   Alerts, Notices & Callouts
   ========================================================================== */
.notice {
  margin: 1.2rem 0 0;
  padding: 1rem 1.2rem;
  background: var(--saffron-soft);
  border: 1px solid var(--saffron-border);
  border-left: 5px solid var(--saffron-deep);
  color: #7c2d12;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.98rem;
  line-height: 1.6;
}
.notice strong { color: #431407; }

.err {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  border-left: 5px solid var(--err);
  color: #991b1b;
  padding: 0.95rem 1.2rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 0.9rem 0;
  font-weight: 600;
  line-height: 1.5;
}

.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-left: 5px solid var(--ok);
  color: #166534;
  padding: 0.95rem 1.2rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 0.9rem 0;
  font-weight: 600;
  line-height: 1.5;
}

/* ==========================================================================
   Forms & Form Controls
   ========================================================================== */
.form {
  padding: 1.8rem 2rem 2rem 2.4rem;
}
label {
  display: block;
  font-weight: 700;
  margin: 1.15rem 0 0.45rem;
  font-size: 1.02rem;
  color: var(--ink-strong);
}
.hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.88rem;
  margin-left: 0.35rem;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.02rem;
  padding: 0.75rem 0.95rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--ink-strong);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
  background: #ffffff;
}

input[readonly] {
  background: var(--sky);
  color: var(--muted);
  cursor: not-allowed;
}

/* Password Visibility Toggle */
.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.password-input-wrap input {
  padding-right: 3.2rem !important;
}
.password-toggle-btn {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  user-select: none;
  z-index: 5;
}
.password-toggle-btn:hover {
  color: var(--ink-strong);
  background: rgba(0, 0, 0, 0.06);
}
.password-toggle-btn:focus {
  outline: 2px solid var(--saffron);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1em;
  padding-right: 2.5rem;
}
/* iPhone Safari keeps its own date-box width unless the native look is switched off — every date box
   stays inside its column (01-10-2026; same fix as the collections report) */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
  min-height: 2.9rem;
}
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

/* Numbered Form Sections */
.sec {
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.4rem 1.4rem;
  margin: 1.3rem 0 0;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.sec > h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: var(--ink-strong);
  font-weight: 700;
}
.sec > h3 .n {
  flex: 0 0 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.25);
}

/* ==========================================================================
   File Picker & Document Upload Cards
   ========================================================================== */
.filebox {
  border: 1.5px dashed var(--saffron-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 1rem;
  margin-top: 0.9rem;
  background: #fffdfa;
  transition: var(--transition);
}
.filebox:hover {
  border-color: var(--saffron);
  background: #ffffff;
}
.filebox label {
  margin-top: 0;
  font-size: 1rem;
}
.filebox label.sub {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--rule);
  font-size: 0.96rem;
}

.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: 0.5rem;
}

.pick-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.pick-row .btn {
  width: 100%;
  font-size: 0.94rem;
  padding: 0.65rem 0.6rem;
  min-height: 42px;
}
.pick-row .btn.cam {
  background: linear-gradient(180deg, #16a34a 0%, var(--green) 100%);
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}
.pick-row .btn.cam:hover {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.pick-state {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pick-state.ok {
  color: var(--ok);
  font-weight: 700;
}
.pick-state img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ok-border);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Steppers & Roadmaps
   ========================================================================== */
.steps.numbered {
  counter-reset: st;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin: 1.1rem 0 0;
}
.steps.numbered span {
  counter-increment: st;
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-strong);
}
.steps.numbered span::before {
  content: counter(st);
  flex: 0 0 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-deep) 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 2px 4px rgba(234, 88, 12, 0.2);
}

/* ==========================================================================
   Timeline (Parent Status Tracker)
   ========================================================================== */
.timeline {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  position: relative;
}
.timeline li {
  position: relative;
  padding: 0 0 1.4rem 2.8rem;
}
.timeline li::before {
  content: "○";
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--sky);
  border: 2px solid var(--rule);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  z-index: 2;
  transition: var(--transition);
}
.timeline li.done::before {
  content: "✔";
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(21, 128, 61, 0.3);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 2rem;
  bottom: 0;
  width: 2.5px;
  background: var(--rule);
  z-index: 1;
}
.timeline li.done::after {
  background: var(--ok-border);
}
.timeline li:last-child::after {
  display: none;
}
.timeline .t {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-strong);
}
.timeline .d {
  float: right;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  background: var(--sky);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Tables & Card Responsive Table
   ========================================================================== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  background: #ffffff;
}
th, td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  color: var(--ink);
}
th {
  background: var(--sky);
  font-weight: 700;
  color: var(--ink-strong);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
tbody tr {
  transition: var(--transition);
}
tbody tr:hover {
  background: #fafaf9;
}

.cards thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* KV Table */
.kv {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.kv td {
  padding: 0.8rem 1rem;
}
.kv td:first-child {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  width: 36%;
  background: var(--sky);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--sky);
  color: var(--slate);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.badge.paid, .badge.matched, .badge.ready_for_inward, .badge.inward_done,
.badge.approved, .badge.delivered, .badge.stub_logged, .badge.mapped,
.badge.certificate_sent {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}
.badge.awaiting_payment, .badge.queued {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn-border);
}
.badge.school_collected, .badge.payment_received {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-border);
}
.badge.unmatched, .badge.failed {
  background: var(--err-bg);
  color: var(--err);
  border-color: var(--err-border);
}
.badge.mobile_mismatch {
  background: #fefce8;
  color: #854d0e;
  border-color: #fef08a;
}
.badge.received, .badge.docs_verified, .badge.certificate_ready, .badge.document_submitted {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

/* ==========================================================================
   Admin & School Navbars
   ========================================================================== */
.staff-nav, .school-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0 0 1.4rem;
  padding: 0.45rem;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.staff-nav a, .school-tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-md);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  border: 1px solid transparent;
}
.staff-nav a:hover, .school-tabs a:hover {
  background: var(--sky);
  color: var(--ink-strong);
  text-decoration: none;
}
.staff-nav a.on, .school-tabs a.on {
  background: var(--saffron-soft);
  color: var(--saffron-dark);
  border-color: var(--saffron-border);
  font-weight: 700;
}
.school-tabs a.on::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  right: 0.95rem;
  bottom: 0.2rem;
  height: 3px;
  border-radius: 3px;
  background: var(--saffron);
}
.school-tabs svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.school-tabs .out {
  margin-left: auto;
  color: var(--err);
}
.school-tabs .out:hover {
  background: var(--err-bg);
  color: var(--err);
}

/* ==========================================================================
   Grids & Stats Cards
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.school-card {
  padding: 1.4rem;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.school-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--saffron-border);
}
.school-card h3 {
  margin: 0.5rem 0 0.3rem;
  font-size: 1.25rem;
  color: var(--ink-strong);
  font-weight: 700;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
}
.stat {
  background: var(--sky);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  transition: var(--transition);
}
.stat:hover {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.stat b {
  display: block;
  font-size: 1.65rem;
  color: var(--ink-strong);
  font-weight: 800;
  line-height: 1.2;
}
.stat span {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.progress {
  height: 10px;
  background: var(--rule);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 1rem 0 0.4rem;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--saffron) 0%, var(--green) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ==========================================================================
   Stamp & Paybox (Receipts)
   ========================================================================== */
.stamp {
  width: 170px;
  height: 170px;
  border: 3.5px dashed var(--saffron-deep);
  color: var(--saffron-dark);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  transform: rotate(-6deg);
  margin: 0.8rem auto 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #fffbf5;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.1);
}
.stamp small {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.stamp strong {
  font-size: 1.12rem;
  color: var(--ink-strong);
}

.pay-box {
  text-align: center;
  padding: 1.8rem 1.4rem;
}
.pay-box img.qr {
  width: 220px;
  height: 220px;
  background: #ffffff;
  padding: 10px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.vpa {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0.8rem 0 0.2rem;
  color: var(--ink-strong);
}
.amount {
  font-size: 2.2rem;
  color: var(--saffron-deep);
  margin: 0;
  font-weight: 800;
}

/* ==========================================================================
   Chat & WhatsApp Simulator
   ========================================================================== */
.chat-page {
  min-height: 100vh;
  background:
    radial-gradient(800px 300px at 15% 0%, #fff7ed 0%, transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.chat-shell {
  max-width: 480px;
  margin: 1.2rem auto 2rem;
  background: #ffffff;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  height: 84vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}
.chat-head {
  background: var(--wa-bg);
  color: var(--ink-strong);
  padding: 1rem 1.2rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
  border-bottom: 1px solid var(--green-border);
}
.chat-head .dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--green);
  border: 1.5px solid var(--green-border);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  background: #eef5f1;
  background-image: radial-gradient(rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.bubble {
  max-width: 86%;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 1rem;
  color: var(--ink-strong);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.bubble.bot {
  background: #ffffff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bubble.user {
  background: var(--wa-mine);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-form {
  display: flex;
  gap: 0.55rem;
  padding: 0.85rem;
  background: #ffffff;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}
.chat-form input[type="text"] {
  flex: 1;
  min-width: 150px;
}

/* ==========================================================================
   Verification Split View & Document Inspection
   ========================================================================== */
.vf-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.vf-docs {
  position: sticky;
  top: 1rem;
}
.vf-viewer {
  height: 74vh;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #1e293b;
  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-doc-tabs, .vf-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  align-items: center;
}
.vf-doc-tabs button, .vf-tools button {
  border: 1px solid var(--rule);
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}
.vf-doc-tabs button.on {
  background: var(--saffron);
  color: #ffffff;
  border-color: var(--saffron);
}

/* ==========================================================================
   Footer & Meta
   ========================================================================== */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 2.2rem 1.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  background: #ffffff;
  margin-top: 3rem;
  line-height: 1.7;
}

nav.crumb {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}
nav.crumb a {
  color: var(--saffron-deep);
  font-weight: 700;
}

.admin-bar {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.3rem;
}
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 1.1rem 1.3rem;
}
.filters label {
  margin-top: 0;
  font-size: 0.92rem;
}
.fee-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.fee-inline input[type="text"], .fee-inline input[type="date"] {
  width: auto;
  min-width: 6rem;
  padding: 0.45rem 0.6rem;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 768px) {
  /* filter rows on phones: 2 equal columns, every box full cell width — no ragged half-empty lines (01-10-2026) */
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; padding: 0.8rem; }
  .filters > * { min-width: 0; }
  .filters select, .filters input { width: 100%; min-width: 0; margin: 0; font-size: 0.95rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .filters select { padding-left: 0.65rem; padding-right: 1.8rem; background-position: right 0.45rem center; }
  .filters .btn { width: 100%; justify-content: center; margin: 0; padding-left: 0.5rem; padding-right: 0.5rem; }
  .office-bar {
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
  }
  .office-badge {
    display: none;
  }
  .site-header {
    padding: 0.4rem 0.65rem;
    gap: 0.55rem;
  }
  .emblem-wrap {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
  }
  .brand h1 {
    font-size: 0.88rem;
    line-height: 1.25;
  }
  .brand-tags {
    display: none;
  }
  .wrap, .wrap.wide {
    width: calc(100% - 0.9rem);
    margin: 0.7rem auto 2.5rem;
  }
  .hero {
    padding: 1.1rem 1rem;
  }
  .form {
    padding: 1rem 0.9rem;
  }
  .panel.pad {
    padding: 1rem 0.9rem;
  }
  .hero h2, .page-title {
    font-size: 1.25rem;
  }
  .module-title {
    font-size: 1.15rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .vf-grid {
    grid-template-columns: 1fr;
  }
  .vf-docs {
    position: static;
  }
  .vf-viewer {
    height: 52vh;
  }
  
  /* School Tabs: All 8 tabs clearly visible without horizontal scroll */
  .school-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    padding: 0.3rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }
  @media (max-width: 480px) {
    .school-tabs {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  .school-tabs a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.45rem 0.2rem;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    border-radius: var(--radius-md);
    background: var(--sky);
    border: 1px solid var(--rule);
    min-height: 52px;
  }
  .school-tabs a svg {
    width: 18px;
    height: 18px;
    margin-bottom: 0.15rem;
  }
  .school-tabs a.on {
    background: var(--saffron-soft);
    color: var(--saffron-dark);
    border-color: var(--saffron-border);
    box-shadow: 0 1px 4px rgba(234, 88, 12, 0.2);
  }
  .school-tabs a.on::after {
    display: none;
  }
  .school-tabs .out {
    margin-left: 0;
    color: var(--err);
    background: var(--err-bg);
    border-color: var(--err-border);
  }

  /* Staff / Admin Nav Grid on Mobile */
  .staff-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.3rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
  }
  .staff-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.4rem 0.2rem;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: normal;
    min-height: 42px;
    border-radius: var(--radius-md);
    background: var(--sky);
    border: 1px solid var(--rule);
  }
  .staff-nav a.on {
    background: var(--saffron-soft);
    color: var(--saffron-dark);
    border-color: var(--saffron-border);
  }
  .staff-nav a[style*="margin-left:auto"] {
    margin-left: 0 !important;
  }
  
  /* Responsive Tables on Mobile */
  main table.cards {
    display: block;
    overflow: visible;
  }
  table.cards thead {
    display: none;
  }
  table.cards tbody, table.cards tr, table.cards td {
    display: block;
    width: 100%;
  }
  table.cards tr {
    border: 1.5px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
    margin: 0 0 0.85rem;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
  }
  table.cards td {
    border: 0;
    padding: 0.4rem 0;
  }
  table.cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
  .no-print, .site-header, .tricolor, .office-bar, .footer, .actions, nav {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  .wrap, .wrap.wide {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .panel {
    box-shadow: none !important;
    border: 1.5px solid #000000 !important;
    border-radius: 0 !important;
    page-break-inside: avoid;
  }
  .panel::before {
    display: none;
  }
  .stamp {
    border: 2px solid #000000 !important;
    color: #000000 !important;
    background: transparent !important;
  }
}

/* ==========================================================================
   Existing screens (verification, OCR, teachers, money, links …): rules kept from the
   previous stylesheet for classes the new design does not define (28-09-2026).
   ========================================================================== */
.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);
}
.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; }
}
.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 {
  .print-sheet { box-shadow: none; border: 2px solid #000; }
}
.muted { color: var(--muted); }
.empty { padding: 1.6rem; text-align: center; color: var(--muted); }
.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-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; }
.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; }
.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%; }
}
.picker { max-width: 620px; }
.chosen { margin-top: 0.6rem; }
.admin-bar .muted { margin: 0.2rem 0 0; }
.vf-table-wrap { border-radius: 12px; }
.job { border-top: 1px solid var(--rule); padding: 0.7rem 0; }
.ok-text { color: var(--ok); font-weight: 700; }

/* ==========================================================================
   Compact phones (29-09-2026): card tables show "label : value" on one line
   instead of label above value — every page with table.cards gets shorter.
   ========================================================================== */
@media (max-width: 768px) {
  table.cards tr { padding: 0.45rem 0.7rem; margin: 0 0 0.5rem; }
  table.cards td { padding: 0.15rem 0; font-size: 0.92rem; line-height: 1.4; }
  table.cards td[data-label]::before {
    display: inline-block; width: 38%; vertical-align: top; padding-right: 0.4rem;
    font-size: 0.72rem; letter-spacing: 0; text-transform: none;
  }
}
