/* Sugar Factory PFD — design tokens first, components after. */
:root {
  --bg: #eef0f2; --surface: #ffffff; --surface-2: #f6f7f8; --line: #d9dde1; --line-strong: #b9c0c7;
  --text: #1c2630; --text-2: #4a5663; --text-3: #6b7783;
  --brand: #1f5f8b; --brand-strong: #164a6e; --brand-soft: #e3eff7;
  --bar: #1d2b36; --bar-text: #e8eef3;
  --ok: #2e7d4f; --ok-soft: #e1f2e8; --warn: #b9770e; --warn-soft: #fbf0d9; --crit: #c0392b; --crit-soft: #fbe3df; --info: #3b6ea5; --off: #7b8794;
  --measured: #1f6f6b; --estimated: #b9770e; --calculated: #6a4c93;
  --glass: rgba(255,255,255,.78); --glass-line: rgba(255,255,255,.65);
  --shadow: 0 8px 28px rgba(18,30,42,.18); --shadow-sm: 0 1px 3px rgba(18,30,42,.12);
  --radius: 10px; --radius-sm: 6px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --canvas: #f9fafb; --grid-dot: #d5dadf; --node-fill: #ffffff; --node-line: #8d98a3;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12181e; --surface: #1a232c; --surface-2: #202b35; --line: #2f3b47; --line-strong: #455464;
    --text: #e6ecf1; --text-2: #b3bfca; --text-3: #8c99a6;
    --brand: #5aa6d6; --brand-strong: #86bde3; --brand-soft: #1d3446;
    --bar: #0c1116; --ok: #5cc58a; --ok-soft: #173326; --warn: #e0a243; --warn-soft: #3a2d13; --crit: #ef6d5f; --crit-soft: #40201c; --info: #7aa6d8; --off: #8c99a6;
    --measured: #55c2bb; --estimated: #e0a243; --calculated: #b79be0;
    --glass: rgba(26,35,44,.78); --glass-line: rgba(255,255,255,.08);
    --shadow: 0 8px 28px rgba(0,0,0,.55);
    --canvas: #151d25; --grid-dot: #2a3641; --node-fill: #1f2a34; --node-line: #5d6c7b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12181e; --surface: #1a232c; --surface-2: #202b35; --line: #2f3b47; --line-strong: #455464;
  --text: #e6ecf1; --text-2: #b3bfca; --text-3: #8c99a6;
  --brand: #5aa6d6; --brand-strong: #86bde3; --brand-soft: #1d3446;
  --bar: #0c1116; --ok: #5cc58a; --ok-soft: #173326; --warn: #e0a243; --warn-soft: #3a2d13; --crit: #ef6d5f; --crit-soft: #40201c; --info: #7aa6d8; --off: #8c99a6;
  --measured: #55c2bb; --estimated: #e0a243; --calculated: #b79be0;
  --glass: rgba(26,35,44,.78); --glass-line: rgba(255,255,255,.08);
  --shadow: 0 8px 28px rgba(0,0,0,.55);
  --canvas: #151d25; --grid-dot: #2a3641; --node-fill: #1f2a34; --node-line: #5d6c7b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { display: grid; place-items: center; height: 100%; } .boot-msg { color: var(--text-2); }

/* Shell */
.shell { display: grid; grid-template-columns: 212px 1fr; grid-template-rows: 52px auto 1fr; height: 100%; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--bar); color: var(--bar-text); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .01em; min-width: 0; }
.topbar .brand svg { flex: none; }
.topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.demo-banner { grid-column: 1 / -1; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); padding: 4px 14px; font-size: 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.demo-banner span { font-weight: 450; color: var(--text-2); }
.nav { background: var(--surface); border-right: 1px solid var(--line); padding: 10px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-2); font-weight: 550; min-height: 40px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.nav .badge-count { margin-left: auto; background: var(--crit); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; font-weight: 700; }
.main { overflow: auto; min-width: 0; position: relative; }
.page { padding: 18px 22px 40px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
@media (max-width: 1100px) {
  .shell { grid-template-columns: 58px 1fr; }
  .nav a span.lbl, .nav .badge-count { display: none; }
  .nav a { justify-content: center; padding: 10px 0; }
  .nav a { position: relative; } .nav a .dot { position: absolute; top: 6px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); }
  .page { padding: 14px 14px 32px; }
}

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 34px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; } .btn.danger:hover:not(:disabled) { filter: brightness(.92); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.sm { padding: 3px 9px; min-height: 28px; font-size: 13px; }
.btn.icon { padding: 0; width: 34px; justify-content: center; } .btn.sm.icon { width: 28px; }
.btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.topbar .btn { background: transparent; color: var(--bar-text); border-color: rgba(255,255,255,.22); } .topbar .btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
input, select, textarea { width: 100%; padding: 7px 9px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
textarea { min-height: 72px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--crit); background: var(--crit-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-3); }
.inline-input { width: auto; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); } .field .err { font-size: 12px; color: var(--crit); font-weight: 600; }
.field .unit-wrap { display: flex; align-items: center; gap: 6px; } .field .unit-wrap .unit { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 16px 0 8px; font-weight: 700; grid-column: 1 / -1; }
.form-error { background: var(--crit-soft); color: var(--crit); border: 1px solid var(--crit); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 10px; font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; min-height: 32px; cursor: pointer; font-weight: 550; color: var(--text-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; } .seg button[aria-pressed="true"] { background: var(--brand); color: #fff; } .seg button:hover:not([aria-pressed="true"]) { background: var(--surface-2); }

/* Cards, tables, chips */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card > .card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.card > .card-body { padding: 14px; }
.grid { display: grid; gap: 14px; } .grid.c2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); } .grid.c3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 760px) { .grid.c2 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 12px 14px; border-left: 4px solid var(--line-strong); position: relative; }
.kpi.good { border-left-color: var(--ok); } .kpi.bad { border-left-color: var(--crit); } .kpi.warn { border-left-color: var(--warn); }
.kpi .k-name { font-size: 12px; color: var(--text-2); font-weight: 650; }
.kpi .k-val { font-size: 25px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.kpi .k-val small { font-size: 12px; font-weight: 550; color: var(--text-3); margin-left: 4px; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); } .kpi .k-actions { position: absolute; top: 6px; right: 6px; display: flex; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); background: var(--surface-2); padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; z-index: 1; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; } table.t tbody tr:hover { background: var(--surface-2); }
table.t .num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.clickable { cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 1px 8px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; } .chip.info { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.chip.off { color: var(--off); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.basis { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 4px; border: 1.5px solid currentColor; white-space: nowrap; }
.basis.measured { color: var(--measured); } .basis.estimated { color: var(--estimated); border-style: dashed; } .basis.calculated { color: var(--calculated); border-style: dotted; }
.demo-tag { font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--warn); border: 1px solid var(--warn); border-radius: 3px; padding: 0 4px; vertical-align: 1px; }

/* States */
.state { display: grid; place-items: center; text-align: center; gap: 8px; padding: 36px 18px; color: var(--text-2); }
.state .icon { font-size: 26px; opacity: .7; } .state.error { color: var(--crit); } .state strong { color: var(--text); }
.callout { border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface); margin-bottom: 8px; font-size: 13px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); } .callout.error { border-left-color: var(--crit); background: var(--crit-soft); } .callout.info { border-left-color: var(--info); background: var(--brand-soft); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(12,20,28,.42); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: grid; place-items: center; padding: 16px; animation: fade .16s ease-out; }
.dialog { background: var(--glass); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: var(--shadow); width: min(680px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: pop .22s cubic-bezier(.2,.9,.3,1.25); }
.dialog.wide { width: min(980px, 100%); } .dialog.narrow { width: min(440px, 100%); }
.dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 10px; }
.dialog > .body { padding: 4px 18px 14px; overflow: auto; }
.dialog > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.toasts { position: fixed; right: 14px; bottom: 14px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 28px)); }
.toast { background: var(--bar); color: var(--bar-text); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); animation: pop .2s ease-out; border-left: 4px solid var(--info); }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--crit); } .toast.warn { border-left-color: var(--warn); }
.popover { position: absolute; z-index: 90; background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; animation: pop .16s ease-out; color: var(--text); }
.tooltip { position: fixed; z-index: 150; pointer-events: none; background: var(--bar); color: var(--bar-text); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow); max-width: 280px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #16222c, #1f5f8b 120%); }
.login .card { width: min(420px, 100%); padding: 24px; }
.login .hints { margin-top: 14px; font-size: 12.5px; }
.login .hints button { all: unset; cursor: pointer; color: var(--brand); text-decoration: underline; }

