/* Builtara · light enterprise theme (SAP Fiori jaisa saaf, roshan look)
   Hamesha light: phone / computer dark mode mein bhi software light hi rahega.
   Layout: safed sidebar (icons) + safed shell bar + halka grey workspace; phone par sidebar drawer ban jata hai. */
:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --ink: #1d2d3e;
  --ink-2: #354a5f;
  --muted: #5b6f84;
  --line: #dfe4ea;
  --line-2: #edf0f3;
  --soft: #f6f8fa;
  --accent: #0e6b5a;
  --accent-hover: #0b5a4b;
  --accent-ink: #ffffff;
  --accent-soft: #e6f3ef;
  --accent-2: #e8a317;
  --good: #188918; --good-bg: #f1fdf6;
  --warn: #b44f00; --warn-bg: #fff8d6;
  --bad: #c62a2a;  --bad-bg: #ffeaf4;
  --info: #0064d9; --info-bg: #e8f3ff;
  --shadow: 0 0 2px rgba(34, 53, 72, .12), 0 2px 4px rgba(34, 53, 72, .06);
  --shadow-lg: 0 10px 30px rgba(34, 53, 72, .18);
  --radius: 12px;
  --font: "Inter", "72", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h1 em { font-style: normal; color: var(--muted); font-weight: 600; }
h2 { font-size: 1.02rem; font-weight: 700; }
h3 { font-size: .92rem; font-weight: 700; }
code, .code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .84em; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); margin: 0; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px;
  padding: 18px 14px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 2px 8px; }
