:root {
  --ink: #1E2A5A;          /* ledger indigo – primary */
  --ink-2: #2E3C78;
  --text: #141B38;
  --slate: #4A5573;
  --faint: #7B849E;
  --paper: #F5F7FB;
  --surface: #FFFFFF;
  --line: #DCE1EC;
  --line-2: #EBEEF5;
  --green: #1B7F4B;        /* covered */
  --green-2: #62B587;      /* part-year */
  --indigo-2: #5A6BCB;     /* outside 43B(h) */
  --saffron: #E39B2D;      /* ask vendor */
  --red: #C2412D;          /* invalid */
  --muted: #AEB6C8;        /* pending */
  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --shadow: 0 1px 2px rgba(20, 27, 56, .06), 0 8px 24px -12px rgba(20, 27, 56, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--text);
  font: 15px/1.5 "IBM Plex Sans", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 600; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--ink-2); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--indigo-2); outline-offset: 2px; }
.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex: none; }

.tricolour { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50;
  background: linear-gradient(90deg, var(--saffron) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6%); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.rail { background: var(--ink); color: #C9D0EA; display: flex; flex-direction: column; align-items: center;
  padding: 18px 0 14px; gap: 6px; position: sticky; top: 0; height: 100vh; }
.rail .mark { width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center;
  margin-bottom: 18px; font-weight: 700; color: var(--ink); font-size: 13px; letter-spacing: -.02em; }
.rail a, .rail button { width: 56px; padding: 9px 0 7px; border-radius: var(--r-m); display: flex; flex-direction: column;
  align-items: center; gap: 3px; color: inherit; text-decoration: none; font-size: 11px; background: none; border: 0; cursor: pointer; }
.rail a:hover, .rail button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.rail a.on { background: rgba(255, 255, 255, .12); color: #fff; }
.rail .spacer { flex: 1; }
main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1320px; width: 100%; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.top .sub { color: var(--slate); margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--r-s);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--ink-2); }
.btn.ghost { border-color: transparent; background: none; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--slate); }
.in { height: 40px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 12px; background: var(--surface); width: 100%; }
.in:focus { border-color: var(--indigo-2); outline: none; box-shadow: 0 0 0 3px rgba(90, 107, 203, .18); }
.err { color: var(--red); font-size: 14px; min-height: 20px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px 24px; }
.panel > header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel .hint { color: var(--faint); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-top: 20px; }
.grid2.even { grid-template-columns: 1fr 1fr; }
.empty { text-align: center; padding: 56px 16px; color: var(--slate); }
.empty .lucide { width: 36px; height: 36px; color: var(--faint); margin-bottom: 10px; }
.empty h2 { color: var(--text); margin-bottom: 6px; }