/* PFD workspace */
.pfd { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.pfd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pfd-bar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 2px; }
.pfd-bar input[type="search"] { width: 190px; } .pfd-bar select { width: auto; }
.canvas-wrap { position: relative; overflow: hidden; background: var(--canvas); touch-action: none; }
.canvas-wrap svg.pfd-svg { width: 100%; height: 100%; display: block; cursor: grab; user-select: none; -webkit-user-select: none; }
.canvas-wrap svg.pfd-svg.panning { cursor: grabbing; } .canvas-wrap.editing svg.pfd-svg { cursor: default; }
.pfd-svg text { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pfd-node { cursor: pointer; } .pfd-node .body { fill: var(--node-fill); stroke: var(--node-line); stroke-width: 1.2; }
.pfd-node:hover .body, .pfd-node:focus-visible .body { stroke: var(--brand); stroke-width: 2; }
.pfd-node.selected .body { stroke: var(--brand); stroke-width: 3; } .pfd-node.dim { opacity: .22; } .pfd-node.match .body { stroke: #e0a243; stroke-width: 3; }
.pfd-node .tag { font: 700 12.5px var(--mono); fill: var(--text); } .pfd-node .nm { font-size: 11px; fill: var(--text-2); } .pfd-node .sub { font-size: 10.5px; fill: var(--text-3); }
.pfd-node.ghost .body { stroke-dasharray: 5 4; fill: transparent; } .pfd-node.ghost { opacity: .85; }
.pfd-node.editing { cursor: move; } .pfd-node.connect-src .body { stroke: var(--ok); stroke-width: 3; }
.pfd-edge path.line { fill: none; stroke-linejoin: round; } .pfd-edge path.hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.pfd-edge:hover path.line, .pfd-edge.selected path.line { filter: drop-shadow(0 0 2px var(--brand)); }
.pfd-edge.dim { opacity: .12; } .pfd-edge .lab { font-size: 10px; fill: var(--text-2); paint-order: stroke; stroke: var(--canvas); stroke-width: 3px; }
.pfd-zone rect.zbox { stroke-width: 1.5; } .pfd-zone .ztitle { font-weight: 700; font-size: 14px; fill: var(--text); cursor: pointer; } .pfd-zone .zsub { font-size: 11px; fill: var(--text-3); }
.pfd-zone .ztitle:hover { text-decoration: underline; }
.flow-anim { animation: flow 1.4s linear infinite; } @keyframes flow { to { stroke-dashoffset: -24; } }
.canvas-ctl { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.canvas-ctl .btn { background: var(--surface); box-shadow: var(--shadow-sm); }
.legend { position: absolute; left: 12px; bottom: 12px; z-index: 5; max-width: 270px; max-height: 60%; overflow: auto; padding: 8px 10px; font-size: 12px; }
.legend h3 { font-size: 12px; margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.legend .row { display: flex; align-items: center; gap: 7px; padding: 2px 0; cursor: pointer; } .legend .row.off { opacity: .4; }
.legend svg { flex: none; }
.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: var(--shadow); }
.canvas-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 6px 14px; font-weight: 600; font-size: 13px; }
.side-panel { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(460px, calc(100% - 20px)); z-index: 20; display: flex; flex-direction: column; animation: panel-in .24s cubic-bezier(.2,.9,.3,1.15); border-radius: 18px; overflow: hidden; }
@keyframes panel-in { from { opacity: 0; transform: translateX(26px) scale(.96); } }
.side-panel > header { padding: 14px 16px 8px; display: flex; gap: 10px; align-items: flex-start; }
.side-panel > header h2 { font-size: 17px; } .side-panel > .tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 8px 10px; cursor: pointer; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; min-height: 38px; }
.tabs button[aria-selected="true"] { color: var(--brand-strong); border-bottom-color: var(--brand); }
.side-panel > .pbody { flex: 1; overflow: auto; padding: 12px 16px 16px; } .side-panel > footer { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 5px 12px; margin: 0; } .dl dt { color: var(--text-3); font-size: 12.5px; } .dl dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sec-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; margin: 14px 0 6px; }
.sec-title:first-child { margin-top: 0; }
.list { list-style: none; margin: 0; padding: 0; } .list li { padding: 8px 0; border-bottom: 1px solid var(--line); } .list li:last-child { border-bottom: 0; }
.health-bar { height: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; } .health-bar > i { display: block; height: 100%; }
@media (max-width: 760px) { .side-panel { left: 10px; width: auto; } .pfd-bar input[type="search"] { width: 130px; } }