.mark { flex: none; display: block; }
.wordmark { font-weight: 800; font-size: 1.32rem; letter-spacing: -0.03em; color: var(--ink); line-height: 1; }
.nav { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel { font-size: .7rem; font-weight: 700; color: var(--muted); padding: 0 10px 4px; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 500; position: relative; }
.nav a .ico { color: var(--muted); flex: none; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.on .ico { color: var(--accent); }
.sidefoot { font-size: .72rem; color: var(--muted); padding: 0 10px; }
.scrim { display: none; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 4px rgba(34, 53, 72, .05); padding-block: 10px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); min-height: 64px; }
.company { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cdot { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.cname { display: flex; flex-direction: column; min-width: 0; }
.cname strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cname small, .mename small { color: var(--muted); font-size: .76rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.company:has(.cswitch) .cname { display: none; }
.cswitch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 0 4px 0 10px; color: var(--ink-2); min-width: 0; }
.cswitch:focus-within { border-color: var(--accent); }
.cswitch select { border: 0; background: transparent; font: 600 .8rem var(--font); color: var(--ink-2); padding: 6px 4px; min-height: 0; width: auto; max-width: 220px; box-shadow: none; cursor: pointer; }
.cswitch select:focus { outline: none; box-shadow: none; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.me { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-2); color: #1a1405; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.mename { display: flex; flex-direction: column; line-height: 1.25; }
.mename strong { font-size: .88rem; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.iconbtn:hover { background: var(--soft); border-color: var(--line); color: var(--ink); }
.menubtn { display: none; }

.main { padding-block: 26px 64px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px; min-width: 0; width: 100%; max-width: 1360px; }

/* ---------- Page header ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pagehead > div { min-width: 0; }
.crumb { font-size: .78rem; font-weight: 600; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 4px; }
a.crumb:hover { color: var(--accent); }
.hint { color: var(--muted); margin: 6px 0 0; max-width: 72ch; }
.hint a { font-weight: 600; text-decoration: none; }
.headactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: 600 .86rem var(--font);
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow); min-height: 40px; }
.btn:hover { border-color: #c9d3cf; background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.block { width: 100%; }
.btn.ghostbad { background: transparent; color: var(--bad); border-color: transparent; box-shadow: none; }
.btn.ghostbad.armed { background: var(--bad); color: #fff; }
.mini { display: inline-flex; align-items: center; gap: 4px; font: 600 .78rem var(--font); color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 9px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini.strong { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.mini.strong:hover { background: var(--accent); color: var(--accent-ink); }
.mini.danger { color: var(--bad); }
.mini.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }

/* ---------- Cards, flash ---------- */
.card { background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); }
.flash { padding: 11px 14px; border-radius: 12px; font-weight: 500; border: 1px solid transparent; }
.flash.ok { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 20%, transparent); }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi { background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; min-width: 0; }
a.kpi:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .lbl .ico { color: var(--accent); }
.kpi strong { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi.good strong { color: var(--good); }
.kpi.bad strong { color: var(--bad); }
.kpi.warn strong { color: var(--warn); }
.kpi::after { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.kpi.good::after { background: var(--good); } .kpi.bad::after { background: var(--bad); } .kpi.warn::after { background: var(--accent-2); }
.minikpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.minikpis .kpi { box-shadow: none; background: var(--soft); padding: 12px 14px; }
.minikpis .kpi strong { font-size: 1.1rem; }

/* ---------- Blocks & lists ---------- */
.block { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.blockhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.blockhead h2 { display: flex; align-items: center; gap: 8px; }
.blockhead.sub2 { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.blockhead a { font-weight: 600; font-size: .85rem; text-decoration: none; }
.count { font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--soft); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list a { color: var(--ink); text-decoration: none; min-width: 0; font-weight: 500; }
.list a:hover { color: var(--accent); }
.list .num { white-space: nowrap; font-weight: 600; }
.bad { color: var(--bad); }
.note.bad { color: var(--bad); font-weight: 600; }
.welcome { padding: 20px 22px; background: linear-gradient(135deg, var(--accent-soft), var(--panel) 70%); }
.steps { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Tabs (SAP jaisa icon-tab bar): list ke upar Sab / Baqi / Overdue */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: -6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem;
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 6px 6px 0 0; }
.tab:hover { color: var(--accent); background: var(--soft); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs.jump { position: sticky; top: 64px; z-index: 10; background: var(--bg); margin: 0; padding-top: 4px; }
.data .sub.neg { color: var(--bad); font-weight: 600; }
.list .num.bad { color: var(--bad); }
html { scroll-padding-top: 130px; }
.pre { margin: 0; color: var(--ink-2); }
.tab.on .count { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.toolbar input[type=search] { flex: 1 1 240px; max-width: 380px; }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
.block .tablewrap { border: 1px solid var(--line-2); border-radius: 12px; }
.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.data th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0;
  padding: 10px 14px; background: var(--soft); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.data td { white-space: nowrap; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr[data-href] { cursor: pointer; }
.data tbody tr:hover td { background: #f2f6f9; }
.data tbody tr.on td { background: var(--accent-soft); }
.data tbody tr.dim td { color: var(--muted); }
.data td a { color: var(--ink); font-weight: 600; text-decoration: none; }
.data td a:hover { color: var(--accent); }
.data .r { text-align: right; }
.data td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data td.neg { color: var(--bad); font-weight: 600; }
.data td.pos { color: var(--good); font-weight: 600; }
.data td.code { color: var(--ink-2); }
.data tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; background: var(--soft); }
.data tfoot .lbl { float: left; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.data td.wrap { white-space: normal; min-width: 200px; max-width: 340px; }
.sub { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 70px; margin-top: 7px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.pill.bad  { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-bg); color: var(--info); border-color: transparent; }

.empty { padding: 40px 20px; text-align: center; }
.empty p { color: var(--muted); margin: 6px 0 0; }

/* ---------- Forms ---------- */
.form { padding: 22px; display: flex; flex-direction: column; gap: 18px; max-width: 920px; }
.form.narrow { max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field b { color: var(--bad); }
input, select, textarea { font: 14.5px var(--font); color: var(--ink); background: var(--panel); border: 1px solid #d5ddd9; border-radius: 10px;
  padding: 10px 12px; width: 100%; min-width: 0; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
input.num { font-variant-numeric: tabular-nums; text-align: right; }
input:hover, select:hover, textarea:hover { border-color: #b9c6c1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=file] { padding: 8px; background: var(--soft); border-style: dashed; }
.note { color: var(--muted); font-size: .84rem; margin: 0; }
#invcalc { font-size: .9rem; font-weight: 600; color: var(--ink); background: var(--accent-soft); padding: 10px 14px; border-radius: 10px; font-variant-numeric: tabular-nums; }
#invcalc:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.danger { max-width: 920px; display: flex; justify-content: flex-end; }
.inline { display: inline-flex; gap: 4px; align-items: center; margin: 2px 0 2px 4px; }
.inline.reset input { width: 140px; padding: 4px 8px; font-size: .82rem; min-height: 30px; }
.toolbar select, .inline select { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; font-size: .92rem; }

/* ---------- Documents ---------- */
fieldset.docs { display: flex; flex-direction: column; gap: 12px; background: var(--soft); }
.inherit { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--soft); border: 1px dashed var(--line); }
.inherit .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); }
.doclist.compact li { padding: 7px 10px; }
.field select[multiple] { padding: 6px; min-height: 0; }
.doclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doclist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); flex-wrap: wrap; }
.docicon { flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font: 800 .68rem var(--font); display: grid; place-items: center; letter-spacing: .04em; }
.docmeta { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.docmeta strong { font-size: .88rem; }
.docmeta a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.docmeta a:hover { color: var(--accent); text-decoration: underline; }
.docmeta small { color: var(--muted); font-size: .78rem; }
.docactions { display: flex; gap: 6px; flex-wrap: wrap; }
.doccount { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }

/* ---------- Reports ---------- */
.pagehead.report { padding: 22px 24px; background: var(--panel); border: 1px solid transparent; border-radius: var(--radius); box-shadow: var(--shadow);
  background-image: linear-gradient(120deg, var(--accent-soft), transparent 55%); }
.pagehead.report .hint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--ink-2); }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); column-gap: 0; row-gap: 26px; counter-reset: c; }
.chain li { position: relative; padding: 12px 14px 12px 14px; display: flex; flex-direction: column; gap: 4px; border-top: 3px solid var(--line); }
.chain li.done { border-top-color: var(--accent); }
.chain li::before { counter-increment: c; content: counter(c); position: absolute; top: -13px; left: 12px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--line); font-size: .72rem; font-weight: 800; color: var(--muted); display: grid; place-items: center; }
.chain li.done::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); content: "✓"; }
.chain .lbl { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
.chain .val { font-weight: 700; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.chain .val a { text-decoration: none; }
.chain .val small { font-weight: 500; color: var(--muted); }
.stack { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-2); }
.stack i { display: block; height: 100%; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px 22px; }
.legend b { white-space: nowrap; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; }
.legend em { font-style: normal; color: var(--muted); width: 36px; text-align: right; font-size: .78rem; }

/* ---------- Misc ---------- */
.planbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 150px; box-shadow: var(--shadow); }
.planbox .lbl { font-size: .76rem; color: var(--muted); font-weight: 600; }
.planbox strong { font-size: 1.3rem; font-weight: 800; }
.planbox small { color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: .88rem; }
.checks .ok { color: var(--good); }
.checks .no { color: var(--bad); font-weight: 600; }
.warntext { color: var(--warn); font-weight: 600; }
.actionsrow { white-space: nowrap; }

/* ---------- Login / install ---------- */
.authpage { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.auth.wide { max-width: 680px; }
.authtabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.authtabs a { text-align: center; padding: 9px 8px; border-radius: 9px; font-weight: 600; font-size: .88rem; color: var(--ink-2); text-decoration: none; }
.authtabs a.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }
.authtabs a:not(.on):hover { color: var(--accent); }
.regset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.regset legend { font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.regset .field.wide { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth .brand { padding: 0; margin-bottom: 4px; }
.auth h1 { margin-bottom: 4px; }
.authfoot { text-align: center; color: var(--muted); font-size: .8rem; margin: 16px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .minikpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .chain { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); height: auto; transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg); padding-top: max(18px, env(safe-area-inset-top, 0px)); padding-left: max(14px, env(safe-area-inset-left, 0px)); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 20, 17, .45); z-index: 25; }
  .menubtn { display: inline-grid; }
  .topbar { padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .mename, .chip { display: none; }
  .cswitch select { max-width: 46vw; }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 48px; }
  .grid { grid-template-columns: 1fr; }
  .kpis.five, .minikpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data td { white-space: nowrap; }
  h1 { font-size: 1.35rem; }
  .pagehead.report { padding: 18px; }
}
@media (max-width: 460px) {
  .kpis, .kpis.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi strong { font-size: 1.08rem; }
  .kpi small { font-size: .74rem; }
  .headactions .btn { padding: 7px 11px; min-height: 36px; font-size: .82rem; }
  .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Print (reports) ---------- */
@media print {
  .side, .topbar, .headactions, .skip, .scrim, .toolbar, .btn, .tabs.jump { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; font-size: 12px; }
  .main { padding: 0; max-width: none; }
  .card, .kpi, .pagehead.report { box-shadow: none; border-color: #ccc; background: #fff; }
  .block, .card { break-inside: avoid; }
}

/* ---- v1.9 ---- */
.formwrap { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.formwrap .preview { order: 2; }
@media (min-width: 1200px) { .formwrap { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); } .formwrap .preview { order: 2; position: sticky; top: 12px; } .formwrap > form { order: 1; } }
.preview { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pvhead { display: flex; flex-direction: column; gap: 2px; }
.pvhead small { color: var(--muted, #55625D); }
.pvbody img { max-width: 100%; border-radius: 8px; }
.pvbody iframe { width: 100%; height: 560px; border: 1px solid #E3EAE7; border-radius: 8px; }
.docchips { min-width: 180px; }
.dchip { display: inline-block; margin: 1px 2px; padding: 2px 7px; border-radius: 7px; font-size: 11px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.dchip.ok { background: #DDF3EA; color: #0B5E45; }
.dchip.miss { background: #FBE7E3; color: #9A2F1C; }
.dchip.add { border: 1px dashed #0E6B5A; color: #0E6B5A; }
.btn .sub { font-weight: 500; opacity: .85; }
.lines input, .lines select { width: 100%; min-width: 70px; box-sizing: border-box; }
.lines .lineqty { width: 90px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; gap: 8px; align-items: center; }
.warnbox { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #FCEFD3; }
.seg { display: inline-flex; gap: 14px; margin-bottom: 8px; }
.expectbox table.mini td { padding: 4px 8px; }
.expectbox tr.tot td { border-top: 1.5px solid #CBD5D1; }
ul.plain { padding-left: 18px; }
.kpis.auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 760px) { .kpis.auto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chip.on { background: var(--accent); color: #fff; } .periodbar { flex-wrap: wrap; gap: 6px; }
.periodbar { display: flex; align-items: center; margin: 4px 0 14px; }
.periodbar input[type=date] { width: auto; flex: 0 0 auto; min-width: 150px; padding: 6px 10px; }
.periodbar .btn { padding: 6px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg { flex-wrap: wrap; align-items: center; }
.seg label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.seg input[type=radio] { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; flex: 0 0 auto; }
fieldset.cascade { background: var(--surface-2, #F7F9F8); }
.data input[type=checkbox], .check input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; }
.dchip.ok { display: inline-flex; gap: 0; padding: 0; overflow: hidden; }
.dchip.ok a { padding: 2px 7px; color: inherit; text-decoration: none; }
.dchip.ok a.dl { border-left: 1px solid rgba(0,0,0,.12); }
.viewer { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(10,20,18,.72); padding: 16px; flex-direction: column; }
.viewer.on { display: flex; }
.viewer .vbar { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 10px 10px 0 0; padding: 8px 10px; flex-wrap: wrap; }
.viewer .vname { flex: 1; min-width: 120px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vprev, .viewer .vnext { border: 1px solid #CBD5D1; background: #fff; border-radius: 8px; width: 36px; height: 34px; font-size: 18px; cursor: pointer; }
.viewer button:disabled { opacity: .35; cursor: default; }
.viewer .vbody { flex: 1; background: #F1F4F3; border-radius: 0 0 10px 10px; display: flex; align-items: center; justify-content: center; overflow: auto; min-height: 0; }
.viewer .vbody iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .vbody img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vnone { padding: 30px; text-align: center; }

/* Software ka nikala hua (sirf parhne ke liye) */
input[readonly].ro { background: var(--soft, #f2f4f3); color: inherit; font-weight: 600; cursor: default; }

textarea.ldescr { width: 100%; min-width: 220px; min-height: 2.4em; resize: vertical; overflow: hidden; line-height: 1.35; }

/* Email */
.mailist tr.unread td { font-weight: 700; }
.mailview .mailmeta { margin: 4px 0 8px; }
.mailview .chips .pill { margin-right: 4px; text-decoration: none; }
.mailbody { width: 100%; min-height: 420px; border: 1px solid var(--line, #d9e0dd); border-radius: 8px; background: #fff; }
.mailtext { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; background: var(--soft, #f6f8f7); padding: 12px; border-radius: 8px; }
.compose textarea[name="body"] { font-family: inherit; font-size: 14px; line-height: 1.5; }
.toolbar { display: flex; gap: 8px; margin: 8px 0 12px; flex-wrap: wrap; } .toolbar input[type=search] { flex: 1; min-width: 200px; }

/* Har list: column filter + sort */
.data thead tr.colfilters th { padding: 4px 6px; background: var(--soft); position: static; vertical-align: top; }
.data tr.colfilters input, .data tr.colfilters select { display: block; box-sizing: border-box; width: 100%; min-width: 80px; font-size: .78rem; padding: 3px 5px; margin: 1px 0; border: 1px solid var(--line); border-radius: 6px; background: var(--card, #fff); color: inherit; font-weight: 400; }
.data tr.colfilters input[type=date] { min-width: 118px; }
.data th.sorthead { white-space: nowrap; }
.data .sortbtn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .8rem; padding: 0 2px; margin-left: 4px; }
.data .sortbtn:hover { color: var(--accent); }
.data .fltclear { display: block; margin-top: 3px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--accent); border-radius: 6px; font-size: .74rem; cursor: pointer; padding: 2px 6px; }
.data.filtered tr.colfilters th { background: var(--accent-soft); }
@media print { .data tr.colfilters, .data .sortbtn { display: none !important; } }
.ruleform { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ruleform input, .ruleform select { font-size: .8rem; padding: 3px 5px; max-width: 150px; }
.testbar{position:sticky;top:0;z-index:999;background:#B42318;color:#fff;font-weight:700;text-align:center;padding:6px 12px;font-size:14px}

/* ---- v1.10: menu sections + Improve button + Handbook ---- */
.nav { gap: 4px; }
.nav .navtop { margin-bottom: 6px; }
.navsec { border-radius: 10px; }
.navsec > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
  padding: 8px 10px; border-radius: 8px; font-weight: 700; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); }
.navsec > summary::-webkit-details-marker { display: none; }
.navsec > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s ease; }
.navsec[open] > summary::after { transform: rotate(45deg); }
.navsec > summary .ico { color: var(--accent); }
.navsec > summary:hover { background: var(--soft); }
.navsec[data-cur] > summary { color: var(--accent); }
.navsec[open] { padding-bottom: 8px; }
.navsec .navgroup { padding-left: 8px; margin-top: 4px; }
.navsec .navlabel { padding-top: 6px; font-size: .66rem; }
.impbtn { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font: 600 .84rem var(--font); box-shadow: var(--shadow-lg); }
.impbtn:hover { background: var(--accent); }
.impdlg { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.impdlg::backdrop { background: rgba(10, 20, 17, .45); }
.impdlg form { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.impdlg textarea, .forclaude textarea { width: 100%; box-sizing: border-box; }
.implist { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.imp { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
.imp:target { outline: 2px solid var(--accent); }
.imphead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.impdetail, .impnote { margin: 0; color: var(--ink-2); }
.impnote { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.impact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.impact form.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.impact select, .impact input { width: auto; min-height: 32px; padding: 4px 8px; font-size: .84rem; }
.muted.small, .small { font-size: .8rem; }
.vchanges { margin: 0; padding-left: 20px; color: var(--ink-2); }
.forclaude { padding: 12px 16px; margin-top: 14px; }
.forclaude summary { cursor: pointer; }
.forclaude textarea { margin-top: 10px; font: 13px ui-monospace, Consolas, monospace; }
.mdbook { padding: 22px 26px; margin-top: 14px; max-width: 980px; }
.mdbook h2 { font-size: 1.3rem; margin: 6px 0 10px; }
.mdbook h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.mdbook h4, .mdbook h5 { margin: 16px 0 6px; }
.mdbook p, .mdbook li { color: var(--ink-2); }
.mdbook hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.mdbook .tablewrap { margin: 8px 0 12px; }
@media (max-width: 860px) { .impbtn span { display: none; } .impbtn { padding: 12px; } .mdbook { padding: 16px; } }
@media print { .impbtn, .impdlg { display: none !important; } }
.navsoon { display: flex; align-items: center; gap: 11px; padding: 8px 10px; color: var(--muted); font-style: italic; cursor: default; }
.navsoon .ico { color: var(--muted); flex: none; }
.navsub { margin-top: 2px; }
.navsub > summary { list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 18px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-radius: 6px; }
.navsub > summary::-webkit-details-marker { display: none; }
.navsub > summary::after { content: ""; margin-left: auto; width: 5px; height: 5px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s ease; }
.navsub[open] > summary::after { transform: rotate(45deg); }
.navsub > summary:hover { background: var(--soft); color: var(--ink); }
.navsub[data-cur] > summary { color: var(--accent); }
.navsub > a, .navsub > .navsoon { margin-left: 8px; }

/* ================= v1.10 NAYA LOOK (bank-app style) ================= */
:root { --side: #0f2a25; --side-2: #163a33; --side-ink: #dce7e3; --side-muted: #8fb2a8; --bg: #f3f5f7; --radius: 16px; --shadow: 0 1px 2px rgba(15, 42, 37, .06), 0 1px 1px rgba(15, 42, 37, .03); }
body { background: var(--bg); }
/* Sidebar: halka aur pur-sukoon (user ne gehra hara badalwaya) — sirf chuna hua page halke hare mein */
.side { background: #fbfcfc; border-right: 1px solid #e6ebe9; color: #33433f; padding: 22px 14px 14px; }
.side .wordmark { color: #14211e; }
.side .nav a, .side .navtop { color: #3d4d49; }
.side .nav a .ico { color: #8a9a96; }
.side .nav a:hover { background: #f1f4f3; color: #14211e; }
.side .nav a.on { background: #e3f1ec; color: #0b5a4b; font-weight: 700; }
.side .nav a.on .ico { color: #0e6b5a; }
.side .nav a.on::before { display: none; }
.side .navsec > summary { color: #2a3936; font-size: .76rem; }
.side .navsec > summary .ico { color: #7d8d89; }
.side .navsec > summary:hover { background: #f1f4f3; }
.side .navsec[open] { background: #f3f6f5; border-radius: 12px; padding: 2px 6px 8px; }
.side .navsec[open] > summary { color: #14211e; }
.side .navsec[open] > summary .ico, .side .navsec[data-cur] > summary .ico { color: #0e6b5a; }
.side .navsec > summary::after { border-color: #9aa9a5; }
.side .navsub > summary, .side .navlabel { color: #7d8d89; }
.side .navsub > summary:hover { background: #e9eeec; color: #14211e; }
.side .navsub[data-cur] > summary { color: #0b5a4b; }
.side .navsub > summary::after { border-color: #9aa9a5; }
.side .navsoon, .side .navsoon .ico { color: #9aa9a5; }
.side .sidefoot { color: #8a9a96; }
/* Upar ki bar */
.topbar { box-shadow: none; border-bottom: 1px solid #e4e9ec; }
.avatar { background: var(--accent-2) !important; color: #14211e !important; }
/* Page ka sar */
.pagehead h1 { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.crumb { letter-spacing: .02em; }
.btn { border-radius: 12px; min-height: 42px; padding: 0 16px; border-color: #e4e9ec; box-shadow: none; }
.btn.primary { border-radius: 12px; font-weight: 700; padding: 0 20px; }
.btn .sub { display: none; }
.card, .kpi { border-radius: var(--radius); box-shadow: var(--shadow); border: 0; }
/* Summary cards */
.sumcards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 18px 0 4px; }
.sumcard { background: #fff; border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-width: 0; }
.sumcard .sl { font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sumcard strong { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.sumcard small { font-size: .78rem; color: var(--muted); }
.sumcard.main { background: var(--accent); color: #fff; }
.sumcard.main .sl, .sumcard.main small { color: #cfe7e0; }
.sumcard.warn strong { color: var(--warn); }
a.sumcard:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
/* List card: tabs + search + table ek dabbe mein */
.listcard { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; margin-top: 18px; }
.listhead { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #eef1f3; }
.listhead .toolbar { margin: 0 0 0 auto; flex: 1 1 320px; justify-content: flex-end; }
.listhead .toolbar input[type=search] { max-width: 260px; min-height: 40px; border-radius: 12px; }
.listhead .toolbar .btn { min-height: 40px; }
.listhead .toolbar .count { color: var(--muted); font-size: .8rem; }
.tabs.pills { border: 0; background: var(--bg); padding: 4px; border-radius: 12px; gap: 4px; margin: 0; flex-wrap: wrap; overflow: visible; }
.tabs.pills .tab { border: 0; border-radius: 9px; padding: 8px 13px; font-size: .84rem; color: var(--muted); margin: 0; }
.tabs.pills .tab:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.tabs.pills .tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 42, 37, .14); }
.tabs.pills .tab .count { background: transparent; border: 0; padding: 0; color: #8a9a96; font-weight: 700; }
.tabs.pills .tab.on .count { color: var(--accent); background: transparent; }
.fltbtn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.listcard .data:not(.showflt) tr.colfilters { display: none; }
.listcard .tablewrap { border-radius: 0; }
.listcard .empty { padding: 48px 20px; text-align: center; }
/* Table */
.data { font-size: .9rem; }
.data thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #fff; border-bottom: 1px solid #eef1f3; padding: 12px 14px; }
.data td { padding: 14px; border-bottom: 1px solid #eef1f3; }
.data tbody tr:hover td { background: #f6faf9; }
.data td.num { font-weight: 700; }
.data td.first a { font-weight: 600; }
.data .av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #e7f2ef; color: var(--accent); font-weight: 800; font-size: .74rem; margin-right: 10px; vertical-align: middle; flex: none; }
.data tfoot td { background: #fafbfb; border-top: 2px solid #e4e9ec; font-size: .95rem; font-weight: 800; padding: 14px; }
.pill { border: 0; padding: 4px 10px; }
.pill.good { background: #e3f4ec; color: #126b43; }
.pill.warn { background: #fff1d6; color: #8a4b00; }
.pill.bad { background: #fde8e7; color: #9b1c14; }
.pill.info { background: #e6f0fb; color: #12508f; }
@media (max-width: 1000px) { .sumcards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phone: har record ek card */
@media (max-width: 640px) {
  .sumcards { gap: 10px; }
  .sumcard { padding: 14px; } .sumcard strong { font-size: 1.15rem; }
  .listhead { padding: 12px; }
  .listhead .toolbar { flex-basis: 100%; }
  .listhead .toolbar input[type=search] { max-width: none; }
  .tabs.pills { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
  .tabs.pills .tab { white-space: nowrap; }
  .data.cardrows thead { display: none; }
  .data.cardrows, .data.cardrows tbody, .data.cardrows tfoot, .data.cardrows tr, .data.cardrows td { display: block; width: 100%; box-sizing: border-box; }
  .data.cardrows tbody tr { padding: 12px 14px; border-bottom: 8px solid var(--bg); }
  .data.cardrows td { border: 0; padding: 3px 0; white-space: normal; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .data.cardrows td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  .data.cardrows td.first { font-size: 1rem; justify-content: flex-start; text-align: left; padding-bottom: 6px; }
  .data.cardrows td.first::before { display: none; }
  .data.cardrows td:empty, .data.cardrows td[data-label=""]::before { display: none; }
  .data.cardrows td.acts { justify-content: flex-end; padding-top: 8px; }
  .data.cardrows td.acts::before { display: none; }
  .data.cardrows tfoot tr { padding: 12px 14px; }
  .data.cardrows tfoot td:not([data-label]) { display: none; }
  .data.cardrows tfoot td:first-child { display: flex; }
  .data.cardrows td.wrap { min-width: 0; max-width: none; }
}
.impdlg fieldset.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.impdlg fieldset.seg legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.impdlg fieldset.seg label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 500; }
.impdlg fieldset.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.listhead .toolbar input[type=date], .listhead .toolbar select { width: auto; flex: none; min-height: 40px; border-radius: 12px; }
.listhead .toolbar .field.inline { margin: 0; }
.data td select { min-width: 190px; width: auto; }
.data td input:not([type=checkbox]) { min-height: 38px; }
/* Overview ki zanjeer: har marhala click hota hai */
.flowchain li { padding: 0; }
.flowchain li > a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; text-decoration: none; color: var(--ink); border-radius: 0 0 12px 12px; height: 100%; box-sizing: border-box; }
.flowchain li > a:hover { background: var(--soft); }
.flowchain .val strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.flowchain li.warn { border-top-color: var(--accent-2); }
.flowchain li.warn::before { background: var(--accent-2); border-color: var(--accent-2); color: #14211e; content: "!"; font-weight: 800; }
.flowchain li.warn .val strong { color: #8a4b00; }

/* ---- v1.10 sidebar: saaf alag alag (user: "mix ho raha hai") ----
   1) Ek waqt mein ek hi section khula (accordion)
   2) Khula section safed dabba + hari patti; us ki heading rangeen
   3) Chhoti heading = gehri, normal likhai, saath "▸"; us ke pages andar khiske hue aur baayein ek line se jude */
.side .nav { gap: 2px; }
.side .navsec { border-radius: 12px; }
.side .navsec + .navsec { border-top: 1px solid #eef2f1; }
.side .navsec[open] { background: #fff; border: 1px solid #dfe8e5; box-shadow: 0 2px 6px rgba(15, 42, 37, .06); padding: 4px 6px 10px; margin: 6px 0; }
.side .navsec[open] + .navsec { border-top: 0; }
.side .navsec[open] > summary { background: #e6f2ee; color: #0b5a4b; border-radius: 9px; margin-bottom: 6px; }
.side .navsec[open] > summary .ico { color: #0e6b5a; }
.side .navsec .navgroup { padding-left: 4px; margin-top: 2px; }
.side .navsub { margin: 2px 0 0; }
.side .navsub > summary { text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 600; color: #2a3936; padding: 7px 10px 7px 12px; }
.side .navsub > summary::before { content: "▸"; color: #9aa9a5; font-size: .8rem; transition: transform .15s ease; display: inline-block; }
.side .navsub[open] > summary::before { transform: rotate(90deg); color: #0e6b5a; }
.side .navsub > summary::after { display: none; }
.side .navsub[open] > summary { color: #0b5a4b; }
.side .navsub > a, .side .navsub > .navsoon { margin-left: 22px; padding-left: 12px; border-left: 2px solid #dfe8e5; border-radius: 0 8px 8px 0; font-size: .86rem; }
.side .navsub > a.on { border-left-color: #0e6b5a; }
.side .navsub > a .ico { width: 16px; height: 16px; }
/* ---- v1.10 Dashboard ---- */
.todo { padding: 16px 18px; margin: 18px 0 0; }
.todo h2 { font-size: .95rem; margin: 0 0 10px; }
.todochips { display: flex; flex-wrap: wrap; gap: 8px; }
.todochip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: .86rem; font-weight: 500; background: #fff1d6; color: #6b3a00; }
.todochip b { font-weight: 800; }
.todochip.bad { background: #fde8e7; color: #8b1a12; }
.todochip.info { background: #e6f0fb; color: #12508f; }
.todochip:hover { filter: brightness(.96); }
.seccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 18px; }
.seccard { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.seccard:hover { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.seccard .sh { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.seccard .sh .ico { color: var(--accent); }
.seccard .go { margin-left: auto; font-size: .74rem; font-weight: 600; color: var(--accent); }
.seccard .sn { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.seccard .sn em { font-style: normal; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seccard .sn b { font-weight: 700; white-space: nowrap; } .seccard .sn b.warn { color: #8a4b00; }
.mchart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 190px; align-items: end; padding-top: 8px; }
.mcol { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.mcol span { font-size: .72rem; color: var(--muted); }
.mbars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.mbars i { display: block; width: 28%; min-height: 2px; border-radius: 3px 3px 0 0; }
.b1 { background: #0e6b5a; } .b2 { background: #4fb39a; } .b3 { background: #e8a317; }
.legend2 { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
@media (max-width: 640px) { .mchart { gap: 3px; height: 150px; } .mbars i { width: 30%; } }
.groupchip { border-color: #cfe3dc; color: var(--accent); }
.groupchip.on { background: var(--accent-soft); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }

/* v1.10 Data Import: Excel + documents cards, review split (document left, form right) */
.di-up{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:18px}
.di-up .card{margin:0}
.di-split{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:14px;margin-top:14px;align-items:start}
.di-doc{position:sticky;top:12px;padding:12px}
.di-view iframe{width:100%;height:72vh;border:1px solid var(--line,#dde3e0);border-radius:10px;background:#fff}
.di-view img{display:block;max-width:100%;max-height:72vh;margin:0 auto;border:1px solid var(--line,#dde3e0);border-radius:10px}
.di-doctabs{margin-bottom:8px;flex-wrap:wrap}
.di-form .grid{grid-template-columns:1fr 1fr}
.field.di-bad input,.field.di-bad select,.field.di-bad textarea{background:var(--warn-bg);border-color:#E2B33C}
@media (max-width:900px){.di-up,.di-split,.di-form .grid{grid-template-columns:1fr}.di-doc{position:static}.di-view iframe{height:60vh}}