/* ---------- status chip (icon + label, never colour alone) ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap;
  padding: 2px 10px 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--slate); }
.chip .lucide { width: 14px; height: 14px; }
.chip.covered { background: #E3F2EA; color: #14633A; }
.chip.part { background: #EAF6EF; color: #2C7A50; }
.chip.outside { background: #ECEEFA; color: #3B4AA6; }
.chip.ask { background: #FCF1DF; color: #8A5A0E; }
.chip.invalid { background: #F9E6E2; color: #9C301F; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login .art { background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login .word { font-family: "IBM Plex Sans Devanagari", sans-serif; font-weight: 700; font-size: clamp(120px, 17vw, 260px);
  line-height: .9; color: #2A3874; margin: 0 0 0 -8px; user-select: none; }
.login .art h1 { font-size: clamp(26px, 2.6vw, 36px); max-width: 15em; font-weight: 500; }
.login .art p { color: #B8C0E0; max-width: 34em; margin-top: 14px; }
.login form { align-self: center; justify-self: center; width: min(380px, 100% - 32px); display: flex; flex-direction: column; gap: 16px; }
.brand { font-weight: 700; letter-spacing: -.02em; font-size: 20px; }
.brand span { color: var(--saffron); }

/* ---------- dashboard: coverage bar ---------- */
.coverage .big { font-size: 15px; color: var(--slate); margin-bottom: 18px; max-width: 60em; }
.coverage .big b { color: var(--text); font-size: 34px; font-weight: 600; display: block; letter-spacing: -.02em; line-height: 1.15; }
.bar { display: flex; gap: 2px; height: 46px; border-radius: 8px; overflow: hidden; background: var(--surface); }
.bar .seg { height: 100%; flex-basis: 0; transition: flex-grow 1.1s cubic-bezier(.2, .8, .2, 1); position: relative; cursor: default; min-width: 0; }
.bar .seg:first-child { border-radius: 8px 0 0 8px; } .bar .seg:last-child { border-radius: 0 8px 8px 0; }
.bar .seg:hover { filter: brightness(1.08); }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px 16px; margin-top: 18px; }
.legend button:disabled { opacity: .55; cursor: default; }
.legend button { display: grid; grid-template-columns: 12px 1fr; gap: 2px 10px; text-align: left; background: none; border: 0; padding: 4px; border-radius: var(--r-s); cursor: pointer; }
.legend button:hover { background: var(--line-2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; margin-top: 5px; grid-row: span 2; }
.legend .n { font-size: 22px; font-weight: 600; line-height: 1.2; }
.legend .l { font-size: 13px; color: var(--slate); grid-column: 2; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--text); color: #fff; font-size: 13px; padding: 8px 10px; border-radius: var(--r-s); max-width: 280px; box-shadow: var(--shadow); }
.chart { height: 300px; }
.actions { display: flex; flex-direction: column; }
.actions .act { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); }
.actions .act:first-child { border-top: 0; padding-top: 0; }
.actions .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--line-2); color: var(--ink); }
.actions .act p { color: var(--slate); font-size: 13px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--slate); background: #FAFBFD; position: sticky; top: 0; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #F7F8FC; }
td.num, th.num { text-align: right; }
.code { font-family: "IBM Plex Sans", sans-serif; letter-spacing: .02em; font-weight: 500; white-space: nowrap; }
.dim { color: var(--faint); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .pill { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 13px; }
.filters .pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters .in { width: 240px; height: 32px; margin-left: auto; }
.meter { height: 6px; background: var(--line-2); border-radius: 9px; overflow: hidden; min-width: 90px; }
.meter > i { display: block; height: 100%; background: var(--green); border-radius: 9px; }

/* ---------- upload ---------- */
.drop { border: 1.5px dashed var(--line); border-radius: var(--r-l); padding: 26px; display: grid; grid-template-columns: 1fr 160px 1fr auto; gap: 14px; align-items: end; background: var(--surface); transition: border-color .2s, background .2s; }
.drop.over { border-color: var(--indigo-2); background: #F3F5FD; }
.drop .file { display: flex; align-items: center; gap: 12px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-s); padding: 0 12px; cursor: pointer; color: var(--slate); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.recon-form { grid-template-columns: 1.2fr 1.3fr 150px 120px .9fr auto; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 24px; margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line-2); }
.facts dt { color: var(--slate); font-size: 13px; }
.facts dd { margin: 0; }
.facts .fv { font-size: 20px; font-weight: 600; }
.facts .fn { font-size: 13px; }
.chip.wrap { white-space: normal; border-radius: 10px; }
.snippet { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow: auto; font-size: 12.5px; margin: 16px 0; }

/* ---------- verify desk ---------- */
.desk { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.progress { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; color: var(--slate); }
.progress .meter { flex: 1; height: 8px; }
.vcard { position: relative; min-height: 340px; overflow: hidden; }
.vcard .no { font-size: 26px; font-weight: 600; letter-spacing: .01em; margin: 6px 0 4px; }
.vcard .raw { color: var(--faint); font-size: 13px; }
.vcard dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; margin: 22px 0 0; font-size: 14px; }
.vcard dt { color: var(--slate); }
.vcard dd { margin: 0; font-weight: 500; }
.stamp { position: absolute; right: 22px; top: 22px; width: 132px; height: 132px; border-radius: 50%;
  border: 4px double var(--green); color: var(--green); display: grid; place-items: center; text-align: center;
  font-weight: 700; font-size: 15px; letter-spacing: .06em; line-height: 1.15; transform: rotate(-14deg); opacity: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(27, 127, 75, .06), rgba(27, 127, 75, 0) 70%); }