/* Charts */
.chart { position: relative; width: 100%; } .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 11px; fill: var(--text-3); font-family: system-ui, sans-serif; } .chart .gridline { stroke: var(--line); stroke-width: 1; } .chart .axis { stroke: var(--line-strong); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 6px; color: var(--text-2); } .chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 8px; align-items: center; padding: 4px 0; font-size: 12.5px; cursor: pointer; } .bar-row:hover { background: var(--surface-2); }
.bar-row .track { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; display: flex; } .bar-row .track i { display: block; height: 100%; }
.bar-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 10px 14px; margin-bottom: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; } .checks label { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; cursor: pointer; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 120px; } .kcol h3 { display: flex; justify-content: space-between; padding: 2px 4px 8px; text-transform: capitalize; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm); } .kcard:hover { border-color: var(--brand); }
.kcard h4 { font-size: 13px; margin-bottom: 5px; } .kcard .meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.change-row { display: grid; grid-template-columns: 1.3fr .9fr 1fr .9fr .8fr auto; gap: 6px; align-items: end; margin-bottom: 6px; } @media (max-width: 760px) { .change-row { grid-template-columns: 1fr 1fr; } }
.tab-strip { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; } .tab-strip button { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; } .tab-strip button[aria-selected="true"] { color: var(--brand-strong); border-bottom-color: var(--brand); }
.diff-old { background: var(--crit-soft); } .diff-new { background: var(--ok-soft); }
pre.json { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: 220px; overflow: auto; font: 12px/1.4 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 0; }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--text-2); } .dropzone.over { border-color: var(--brand); background: var(--brand-soft); }

/* Filters: compact date inputs and aligned toolbars */
.filters input[type="date"] { width: 148px; } .filters select { width: auto; min-width: 150px; max-width: 260px; } .filters input[type="search"] { width: 200px; }
.filters .field .toolbar { flex-wrap: nowrap; }
