/* CLIENT PRIVILEGED AND CONFIDENTIAL. Not for onward sharing. Not to be used to train any AI model. */
/* Layout: operations console. Fixed left rail of workspaces, a slim command bar, and a wide work
   surface; the agent floor is the one expressive moment, everything else is quiet finance tooling. */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f2f5f9; --surface-3: #e6e7e8;
  --fg: #4d4d4f; --strong: #23272e; --muted: #808285; --line: #d9d9d9;
  --brand: #2d4e9f; --brand-dark: #1f3a7a; --brand-light: #5b7bc4; --brand-tint: #e9eef8;
  --on-brand: #ffffff; --th-bg: #2d4e9f; --th-fg: #ffffff;
  --rag-green: #28a745; --rag-amber: #ffc000; --rag-orange: #ed7d31; --rag-red: #c00000; --rag-info: #5b9bd5;
  --rag-green-bg: #e3f4e7; --rag-amber-bg: #fff4cc; --rag-orange-bg: #fde9dc; --rag-red-bg: #f8dcdc; --rag-info-bg: #e3eef8;
  --desk: #8b9ab0; --desk-leg: #b3bfcf; --screen: #cfd9e8; --screen-on: #9fd0ff; --stripe: #c9dbf2; --helmet: #ffffff; --shirt: #d6dde8; --hair: #3b3030; --paper: #ffffff;
  --shadow: 0 1px 2px rgba(0, 28, 72, .06), 0 8px 24px rgba(0, 28, 72, .06);
  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 10px; --rail: #1f3a7a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1220; --surface: #101b2e; --surface-2: #15233b; --surface-3: #1d2d4a;
    --fg: #c4cddb; --strong: #eef2f8; --muted: #8b97ab; --line: #25365a;
    --brand: #7aa5ea; --brand-dark: #b4cbf1; --brand-light: #86a9dc; --brand-tint: #16284a;
    --on-brand: #06142b; --th-bg: #12376f; --th-fg: #ffffff;
    --rag-green-bg: #12301d; --rag-amber-bg: #3a3010; --rag-orange-bg: #3b2414; --rag-red-bg: #3c1414; --rag-info-bg: #142c45;
    --desk: #4d5d78; --desk-leg: #3a4862; --screen: #2b3a55; --screen-on: #5fb6ff; --stripe: #9ab9e6; --helmet: #e8edf5; --shirt: #5c6b85; --hair: #1c1616; --paper: #f6f4ee;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --rail: #06101f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1220; --surface: #101b2e; --surface-2: #15233b; --surface-3: #1d2d4a;
  --fg: #c4cddb; --strong: #eef2f8; --muted: #8b97ab; --line: #25365a;
  --brand: #7aa5ea; --brand-dark: #b4cbf1; --brand-light: #86a9dc; --brand-tint: #16284a;
  --on-brand: #06142b; --th-bg: #12376f; --th-fg: #ffffff;
  --rag-green-bg: #12301d; --rag-amber-bg: #3a3010; --rag-orange-bg: #3b2414; --rag-red-bg: #3c1414; --rag-info-bg: #142c45;
  --desk: #4d5d78; --desk-leg: #3a4862; --screen: #2b3a55; --screen-on: #5fb6ff; --stripe: #9ab9e6; --helmet: #e8edf5; --shirt: #5c6b85; --hair: #1c1616; --paper: #f6f4ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --rail: #06101f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { font-family: var(--f-display); color: var(--brand); text-wrap: balance; margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; color: var(--brand-light); }
h3 { font-size: 14px; font-weight: 650; color: var(--brand-light); }
.num, td.n, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 2px; }