.stamp small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.stamp.bad { border-color: var(--red); color: var(--red); background: radial-gradient(circle, rgba(194, 65, 45, .06), transparent 70%); }
.stamp.go { animation: stamp .5s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-24deg) scale(1.9); }
  60% { opacity: .95; transform: rotate(-12deg) scale(.94); }
  100% { opacity: .92; transform: rotate(-14deg) scale(1); }
}
.vcard.thud { animation: thud .35s .2s; }
@keyframes thud { 30% { transform: translateY(2px); } }
.cap { display: flex; flex-direction: column; gap: 16px; }
.cap .img { display: flex; align-items: center; gap: 12px; }
.cap img { width: 100%; max-width: 360px; aspect-ratio: 225/60; border-radius: var(--r-s); border: 1px solid var(--line); background: #F0F3FA; image-rendering: auto; }
.cap img:not([src]) { visibility: hidden; }
.cap .code-in { height: 56px; font-size: 26px; letter-spacing: .3em; padding: 0 16px; font-weight: 500; }
.cap .keys { color: var(--faint); font-size: 13px; }
kbd { font: 12px "IBM Plex Sans", sans-serif; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); color: var(--slate); }
.log { margin-top: 20px; }
.log li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.log ul { list-style: none; margin: 0; padding: 0; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(620px, 100%); background: var(--surface); box-shadow: -20px 0 60px -20px rgba(20, 27, 56, .35);
  transform: translateX(105%); visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s; z-index: 40; overflow-y: auto; padding: 28px; }
.drawer.open { transform: none; visibility: visible; transition-delay: 0s; }
.drawer .x { position: absolute; right: 18px; top: 18px; }
.drawer section { margin-top: 26px; }
.drawer section h3 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 7px 14px; font-size: 14px; }
.kv dt { color: var(--slate); } .kv dd { margin: 0; }
.timeline { display: flex; gap: 2px; }
.timeline > div { flex: 1; padding: 10px 10px 8px; background: var(--line-2); font-size: 13px; }
.timeline > div:first-child { border-radius: 8px 0 0 8px; } .timeline > div:last-child { border-radius: 0 8px 8px 0; }
.timeline b { display: block; font-size: 14px; }
.timeline .Micro { background: #E3F2EA; } .timeline .Small { background: #EAF6EF; } .timeline .Medium { background: #ECEEFA; }
.timeline .cur { box-shadow: inset 0 -3px 0 var(--ink); }
.scrim { position: fixed; inset: 0; background: rgba(20, 27, 56, .25); z-index: 39; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 200%); visibility: hidden; background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--r-m); transition: transform .3s; z-index: 70; max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); visibility: visible; }
.toast.bad { background: var(--red); }

@media (max-width: 960px) {
  .grid2, .grid2.even, .desk, .login { grid-template-columns: 1fr; }
  .login .art { padding: 32px 24px; min-height: 300px; }
  .drop { grid-template-columns: 1fr; }
  .filters .in { width: 100%; margin-left: 0; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; height: auto; flex-direction: row; padding: 8px 10px; z-index: 30; overflow-x: auto; justify-content: flex-start; }
  .rail .mark { margin: 0 8px 0 0; } .rail .spacer { display: none; }
  .vcard { min-height: 0; }
  .vcard dl, .kv { grid-template-columns: 1fr; gap: 2px; } .vcard dd, .kv dd { margin-bottom: 8px; }
  main { padding-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
