/* LSM Paperwork Hub — McD "ops command center" design system
   Brand: The Token red #DB0007 / yellow #FFBC0D. Display: Bricolage Grotesque. Body: DM Sans. Data: JetBrains Mono. */
:root {
  --red: #DB0007; --red-700: #A80005; --red-50: #FFF0EF;
  --gold: #FFBC0D; --gold-600: #E0A100; --gold-50: #FFF6DB;
  --ink: #1F1B16; --ink-2: #3A342C; --muted: #6E655A; --line: #EADFCF; --line-2: #F3EBDF;
  --bg: #FBF6EE; --surface: #FFFFFF; --surface-2: #FFFBF4;
  --ok: #147A3D; --ok-50: #E4F5EA; --info: #1D5FB0; --info-50: #E7F0FB; --warn-50: #FFF3D1;
  /* lifecycle stage colours (1..6) + support */
  --s1: #B7AC9C; --s2: #4C7DD1; --s3: #9A5BC9; --s4: #147A3D; --s5: #E08A00; --s6: #0E5E2E; --s0: #8C8273;
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --sh-1: 0 1px 2px rgba(31,27,22,.06), 0 2px 8px rgba(31,27,22,.05);
  --sh-2: 0 4px 10px rgba(31,27,22,.06), 0 18px 40px rgba(31,27,22,.10);
  --ease: cubic-bezier(.2,.8,.2,1);
  --sidebar: 248px;
  --f-display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --f-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html, body { overflow-x: hidden; }
body { font-family: var(--f-body); font-size: 15.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
.mono { font-family: var(--f-mono); font-size: .86em; letter-spacing: -.01em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); padding: 8px 12px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100dvh; }
.sidebar { background: var(--ink); color: #F5EEE3; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 9px; }
.brand b { font-family: var(--f-display); font-weight: 800; font-size: 17px; letter-spacing: -.3px; display: block; line-height: 1.1; }
.brand span { font-size: 11.5px; color: #B9AE9F; font-weight: 500; }
.nav-label { font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: #8F8576; font-weight: 700; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 14.5px; color: #E9E0D3; transition: background .18s var(--ease), color .18s; min-height: 44px; }
.nav a:hover { background: #2E2820; color: #fff; }
.nav a.on { background: var(--gold); color: var(--ink); }
.nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 700; background: #3A332A; color: #EADFCF; border-radius: 999px; padding: 1px 8px; }
.nav a.on .count { background: rgba(31,27,22,.15); color: var(--ink); }
.side-foot { margin-top: auto; font-size: 11.5px; color: #8F8576; padding: 10px 12px; line-height: 1.5; }
.side-foot b { color: #D6CBBB; }

.main { min-width: 0; }
#main:focus { outline: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(251,246,238,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .crumb { font-family: var(--f-display); font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 12px 9px 16px; min-width: min(420px, 50vw); color: var(--muted); font-size: 14px; transition: border-color .18s, box-shadow .18s; min-height: 44px; }
.search-trigger:hover { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-50); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: var(--f-mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); color: var(--muted); }
.mobile-nav { display: none; }
.page { padding: 28px; max-width: 1480px; margin: 0 auto; }
.view { display: none; animation: rise .32s var(--ease); }
.view.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- type ---------- */
.h-display { font-family: var(--f-display); font-weight: 800; letter-spacing: -1.2px; line-height: 1.02; margin: 0; }
h2.title { font-family: var(--f-display); font-weight: 800; font-size: 30px; letter-spacing: -.8px; margin: 0 0 4px; line-height: 1.1; }
.lead { color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
h3.sec { font-family: var(--f-display); font-weight: 700; font-size: 19px; margin: 0 0 12px; letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; }
h3.sec small { font-family: var(--f-body); font-weight: 600; font-size: 13px; color: var(--muted); }

/* ---------- primitives ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-1); border: 1px solid var(--line-2); }
.pad { padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 14px; text-decoration: none; min-height: 42px; transition: background .18s var(--ease), transform .12s, box-shadow .18s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--red); color: #fff; } .btn.primary:hover { background: var(--red-700); }
.btn.gold { background: var(--gold); color: var(--ink); } .btn.gold:hover { background: var(--gold-600); }
.btn.ghost { background: var(--surface); border: 1.5px solid var(--line); } .btn.ghost:hover { border-color: var(--gold); background: var(--gold-50); }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.icon-only { padding: 0; width: 40px; min-height: 40px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
button.pill:hover { background: var(--gold-50); box-shadow: inset 0 0 0 1.5px var(--gold); }
.pill.on { background: var(--gold); color: var(--ink); }
.pill.ok { background: var(--ok-50); color: var(--ok); } .pill.info { background: var(--info-50); color: var(--info); }
.pill.red { background: var(--red-50); color: var(--red-700); } .pill.warn { background: var(--warn-50); color: #7A5600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 600; min-height: 36px; transition: all .16s var(--ease); }
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { color: var(--muted); font-weight: 600; } .chip.on small { color: #CFC5B6; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--f-display); font-size: 18px; margin-bottom: 4px; }
.ext { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font: 800 10.5px var(--f-mono); color: #fff; text-transform: uppercase; flex: none; letter-spacing: 0; }
.ext.pdf { background: #D2392B; } .ext.doc, .ext.docx { background: #2F5DA8; } .ext.xls, .ext.xlsx { background: #1D7044; }
.ext.img { background: #8C6BB8; } .ext.zip, .ext.rar { background: #7D6B52; } .ext.other { background: #8C8273; }
.ext.sm { width: 30px; height: 26px; border-radius: 7px; font-size: 9px; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--red); color: #fff; padding: 40px 40px 34px; margin-bottom: 22px; isolation: isolate; }
.hero::before { /* golden arches echo as an abstract pattern */
  content: ''; position: absolute; right: -60px; top: -40px; width: 520px; height: 420px; z-index: -1; opacity: .16;
  background: radial-gradient(closest-side, transparent 62%, var(--gold) 63% 76%, transparent 77%) 0 60px / 260px 420px no-repeat,
              radial-gradient(closest-side, transparent 62%, var(--gold) 63% 76%, transparent 77%) 220px 60px / 260px 420px no-repeat; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,.18); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 16px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero-search { margin-top: 24px; display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); border-radius: 18px; padding: 8px 8px 8px 20px; max-width: 760px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.hero-search input { flex: 1; border: 0; outline: 0; font: 500 17px var(--f-body); padding: 10px 0; min-width: 0; background: transparent; color: var(--ink); }
.hero-search .icon { color: var(--muted); }
.hero-suggest { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-suggest button { background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; transition: background .16s; min-height: 34px; }
.hero-suggest button:hover { background: rgba(255,255,255,.26); }

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 26px; }
.kpi { text-align: left; padding: 18px; border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-1); border: 1px solid var(--line-2); transition: transform .18s var(--ease), box-shadow .18s; position: relative; overflow: hidden; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.kpi .k-num { font: 800 34px/1 var(--f-display); letter-spacing: -1px; display: block; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .k-lbl { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .k-top { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.kpi .k-bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); }
.kpi.red .k-num { color: var(--red); } .kpi.red .k-bar { background: var(--red); }
.kpi.ok .k-num { color: var(--ok); } .kpi.ok .k-bar { background: var(--ok); }

.home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); text-align: left; width: 100%; transition: border-color .16s, transform .16s var(--ease); }
.alert:hover { border-color: var(--gold); transform: translateX(2px); }
.alert .a-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.alert.crit .a-ico { background: var(--red-50); color: var(--red); }
.alert.warn .a-ico { background: var(--warn-50); color: #9A6B00; }
.alert.info .a-ico { background: var(--info-50); color: var(--info); }
.alert b { display: block; font-size: 14.5px; }
.alert span { font-size: 13px; color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; transition: border-color .16s, background .16s; min-height: 64px; }
.quick:hover { border-color: var(--gold); background: var(--gold-50); }
.quick b { font-size: 13.5px; display: block; line-height: 1.25; }
.quick span { font-size: 12px; color: var(--muted); }
.vendor-bars { display: flex; flex-direction: column; gap: 8px; }
.vbar { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; font-size: 13.5px; font-weight: 600; text-align: left; padding: 4px 6px; border-radius: 8px; }
.vbar:hover { background: var(--gold-50); }
.vbar .track { height: 12px; border-radius: 6px; background: var(--line-2); overflow: hidden; display: flex; }
.vbar .track i { display: block; height: 100%; }
.vbar em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- files explorer ---------- */
.explorer { display: grid; grid-template-columns: 270px 1fr; gap: 20px; align-items: start; }
.facets { position: sticky; top: 84px; padding: 18px; max-height: calc(100dvh - 100px); overflow: auto; }
.facets h4 { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.facets h4:first-child { margin-top: 0; }
.facet-list { display: flex; flex-direction: column; gap: 2px; }
.facet { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; text-align: left; width: 100%; min-height: 36px; }
.facet:hover { background: var(--line-2); }
.facet.on { background: var(--ink); color: #fff; }
.facet small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.facet.on small { color: #CFC5B6; }
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filterbar .search-inline { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; min-height: 46px; }
.filterbar .search-inline:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-50); }
.filterbar input { flex: 1; border: 0; outline: 0; font: 500 15px var(--f-body); background: transparent; color: var(--ink); min-width: 0; }
.result-meta { font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); transition: background .14s; }
.row:hover { background: var(--surface-2); }
.row:last-child { border-bottom: 0; }
.row .r-name { font-weight: 700; text-decoration: none; word-break: break-word; font-size: 14.5px; }
.row .r-name:hover { color: var(--red); text-decoration: underline; }
.row .r-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row .r-acts { display: flex; gap: 6px; }
mark { background: var(--gold-50); color: inherit; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 2px; padding: 0 1px; }

/* ---------- contracts dossier ---------- */
.dossier > *, .explorer > *, .home-grid > * { min-width: 0; }
.dossier { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.c-list { max-height: calc(100dvh - 190px); overflow: auto; padding: 8px; position: sticky; top: 84px; }
.c-item { width: 100%; text-align: left; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px; border-radius: 12px; transition: background .14s; border: 1.5px solid transparent; }
.c-item:hover { background: var(--surface-2); }
.c-item.on { background: var(--gold-50); border-color: var(--gold); }
.c-item .c-no { font: 700 12.5px var(--f-mono); color: var(--red-700); grid-column: 1 / -1; word-break: break-all; }
.c-item .c-t { font-weight: 700; font-size: 14px; line-height: 1.3; }
.c-item .c-v { font-size: 12.5px; color: var(--muted); }
.mini-track { display: flex; gap: 3px; grid-column: 1 / -1; margin-top: 6px; }
.mini-track i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.mini-track i.done { background: var(--ok); } .mini-track i.na { background: repeating-linear-gradient(45deg, var(--line-2) 0 3px, transparent 3px 6px); }
.c-detail { padding: 26px; }
.c-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; margin-bottom: 22px; }
.c-head .c-no { font: 700 13.5px var(--f-mono); color: var(--red-700); }
.c-head h3 { font-family: var(--f-display); font-size: 26px; margin: 6px 0; letter-spacing: -.6px; line-height: 1.15; }
.c-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.c-facts b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ring { width: 108px; height: 108px; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.ring .lbl b { font: 800 24px var(--f-display); display: block; }
.ring .lbl span { font-size: 11px; color: var(--muted); font-weight: 700; }
.lifecycle { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 8px 0 26px; position: relative; }
.lc-step { position: relative; padding: 0 6px; text-align: center; }
.lc-step::before { content: ''; position: absolute; top: 19px; left: -50%; right: 50%; height: 4px; background: var(--line); z-index: 0; }
.lc-step:first-child::before { display: none; }
.lc-step.done::before { background: var(--ok); }
.lc-node { position: relative; z-index: 1; width: 42px; height: 42px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--line); font: 800 14px var(--f-display); color: var(--muted); transition: transform .2s var(--ease); }
.lc-step.done .lc-node { background: var(--ok); border-color: var(--ok); color: #fff; }
.lc-step.gap .lc-node { border-color: var(--red); color: var(--red); background: var(--red-50); animation: pulse 1.8s var(--ease) infinite; }
.lc-step.na .lc-node { border-style: dashed; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(219,0,7,.12); } }
.lc-step b { display: block; font-size: 13px; line-height: 1.2; }
.lc-step span { font-size: 11.5px; color: var(--muted); }
.lc-files { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.lc-files a { font-size: 11.5px; text-decoration: none; background: var(--line-2); border-radius: 7px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-weight: 600; }
.lc-files a:hover { background: var(--gold-50); color: var(--red-700); }
.c-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.c-group { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.c-group h4 { margin: 0 0 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.file-link { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; text-decoration: none; font-size: 13px; font-weight: 600; min-height: 38px; }
.file-link:hover { background: var(--surface); }
.file-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-50); border-left: 4px solid var(--gold); font-size: 13.5px; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--ink-2); min-height: 34px; }
.seg button.on { background: var(--surface); box-shadow: var(--sh-1); color: var(--ink); }

/* ---------- mindmap ---------- */
.map-wrap { position: relative; height: calc(100dvh - 210px); min-height: 520px; overflow: hidden; background:
  radial-gradient(circle at 1px 1px, #E6DACA 1px, transparent 0) 0 0 / 22px 22px, var(--surface-2); }
.map-wrap svg { width: 100%; height: 100%; cursor: grab; display: block; }
.map-wrap svg:active { cursor: grabbing; }
.map-tools { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; flex-wrap: wrap; z-index: 2; }
.map-legend { position: absolute; bottom: 14px; left: 14px; z-index: 2; background: rgba(255,255,255,.94); border-radius: 12px; padding: 10px 12px; box-shadow: var(--sh-1); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; max-width: calc(100% - 28px); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.node text { font: 600 12.5px var(--f-body); fill: var(--ink); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; stroke-linejoin: round; }
.node.root text { font: 800 16px var(--f-display); }
.node.vendor text { font-weight: 800; font-size: 13.5px; }
.node.contract text { font: 700 11.5px var(--f-mono); fill: var(--red-700); }
.node.file text { font-weight: 500; font-size: 11.5px; fill: var(--ink-2); }
.node { cursor: pointer; }
.node:hover text { fill: var(--red); }
.link { fill: none; stroke: #D8CAB6; stroke-width: 1.6px; }
.map-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; max-width: 320px; opacity: 0; transition: opacity .12s; }

/* ---------- workflow ---------- */
.swim { overflow-x: auto; padding: 0; }
.swim-grid { display: grid; grid-template-columns: 150px repeat(10, minmax(148px, 1fr)); min-width: 1640px; position: relative; }
.lane-h { position: sticky; left: 0; z-index: 2; padding: 16px 14px; font-weight: 800; font-family: var(--f-display); font-size: 15px; display: flex; flex-direction: column; justify-content: center; gap: 2px; background: var(--surface); border-right: 1px solid var(--line); }
.lane-h span { font: 600 11.5px var(--f-body); color: var(--muted); }
.lane-row { display: contents; }
.lane-cell { border-bottom: 1px dashed var(--line); padding: 14px 6px; min-height: 120px; display: flex; align-items: center; justify-content: center; position: relative; }
.lane-cell.k { background: linear-gradient(0deg, rgba(219,0,7,.025), rgba(219,0,7,.025)); }
.lane-cell.t { background: linear-gradient(0deg, rgba(255,188,13,.06), rgba(255,188,13,.06)); }
.col-h { text-align: center; font: 700 11px var(--f-mono); color: var(--muted); padding: 10px 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.col-h:first-child { position: sticky; left: 0; z-index: 2; }
.wf-step { width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 10px 11px; transition: transform .16s var(--ease), border-color .16s, box-shadow .16s; position: relative; z-index: 1; }
.wf-step:hover, .wf-step.on { transform: translateY(-2px); box-shadow: var(--sh-2); }
.wf-step.k { border-color: #F3B9B5; } .wf-step.k.on { border-color: var(--red); }
.wf-step.t { border-color: #F7D98A; } .wf-step.t.on { border-color: var(--gold-600); }
.wf-step.a { border-color: #B9D0EE; } .wf-step.a.on { border-color: var(--info); }
.wf-step .n { font: 800 11px var(--f-mono); color: var(--muted); }
.wf-step b { display: block; font-size: 13.5px; line-height: 1.25; margin: 2px 0 4px; }
.wf-step .sla { font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.wf-svg { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: visible; }
.wf-svg path { fill: none; stroke: #C9B9A2; stroke-width: 2; }
.wf-svg path.hot { stroke: var(--red); stroke-width: 2.5; }
.wf-detail { margin-top: 16px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.wf-detail .owner { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.checklist li .box { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--ok-50); color: var(--ok); }
.checklist li.extra .box { background: var(--red-50); color: var(--red); }
.checklist li.off { opacity: .4; }
.amount { display: flex; align-items: center; gap: 10px; margin: 10px 0 16px; }
.amount input { font: 800 26px var(--f-display); width: 100%; border: 0; border-bottom: 3px solid var(--gold); background: transparent; padding: 4px 0; outline: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.verdict { font-weight: 800; font-size: 13.5px; padding: 8px 12px; border-radius: 10px; display: inline-block; margin-bottom: 12px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .who { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.chain .who b { display: block; font-size: 13.5px; }
.chain .who span { color: var(--muted); font-size: 11.5px; }
.chain .arr { color: var(--red); }
.wf-bottom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 20px; }

/* ---------- vendors ---------- */
.v-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.v-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: transform .18s var(--ease), box-shadow .18s; }
.v-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.v-top { display: flex; gap: 12px; align-items: center; }
.v-avatar { width: 46px; height: 46px; border-radius: 14px; background: var(--gold); display: grid; place-items: center; font: 800 16px var(--f-display); color: var(--ink); flex: none; }
.v-top h3 { margin: 0; font: 800 18px var(--f-display); letter-spacing: -.3px; }
.v-top span { font-size: 12px; color: var(--muted); font-weight: 600; display: block; line-height: 1.3; }
.v-stack { height: 10px; border-radius: 5px; background: var(--line-2); display: flex; overflow: hidden; }
.v-stack i { display: block; height: 100%; }
.v-meta { font-size: 13px; display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; }
.v-meta dt { color: var(--muted); font-weight: 600; } .v-meta dd { margin: 0; font-weight: 600; word-break: break-word; }
.v-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ---------- admin ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.form label.full { grid-column: 1 / -1; }
.form input, .form textarea, .form select { font: 500 15px var(--f-body); padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; min-height: 46px; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-50); }
.form .help { font-weight: 500; color: var(--muted); font-size: 12px; }
.form .acts { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.msg { font-weight: 700; font-size: 13.5px; } .msg.err { color: var(--red); } .msg.ok { color: var(--ok); }

/* ---------- command palette ---------- */
.cmdk-backdrop { position: fixed; inset: 0; background: rgba(31,27,22,.5); backdrop-filter: blur(3px); z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.cmdk-backdrop.on { display: flex; animation: fade .16s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.cmdk { width: min(720px, 100%); background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; animation: pop .2s var(--ease); }
@keyframes pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.cmdk-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; border: 0; outline: 0; font: 600 18px var(--f-body); background: transparent; color: var(--ink); min-width: 0; }
.cmdk-list { max-height: 58vh; overflow: auto; padding: 8px; }
.cmdk-group { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 800; padding: 10px 10px 6px; }
.cmdk-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 9px 10px; border-radius: 12px; min-height: 48px; }
.cmdk-item.on { background: var(--gold-50); box-shadow: inset 3px 0 0 var(--red); }
.cmdk-item .t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .g { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; z-index: 90; transition: transform .22s var(--ease); display: flex; align-items: center; gap: 8px; }
.toast.on { transform: translate(-50%, 0); }
.skeleton { background: linear-gradient(90deg, var(--line-2), #fff, var(--line-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 12px; height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .home-grid, .wf-detail { grid-template-columns: 1fr; }
  .dossier { grid-template-columns: 320px 1fr; }
  .wf-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--ink); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #CFC5B6; text-decoration: none; font-size: 10.5px; font-weight: 700; padding: 6px 8px; border-radius: 10px; min-width: 56px; min-height: 48px; justify-content: center; }
  .mobile-nav a.on { color: var(--ink); background: var(--gold); }
  .page { padding: 18px 16px 96px; }
  .topbar { padding: 10px 16px; }
  .search-trigger { min-width: 0; flex: 1; }
  .search-trigger kbd, .topbar .crumb { display: none; }
  .explorer, .dossier { grid-template-columns: 1fr; }
  .facets, .c-list { position: static; max-height: none; }
  .c-list { max-height: 300px; }
  .c-groups, .form { grid-template-columns: 1fr; }
  .hero { padding: 28px 20px 24px; }
  .lifecycle { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .lc-step:nth-child(4)::before { display: none; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 34px 1fr; }
  .row .r-acts { grid-column: 1 / -1; }
  .c-head { grid-template-columns: 1fr; }
  .vbar { grid-template-columns: 96px 1fr 30px; }
  h2.title { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- payment packs (bộ chứng từ) ---------- */
.pack-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 16px; }
.pack-flow .pf { font: 800 11.5px var(--f-mono); padding: 5px 9px; border-radius: 8px; background: var(--line-2); color: var(--muted); }
.pack-flow .pf.ok { background: var(--ok); color: #fff; }
.pack-flow .pf.need { background: var(--red-50); color: var(--red-700); box-shadow: inset 0 0 0 1.5px var(--red); }
.pack-flow .pf.opt { background: repeating-linear-gradient(45deg, var(--line-2) 0 4px, transparent 4px 8px); }
.pack-flow .arr { color: var(--muted); display: inline-flex; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.slot { border: 1.5px solid var(--line-2); border-radius: 14px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.slot.ok { border-color: #BFE3CB; background: #F6FCF8; }
.slot.need { border-color: #F3B9B5; background: #FFF8F7; }
.slot.opt { opacity: .78; }
.slot-h { display: flex; align-items: center; gap: 10px; }
.slot-h > span:nth-child(2) { flex: 1; min-width: 0; }
.slot-h b { display: block; font-size: 14px; }
.slot-h span span { font-size: 12px; color: var(--muted); font-weight: 600; }
.slot-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--muted); }
.slot.ok .slot-ic { background: var(--ok); color: #fff; }
.slot.need .slot-ic { background: var(--red); color: #fff; }
.slot-item { display: flex; align-items: center; gap: 6px; }
.slot-item a { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 8px; border-radius: 8px; background: var(--surface); }
.slot-item a:hover { color: var(--red-700); }
.slot-item a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.picker { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.picker .search-inline { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; }
.picker .search-inline:focus-within { border-color: var(--gold); }
.picker input { flex: 1; border: 0; outline: 0; font: 500 13.5px var(--f-body); background: transparent; color: var(--ink); min-width: 0; padding: 8px 0; }
.pk-list { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; }
@media (max-width: 960px) { .slots { grid-template-columns: 1fr; } }