/* shell */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100%; background: linear-gradient(to right, var(--rail) 228px, transparent 228px); }
.rail { background: var(--rail); color: #dfe8f6; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.mark { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 4px 8px 16px; }
.mark-logo { background: #ffffff; border-radius: 8px; padding: 8px 12px; display: flex; }
.mark-logo img { display: block; width: 132px; height: auto; }
.mark-glyph { width: 34px; height: 34px; border-radius: 9px; background: #ffffff; display: grid; place-items: center; }
.mark-t { font-family: var(--f-display); font-weight: 750; color: #ffffff; font-size: 15px; line-height: 1.15; letter-spacing: .01em; }
.mark-s { font-size: 11px; color: #a9bddc; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #dfe8f6; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); }
.nav a.on { background: #ffffff; color: #002c6b; }
.nav .cnt { font-size: 11px; min-width: 20px; text-align: center; border-radius: 10px; padding: 0 6px; background: rgba(255, 255, 255, .16); font-variant-numeric: tabular-nums; }
.nav a.on .cnt { background: #e8eef7; }
.nav .cnt.hot { background: #ffc000; color: #2b2200; }
.rail-foot { margin-top: auto; font-size: 10.5px; color: #a9bddc; padding: 8px; line-height: 1.45; }
.main { min-width: 0; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar .title { font-family: var(--f-display); font-weight: 700; color: var(--brand); font-size: 18px; margin-right: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.chip .d { width: 8px; height: 8px; border-radius: 50%; background: var(--rag-info); }
.chip.live .d { background: var(--rag-green); }
.chip.sim .d { background: var(--rag-amber); }
.chip.off .d { background: var(--rag-red); }
.chip.ai.local { background: var(--rag-green-bg); border-color: var(--rag-green); font-weight: 600; color: var(--strong); }
.chip.ai.local .d { background: var(--rag-green); }
.chip.ai.cloud .d { background: var(--rag-info); }
.chip.ai.sim .d { background: var(--rag-amber); }
.content { padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.notice { font-size: 11.5px; color: var(--muted); padding: 10px 24px 18px; border-top: 1px solid var(--line); }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--rag-info); background: var(--surface); border-radius: 8px; font-size: 13px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: var(--brand-light); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--rag-red); border-color: color-mix(in srgb, var(--rag-red) 45%, var(--line)); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inp, select.inp, textarea.inp { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
textarea.inp { width: 100%; min-height: 80px; resize: vertical; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
label.fld > span { font-weight: 550; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch.on { background: var(--rag-green); border-color: var(--rag-green); }
.switch.on::after { left: 18px; }

/* cards, kpis */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card > h2 { margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi { background: var(--surface); padding: 12px 14px; }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .v { font-family: var(--f-display); font-size: 24px; font-weight: 700; color: var(--strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi .s { font-size: 11.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* tables */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { background: var(--th-bg); color: var(--th-fg); text-align: left; font-weight: 600; padding: 8px 10px; white-space: nowrap; font-size: 12px; position: sticky; top: 0; }
table.t td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
table.t tbody tr:nth-child(even) td { background: var(--surface-2); }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--brand-tint); }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

/* status pills: RAG only in status columns */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.g { color: var(--rag-green); background: var(--rag-green-bg); }
.pill.a { color: #9a7300; background: var(--rag-amber-bg); }
.pill.o { color: var(--rag-orange); background: var(--rag-orange-bg); }
.pill.r { color: var(--rag-red); background: var(--rag-red-bg); }
.pill.i { color: var(--rag-info); background: var(--rag-info-bg); }
.pill.n { color: var(--muted); background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.a { color: var(--rag-amber); } :root:not([data-theme="light"]) .pill.r { color: #ff6b6b; } }
:root[data-theme="dark"] .pill.a { color: var(--rag-amber); }
:root[data-theme="dark"] .pill.r { color: #ff6b6b; }
.tag { display: inline-block; font-family: var(--f-mono); font-size: 11.5px; padding: 0 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.conf { font-family: var(--f-mono); font-size: 12px; }
.conf.lo { color: var(--rag-red); font-weight: 600; } .conf.mid { color: #9a7300; font-weight: 600; }

/* floor */
.floor-wrap { display: flex; flex-direction: column; gap: 18px; }
.floor-card { padding: 8px; overflow-x: auto; }
.floor-svg { width: 100%; height: auto; display: block; }
.floor-svg text { font-family: var(--f-body); }
.panel { fill: var(--surface); stroke: var(--line); }
.floor-panel { fill: var(--surface); }
.lane { fill: var(--surface-2); stroke: var(--line); stroke-dasharray: 3 4; }
.zone-label, .lane-label { font-family: var(--f-display) !important; font-size: 11px; letter-spacing: .12em; fill: var(--brand-light); font-weight: 700; }
.lane-label { font-size: 10px; }
.flow-line { fill: none; stroke: var(--brand-light); stroke-opacity: .28; stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.chan-box { fill: var(--surface); stroke: var(--brand-light); }
.chan-ico { fill: none; stroke: var(--brand); stroke-width: 1.6; }
.chan-line { fill: none; stroke: var(--brand); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chan-line.thick { stroke-width: 2.2; }
.chan-label { font-size: 10.5px; fill: var(--muted); }
.desk { fill: var(--desk); } .desk-leg { fill: var(--desk-leg); }
.vest { fill: var(--brand); } .stripe { fill: var(--stripe); } .shirt { fill: var(--shirt); }
.helmet { fill: var(--helmet); stroke: var(--desk-leg); stroke-width: .8; } .helmet-band { fill: var(--brand-light); }
.hair { fill: var(--hair); } .eye { fill: #1d1d1d; } .mouth { fill: none; stroke: #1d1d1d; stroke-width: 1.2; stroke-linecap: round; } .mouth.lips { stroke: #b0485a; stroke-width: 1.6; }
.screen-back { fill: #5b6474; } .screen { fill: var(--screen); transition: fill .3s; }
.plate-name { font-size: 12px; font-weight: 650; fill: var(--strong); }
.plate-sub { font-size: 10px; fill: var(--muted); }
.worker, .desk-person { cursor: pointer; }
.worker:hover .plate-name, .desk-person:hover .plate-name { fill: var(--brand); text-decoration: underline; }
.worker .bob { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-1.2px); } }
.worker .hand, .worker .qmark, .worker .zzz, .worker .bang, .worker .gear { display: none; }
.worker.working .screen { fill: var(--screen-on); }
.worker.working .arm-l { animation: type .22s ease-in-out infinite alternate; transform-origin: -18px -30px; transform-box: view-box; }
.worker.working .arm-r { animation: type .22s ease-in-out infinite alternate-reverse; transform-origin: 18px -30px; transform-box: view-box; }
.worker .arm-l, .worker .arm-r { transform-box: fill-box; transform-origin: 50% 0; }
@keyframes type { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.worker.working .gear { display: block; animation: spin 1.2s linear infinite; }
.gear-c { fill: var(--brand-light); } .gear-h { fill: var(--surface); }
@keyframes spin { to { transform: translate(32px, -18px) rotate(360deg); } }
.worker.waiting .hand { display: block; } .worker.waiting .arm-r { display: none; }
.worker.waiting .qmark { display: block; animation: pop 1.4s ease-in-out infinite; }
.q-c { fill: var(--rag-amber); } .q-t { font-size: 13px; font-weight: 800; fill: #2b2200; }
.bang-c { fill: var(--rag-red); }
.worker.error .bang { display: block; } .worker.error .bang .q-t { fill: #ffffff; }
@keyframes pop { 50% { transform: translateY(-3px); } }
.worker.offline .bob { filter: grayscale(1); opacity: .45; animation: none; }
.worker.offline .zzz { display: block; }
.z-t { font-size: 13px; font-weight: 700; fill: var(--muted); animation: zz 2.4s ease-in-out infinite; }
.z-t.z2 { animation-delay: .6s; font-size: 10px; }
@keyframes zz { 0% { opacity: 0; transform: translateY(4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.sdot { fill: var(--rag-green); stroke: var(--surface); stroke-width: 2; }
.worker.working .sdot { fill: var(--rag-info); } .worker.waiting .sdot { fill: var(--rag-amber); } .worker.offline .sdot { fill: var(--rag-red); } .worker.error .sdot { fill: var(--rag-red); }
.qb-r { fill: var(--paper); stroke: var(--desk); } .qb-t { font-size: 11px; font-weight: 700; fill: #23272e; font-family: var(--f-mono); }
.bubble { opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.bubble.show { opacity: 1; }
.bub-r { fill: var(--surface); stroke: var(--brand-light); stroke-width: 1.2; }
.bub-t { font-size: 11px; fill: var(--strong); }
.badge { display: none; } .desk-person.has-work .badge { display: block; animation: pop 1.6s ease-in-out infinite; }
.badge-c { fill: var(--rag-amber); } .badge-t { font-size: 11.5px; font-weight: 800; fill: #2b2200; }
.desk-person.has-work .screen { fill: #ffe38a; }
.ping { fill: none; stroke: var(--rag-amber); stroke-width: 3; opacity: 0; }
.ping.go { animation: ping 1.1s ease-out 2; }
@keyframes ping { 0% { opacity: .9; r: 12; } 100% { opacity: 0; r: 46; } }
.bldg-top { stop-color: var(--brand); } .bldg-bot { stop-color: var(--brand-dark); }
:root[data-theme="dark"] .bldg-top { stop-color: #1b3f7a; } :root[data-theme="dark"] .bldg-bot { stop-color: #0d2247; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bldg-top { stop-color: #1b3f7a; } :root:not([data-theme="light"]) .bldg-bot { stop-color: #0d2247; } }
.bldg-sign { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.bldg-sign-t { font-family: var(--f-display) !important; font-weight: 800; font-size: 14px; letter-spacing: .08em; fill: var(--brand); }
.win { fill: #1a3566; transition: fill .4s; } .win.lit { fill: #8fb8ee; } .win.flash { fill: #ffe38a; }
.door { fill: #0b1d3d; stroke: #8fb8ee; stroke-width: 1.5; }
.bldg-small { font-size: 10px; fill: #cfe0f7; }
.bldg-count { font-size: 11.5px; font-weight: 650; fill: var(--strong); font-variant-numeric: tabular-nums; }
.job-box { fill: var(--surface-2); stroke: var(--line); } .job-id { font-family: var(--f-mono) !important; font-size: 11px; font-weight: 700; fill: var(--brand); } .job-n { font-size: 10px; fill: var(--muted); }
.tray-box { fill: var(--surface-3); stroke: var(--desk); } .tray-count { font-size: 15px; font-weight: 800; fill: var(--strong); }
.env-r { fill: var(--paper); stroke: var(--brand); stroke-width: 1.3; } .env-f { fill: none; stroke: var(--brand); stroke-width: 1.1; }
.env.copy .env-r { stroke: var(--brand-light); } .env.copy { opacity: .85; }
.env.rec .env-r { fill: #dff0e3; stroke: var(--rag-green); }
.env-tag { font-family: var(--f-mono) !important; font-size: 9.5px; font-weight: 700; fill: var(--brand); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.crate-r { fill: #c98a3c; stroke: #7a4e17; } .crate-l { stroke: #7a4e17; }
.env.land { transition: opacity .25s; opacity: 0; }

.side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; min-width: 0; align-items: start; }
.ticker { max-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 0; }
.tick { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; }
.tick:first-child { border-top: 0; }
.tick .ag { font-family: var(--f-mono); font-weight: 700; color: var(--brand); }
.tick .when { color: var(--muted); font-size: 10.5px; }
.drop { border: 2px dashed var(--brand-light); border-radius: var(--r); padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.drop.over { background: var(--brand-tint); }
.speed { width: 100%; }

/* workbench */
.wb { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.qlist { display: flex; flex-direction: column; gap: 8px; }
.qitem { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.qitem:hover { border-color: var(--brand-light); }
.qitem.sel { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.qitem .t1 { font-weight: 600; color: var(--strong); }
.qitem .t2 { font-size: 12px; color: var(--muted); }
.decide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: 13px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; color: var(--strong); overflow-wrap: anywhere; }
.proposal { padding: 10px 12px; background: var(--brand-tint); border-radius: 8px; font-size: 13px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.fld.flag .inp { border-color: var(--rag-amber); }
.src { font-family: var(--f-mono); font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

/* invoice paper */
.doc-paper { background: var(--paper); color: #2a2a2a; border: 1px solid #d9d9d9; border-radius: 6px; padding: 18px; font: 12px/1.45 "IBM Plex Sans", Arial, sans-serif; box-shadow: var(--shadow); }
.doc-scan { filter: contrast(.92) sepia(.12); background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, .025) 0 1px, transparent 1px 3px); }
.doc-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #2a2a2a; padding-bottom: 8px; margin-bottom: 10px; }
.doc-sup { font-weight: 700; font-size: 15px; } .doc-title { font-weight: 800; letter-spacing: .08em; font-size: 14px; }
.doc-muted { color: #6b6b6b; font-size: 11px; } .doc-lbl { font-size: 10px; text-transform: uppercase; color: #6b6b6b; letter-spacing: .06em; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.doc-kv { display: flex; justify-content: space-between; gap: 10px; }
.doc-lines { width: 100%; border-collapse: collapse; margin: 8px 0; }
.doc-lines th { background: #ececec; color: #2a2a2a; text-align: left; padding: 4px 6px; font-size: 11px; }
.doc-lines td { border-bottom: 1px solid #e3e3e3; padding: 4px 6px; }
.doc-lines td:nth-child(n+2), .doc-lines th:nth-child(n+2) { text-align: right; }
.doc-tot { margin-left: auto; width: 60%; } .doc-gross { border-top: 2px solid #2a2a2a; padding-top: 3px; font-size: 13px; }
.doc-bank { margin-top: 10px; padding: 6px 8px; background: #f3f3f3; font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.doc-smudge { filter: blur(.6px); opacity: .8; }

/* drawer, modal, toasts */
.scrim { position: fixed; inset: 0; background: rgba(0, 20, 50, .35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: var(--bg); z-index: 41; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0, 0, 0, .2); }
.drawer-h { display: flex; gap: 10px; align-items: center; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.drawer-b { overflow: auto; padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.modal { position: fixed; inset: 5% 8%; background: var(--surface); z-index: 51; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.modal pre { margin: 0; padding: 16px; overflow: auto; font: 12px/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; flex: 1; }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: min(380px, calc(100% - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand-light); border-radius: 8px; padding: 9px 12px; box-shadow: var(--shadow); font-size: 12.5px; animation: tin .25s ease-out; }
.toast.err { border-left-color: var(--rag-red); } .toast.ok { border-left-color: var(--rag-green); } .toast.teams { border-left-color: #6264a7; }
.toast b { color: var(--strong); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.timeline { display: flex; flex-wrap: wrap; gap: 4px; }
.timeline span { font-size: 10.5px; padding: 2px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.timeline span.done { background: var(--brand-tint); color: var(--brand); border-color: transparent; }
.timeline span.now { background: var(--brand); color: var(--on-brand); }
.ev { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.ev .ag { font-family: var(--f-mono); font-weight: 700; color: var(--brand); }
.ev .meta { color: var(--muted); font-size: 11px; }
.msg { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.msg.teams { border-left: 4px solid #6264a7; } .msg.email { border-left: 4px solid var(--brand-light); }
.msg .body { white-space: pre-wrap; font-size: 12.5px; color: var(--fg); }
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.acard { display: flex; flex-direction: column; gap: 8px; }
.acard .top { display: flex; gap: 10px; align-items: center; }
.acard .id { font-family: var(--f-mono); font-weight: 700; color: var(--on-brand); background: var(--brand); border-radius: 6px; padding: 2px 7px; font-size: 12px; }
.acard .nm { font-weight: 650; color: var(--strong); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 2px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.conn .hd { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.conn .cat { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.conn details summary { cursor: pointer; color: var(--brand); font-weight: 550; margin: 6px 0; }
.bar-meter { height: 8px; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.bar-meter i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-light); border-radius: 4px; }
.bar-meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--strong); }

@media (max-width: 1180px) { .wb { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .floor-svg { min-width: 900px; }
  .bar .title { width: 100%; }
  .userlab { font-size: 0 !important; } .userlab select { font-size: 13px; }
  .rail { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 6px; }
  .mark { padding: 0 8px 0 0; flex-direction: row; align-items: center; } .mark-logo img { width: 84px; } .mark-s, .rail-foot { display: none; }
  .nav { display: flex; gap: 4px; } .nav a { white-space: nowrap; }
  .content { padding: 14px 16px 30px; } .bar { padding: 8px 16px; }
  .grid2, .decide { grid-template-columns: minmax(0, 1fr); }
  .modal { inset: 2% 2%; }
  .conn-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
