/* VCREDIL - mobile-first, text-light, large tap targets. No external fonts or CDNs. */
:root {
  --ink: #1b2430; --muted: #5d6b7a; --line: #dfe5ec; --bg: #f5f7fa; --card: #fff;
  --brand: #0b5cad; --brand-ink: #fff; --ok: #1e7b45; --warn: #9a5b00; --err: #b3261e;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", Mangal, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 var(--font); color: var(--ink); background: var(--bg); }
.lang-hi { font-size: 18px; line-height: 1.7; }
a { color: var(--brand); }
h1 { font-size: 1.45rem; line-height: 1.3; margin: 0 0 .75rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; }
.topnav { display: flex; gap: 1rem; align-items: center; }
.langs a { text-decoration: none; padding: .2rem .45rem; border-radius: 6px; color: var(--muted); }
.langs a.on { background: var(--bg); color: var(--ink); font-weight: 600; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }

.wrap { max-width: 720px; margin: 0 auto; padding: 1rem; }
.wrap.narrow { max-width: 600px; padding-top: 1.25rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.notice { background: #fff8e6; border: 1px solid #f1d58a; padding: .7rem .9rem; border-radius: 8px; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

.hero { text-align: center; padding: 2.5rem .5rem; }
.hero h1 { font-size: 1.8rem; }
.facts { list-style: none; padding: 0; display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; margin: 1.5rem 0; }
.facts strong { display: block; font-size: 1.6rem; color: var(--brand); }
.actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

label { display: block; margin: 0 0 1rem; font-weight: 600; }
input, select { display: block; width: 100%; margin-top: .35rem; padding: .8rem .9rem; font: inherit; border: 1px solid #c4ced9; border-radius: 10px; background: #fff; min-height: 48px; }
input:focus, select:focus { outline: 3px solid #b9d6f5; border-color: var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 600; margin-bottom: .4rem; }
.grid2 { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.check input { width: 22px; height: 22px; min-height: 0; margin: .2rem 0 0; }
.ticks { padding-left: 1.2rem; }
.ticks li { margin-bottom: .4rem; }

.btn { display: inline-block; padding: .85rem 1.3rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 50px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn.block { display: block; width: 100%; margin-top: .6rem; }
.btn:disabled { opacity: .6; }

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash-error { background: #fdecea; color: var(--err); }
.flash-info { background: #e8f1fb; color: var(--brand); }
.flash-success { background: #e7f5ec; color: var(--ok); }

/* choices (residence, answers) */
.choices { display: grid; gap: .6rem; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.three .choice span { padding: .9rem .4rem; white-space: nowrap; font-size: .95rem; }
.choice, .option { position: relative; display: block; margin: 0; font-weight: 500; cursor: pointer; }
.choice input, .option input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.choice span, .option span { display: block; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; text-align: center; min-height: 54px; }
.choice input:checked + span, .option input:checked + span { border-color: var(--brand); background: #eaf3fd; font-weight: 600; }
.choice input:focus-visible + span, .option input:focus-visible + span { outline: 3px solid #b9d6f5; }

/* assessment */
.assess-body { background: #fff; }
.progress { width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; appearance: none; }
.progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
.progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
.progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
.step { color: var(--muted); font-size: .9rem; margin: .5rem 0 1.25rem; }
.qtext { font-size: 1.3rem; font-weight: 600; line-height: 1.45; margin-bottom: 1.5rem; }
.options { display: grid; gap: .6rem; margin-bottom: 1rem; }
.options .option span { text-align: left; }
.options.two { grid-template-columns: 1fr; }
@media (min-width: 560px) { .options.two { grid-template-columns: 1fr 1fr; } .options.two .option span { text-align: center; } }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* result */
.score-ring { width: 160px; height: 160px; margin: 1rem auto; border-radius: 50%; border: 10px solid var(--brand); display: grid; place-content: center; }
.score-ring span { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.score-ring small { color: var(--muted); }
.score-ring.pending { border-color: var(--ok); }
.status { font-weight: 700; font-size: 1.1rem; }
.status.ok, .status.hold { color: var(--ok); }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: .6rem .3rem; border-bottom: 1px solid var(--line); text-align: left; }
.pill { white-space: nowrap; font-size: .82rem; padding: .15rem .55rem; border-radius: 99px; background: var(--bg); }
.pill-completed { background: #e7f5ec; color: var(--ok); }
.pill-held { background: #fff4e0; color: var(--warn); }
.pill-in_progress { background: #e8f1fb; color: var(--brand); }

/* ---------------- admin ---------------- */
body.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; font-size: 15px; background: #f3f5f8; }
.side { background: #12263f; color: #cfd9e6; padding: 1rem .75rem; display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; }
.side .brand small { color: #8fa6c1; font-weight: 400; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: #cfd9e6; text-decoration: none; padding: .5rem .7rem; border-radius: 8px; }
.side nav a:hover { background: #1b3553; }
.side nav a.on { background: #0b5cad; color: #fff; }
.side .who { margin-top: auto; font-size: .85rem; }
.side .who .pill { background: #1b3553; color: #cfd9e6; }
.side button.link { color: #8fc1f5; margin-top: .4rem; }
.admin-main { padding: 1.25rem 1.5rem; min-width: 0; }
.admin-main h1 { font-size: 1.35rem; }
.banner { background: #fff8e6; border: 1px solid #f1d58a; color: #6b4b00; padding: .5rem .8rem; border-radius: 8px; font-size: .85rem; margin-bottom: 1rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.02rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; color: var(--muted); font-size: .85rem; }
.kpi span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.kpi.warn span { color: var(--warn); }
table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: .9rem; }
table.grid th, table.grid td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { background: #f7f9fb; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid .w40 { width: 40%; }
.row-warn td { background: #fff7ec; }
.row-muted td { color: #9aa6b2; text-decoration: line-through; }
td.flag { color: var(--err); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
td.wrap { word-break: break-all; max-width: 280px; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-height: 40px; padding: .45rem .6rem; margin: 0; }
.inline-label { display: flex; align-items: center; gap: .3rem; margin: 0; font-weight: 500; }
.admin .btn { min-height: 40px; padding: .5rem .9rem; font-size: .9rem; }
.btn.small-btn { min-height: 32px; padding: .3rem .6rem; font-size: .82rem; }
.rowform { display: flex; gap: .3rem; flex-wrap: wrap; }
.rowform input { width: 150px; min-height: 32px; padding: .3rem .5rem; margin: 0; font-size: .82rem; }
.actions-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.actions-row input { width: 280px; margin: 0; min-height: 40px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: .25rem .7rem; text-decoration: none; color: var(--ink); font-size: .85rem; }
.pager { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; font-size: .9rem; }
.note { background: #fff8e6; border-left: 3px solid #e0a800; padding: .5rem .7rem; font-size: .88rem; margin-top: .8rem; }
.errs { margin: 0; padding-left: 1rem; color: var(--err); font-size: .85rem; }
.pill-approved { background: #e7f5ec; color: var(--ok); }
.pill-draft { background: #e8f1fb; color: var(--brand); }
.pill-rejected { background: #fdecea; color: var(--err); }
.settings input, .settings select { max-width: 160px; margin: 0; min-height: 38px; }
@media (max-width: 800px) { body.admin { grid-template-columns: 1fr; } .side { position: static; height: auto; } }
.row-live td { background: #eef8f1; }
.rowform .check { margin: 0; font-weight: 500; white-space: nowrap; }
.rowform .check input { width: 16px; height: 16px; min-height: 0; margin: 0; }
.panel.secret { border: 2px solid #e0a800; background: #fffbea; }
code.copy { display: inline-block; background: #fff; border: 1px solid var(--line); padding: .4rem .6rem; border-radius: 6px; word-break: break-all; user-select: all; }
/* developer docs */
.docs { max-width: 960px; }
.docs pre { background: #0f1b2d; color: #e6edf6; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.docs code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.docs p code, .docs li code, .docs td code { background: #eef2f6; padding: .05rem .35rem; border-radius: 4px; font-size: .88em; }
.docs h2 { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.docs table.grid { margin: .5rem 0 1rem; }
.docs .toc { columns: 2; font-size: .95rem; }
.method { display: inline-block; font-weight: 700; font-size: .78rem; padding: .1rem .45rem; border-radius: 4px; color: #fff; background: #1e7b45; margin-right: .35rem; }
.method.post { background: #0b5cad; }

/* ---------------- health & insights ---------------- */
.kpi.crit span { color: var(--err); }
.kpi-action { display: grid; place-items: center; }
.tabs { display: flex; gap: .3rem; margin-bottom: .8rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .45rem .8rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--ink); border-color: var(--brand); font-weight: 600; }
.insight { border: 1px solid var(--line); border-left: 5px solid #9aa6b2; border-radius: 8px; padding: .7rem .9rem; margin-bottom: .7rem; background: #fff; }
.insight.sev-critical { border-left-color: var(--err); }
.insight.sev-warning { border-left-color: #e0a800; }
.insight.sev-info { border-left-color: var(--brand); }
.insight.acked { opacity: .8; }
.insight header { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.insight .right-side { margin-left: auto; }
.insight .issue { font-weight: 600; margin: .45rem 0 .3rem; }
.insight .todo { margin: 0 0 .4rem; font-size: .92rem; }
.sev-critical .pill.sev { background: #fdecea; color: var(--err); }
.sev-warning .pill.sev { background: #fff4e0; color: var(--warn); }
.sev-info .pill.sev { background: #e8f1fb; color: var(--brand); }
pre.evidence { background: #f7f9fb; border: 1px solid var(--line); padding: .6rem; border-radius: 6px; font-size: .78rem; max-height: 260px; overflow: auto; }
.insight-line { margin: .3rem 0; }
svg.chart { width: 100%; height: auto; }
svg.chart .lbl { font-size: 13px; fill: #1b2430; }
svg.chart .val { font-size: 12px; fill: #5d6b7a; }
svg.chart .tick { font-size: 10px; fill: #5d6b7a; }
.side .side-link { display: block; color: #8fc1f5; margin: .5rem 0 .2rem; text-decoration: none; }
