/* Registru PFA — tokens și componente după docs/design-spec.md */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f1; --surface: #fcfcfb; --surface-2: #f6f6f3; --surface-3: #ededea; --sidebar: #f4f4f1;
  --border: #e7e6e1; --border-strong: #d6d5cf;
  --ink: #16171a; --ink-2: #4b4d53; --ink-3: #6e7178; --ink-4: #a3a5aa; --ink-inverse: #ffffff;
  --focus: #2a78d6; --overlay: rgba(22, 23, 26, .32);
  --c-bank: #2a78d6; --c-bank-soft: #9cc3f0; --c-netopia: #eb6834; --c-pending: #d6d5cf;
  --c-cat-1: #eb6834; --c-cat-2: #4a3aa7; --c-cat-3: #1baf7a; --c-cat-4: #eda100; --c-cat-5: #e87ba4;
  --c-invoiced: #16171a;
  --ok-fg: #13703f; --ok-bg: #e8f5ed; --ok-bd: #bfe3cd;
  --info-fg: #1f5fae; --info-bg: #eaf2fc; --info-bd: #c5dbf5;
  --warn-fg: #8a5300; --warn-bg: #fdf3df; --warn-bd: #f2d9a6;
  --crit-fg: #b4232a; --crit-bg: #fdecec; --crit-bd: #f5c4c4;
  --mute-fg: #55575d; --mute-bg: #efefec; --mute-bd: #dcdcd7;
  --shadow-1: 0 1px 2px rgba(16, 18, 23, .05);
  --shadow-2: 0 4px 12px -2px rgba(16, 18, 23, .08), 0 2px 4px rgba(16, 18, 23, .04);
  --shadow-3: 0 24px 48px -12px rgba(16, 18, 23, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28; --sidebar: #111110;
    --border: #2c2c2a; --border-strong: #3b3b38;
    --ink: #f3f3f1; --ink-2: #c3c2b7; --ink-3: #93928a; --ink-4: #5c5c57; --ink-inverse: #111110;
    --focus: #3987e5; --overlay: rgba(0, 0, 0, .55);
    --c-bank: #3987e5; --c-bank-soft: #1f4f8c; --c-netopia: #d95926; --c-pending: #45453f;
    --c-cat-1: #d95926; --c-cat-2: #9085e9; --c-cat-3: #199e70; --c-cat-4: #c98500; --c-cat-5: #d55181;
    --c-invoiced: #f3f3f1;
    --ok-fg: #5fd08f; --ok-bg: #15281d; --ok-bd: #24452f;
    --info-fg: #7fb4f2; --info-bg: #14233a; --info-bd: #20395c;
    --warn-fg: #f0b74e; --warn-bg: #2e2412; --warn-bd: #4a391a;
    --crit-fg: #f28a8a; --crit-bg: #331718; --crit-bd: #552527;
    --mute-fg: #b3b2aa; --mute-bg: #262624; --mute-bd: #363633;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .5); --shadow-3: 0 24px 48px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1a1a19; --surface-2: #212120; --surface-3: #2a2a28; --sidebar: #111110;
  --border: #2c2c2a; --border-strong: #3b3b38;
  --ink: #f3f3f1; --ink-2: #c3c2b7; --ink-3: #93928a; --ink-4: #5c5c57; --ink-inverse: #111110;
  --focus: #3987e5; --overlay: rgba(0, 0, 0, .55);
  --c-bank: #3987e5; --c-bank-soft: #1f4f8c; --c-netopia: #d95926; --c-pending: #45453f;
  --c-cat-1: #d95926; --c-cat-2: #9085e9; --c-cat-3: #199e70; --c-cat-4: #c98500; --c-cat-5: #d55181;
  --c-invoiced: #f3f3f1;
  --ok-fg: #5fd08f; --ok-bg: #15281d; --ok-bd: #24452f;
  --info-fg: #7fb4f2; --info-bg: #14233a; --info-bd: #20395c;
  --warn-fg: #f0b74e; --warn-bg: #2e2412; --warn-bd: #4a391a;
  --crit-fg: #f28a8a; --crit-bg: #331718; --crit-bd: #552527;
  --mute-fg: #b3b2aa; --mute-bg: #262624; --mute-bd: #363633;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 12px rgba(0, 0, 0, .5); --shadow-3: 0 24px 48px rgba(0, 0, 0, .6);
}
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  --sidebar-w: 232px; --drawer-w: 520px; --fbar-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-width: 1100px; background: var(--bg); color: var(--ink);
  font: 400 14px/20px var(--font-sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 14px; height: 14px; }
svg.i.xs { width: 12px; height: 12px; }
svg.i.lg { width: 24px; height: 24px; }
svg.i.xl { width: 32px; height: 32px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11", "ss01"; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.dim { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12.5px; line-height: 18px; }
.label { font-size: 11.5px; line-height: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none; overflow-y: auto;
  background: var(--sidebar); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand .mk { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--ink); color: var(--ink-inverse); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.brand b { display: block; font-weight: 500; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-md);
  color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px; background: var(--ink); border-radius: 2px; }
.nav .cnt { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.nav .cnt.crit { display: inline-flex; align-items: center; gap: 3px; background: var(--crit-bg); color: var(--crit-fg); border-radius: var(--r-full); padding: 0 7px; font-weight: 600; }
.sep { height: 1px; background: var(--border); margin: 10px 8px; }
.fresh { margin-top: auto; padding: 12px 8px 8px; display: grid; gap: 6px; text-decoration: none; border-radius: var(--r-md); }
.fresh:hover { background: var(--surface-3); }
.fresh .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.fresh .row span:last-child { margin-left: auto; color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ok { background: var(--ok-fg); }
.dot.warn { background: linear-gradient(90deg, var(--warn-fg) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--warn-fg); }
.dot.crit { box-shadow: inset 0 0 0 1.5px var(--crit-fg); }
.themesel { padding: 8px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin-right .18s var(--ease); }
body.split .main { margin-right: var(--drawer-w); }
.phead { display: flex; align-items: center; gap: 16px; padding: 20px 32px 12px; min-height: 76px; }
.phead h1 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.015em; }
.phead .sub { color: var(--ink-3); font-size: 12.5px; }
.phead .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.fbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .12s;
}
.fbar.stuck { border-bottom-color: var(--border); }
.fbar:empty { display: none; }
.fbar .grow { flex: 1; }
.content { padding: 8px 32px 64px; }
.content.narrow > * { max-width: 1440px; }
@media (min-width: 1600px) { .phead, .fbar { padding-left: 40px; padding-right: 40px; } .content { padding-left: 40px; padding-right: 40px; } }

/* ---------- Butoane, inputuri ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid transparent; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, box-shadow .12s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--ink-inverse); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--surface)); }
.btn.secondary { background: var(--surface); border-color: var(--border-strong); color: var(--ink); box-shadow: var(--shadow-1); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--crit-fg); border-color: var(--crit-bd); }
.btn.lg { height: 36px; }
.ibtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--r-md); border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.ibtn:hover { background: var(--surface-3); color: var(--ink); }
.ibtn.sm { width: 28px; height: 28px; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .7s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }
.spinning { animation: sp .9s linear infinite; }

.input, select.input, textarea.input {
  height: 36px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border-strong);
  padding: 0 12px; color: var(--ink); font: inherit; width: 100%;
}
textarea.input { height: auto; padding: 8px 10px; font: 12px/1.5 var(--font-mono); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input::placeholder { color: var(--ink-3); }
select.input { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e7178' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search { position: relative; width: 320px; }
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--ink-3); }
.search .input { padding-left: 34px; padding-right: 32px; }
.search .clr { position: absolute; right: 4px; top: 4px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .err { color: var(--crit-fg); font-size: 12.5px; display: flex; gap: 4px; align-items: center; }
.suffix { position: relative; }
.suffix .input { padding-right: 40px; }
.suffix::after { content: "lei"; position: absolute; right: 12px; top: 8px; color: var(--ink-3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 2px; gap: 2px; }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-full);
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip.on { background: var(--surface-3); color: var(--ink); }
.chip .x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; }
.chip .x:hover { background: var(--border-strong); }
.clear { font-size: 13px; color: var(--ink-2); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }

.stabs { display: flex; gap: 20px; margin: 4px 0 12px; }
.stabs button { border: 0; background: none; padding: 4px 0 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; }
.stabs button:hover { color: var(--ink); }
.stabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.stabs .n { margin-left: 6px; font-weight: 400; }

/* ---------- Badge-uri ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; white-space: nowrap; border: 1px solid; }
.badge.ok { color: var(--ok-fg); background: var(--ok-bg); border-color: var(--ok-bd); }
.badge.info { color: var(--info-fg); background: var(--info-bg); border-color: var(--info-bd); }
.badge.warn { color: var(--warn-fg); background: var(--warn-bg); border-color: var(--warn-bd); }
.badge.crit { color: var(--crit-fg); background: var(--crit-bg); border-color: var(--crit-bd); }
.badge.mute { color: var(--mute-fg); background: var(--mute-bg); border-color: var(--mute-bd); }
.badge.quiet { background: none; border-color: transparent; padding: 0; }
.badge.big { height: 28px; font-size: 13.5px; padding: 0 10px; }
.cdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cat { display: inline-flex; align-items: center; gap: 8px; }
.marks { display: inline-flex; gap: 6px; color: var(--ink-3); align-items: center; }
.marks .m-crit { color: var(--crit-fg); }
.marks .m-sb { font-size: 11px; font-weight: 600; color: var(--crit-fg); border: 1px solid var(--crit-bd); border-radius: 4px; padding: 0 3px; line-height: 16px; }

/* ---------- Carduri, KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 20px; }
.card h2, .h2 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -.005em; }
.chead { display: flex; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 12px; }
.chead .right { margin-left: auto; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.section { margin-top: 32px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 20px; text-decoration: none; color: inherit; position: relative; min-height: 132px; }
a.kpi { transition: box-shadow .12s, transform .12s; }
a.kpi:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
a.kpi .go { position: absolute; top: 18px; right: 16px; opacity: 0; color: var(--ink-3); transition: opacity .12s; }
a.kpi:hover .go { opacity: 1; }
.kv { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; }
.unit { font-size: .5em; font-weight: 500; color: var(--ink-3); margin-left: .2em; letter-spacing: 0; }
.approx { color: var(--ink-3); font-weight: 500; }
.ksub { font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.kspark { margin-top: auto; padding-top: 6px; }
.kv.warn { color: var(--warn-fg); }

/* ---------- Tabele ---------- */
.tcard { container-type: inline-size; overflow: clip; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
/* Doar capul tabelului principal e lipit sus; tabelul din componența unui virament are capul lui, static. */
.t > thead > tr > th {
  position: sticky; top: var(--fbar-h); z-index: 2; background: var(--surface-2); height: 36px; padding: 0 12px;
  text-align: left; font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.t thead th.sortable { cursor: pointer; }
.t thead th.sortable:hover { color: var(--ink); }
.t thead th .arr { display: inline-block; margin-left: 4px; }
.t th.r, .t td.r { text-align: right; }
.t td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t th:first-child, .t td:first-child { padding-left: 16px; }
.t th:last-child, .t td:last-child { padding-right: 16px; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:hover td { background: var(--surface-2); }
.t tbody tr.sel td { background: var(--surface-3); }
.t tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.t tbody tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.t .l1 { font-weight: 500; }
.t .l2 { font-size: 12.5px; line-height: 16px; color: var(--ink-3); margin-top: 1px; }
.t .amt { font-weight: 500; }
.t .amt.strong { font-weight: 600; }
.t tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 1px solid var(--border-strong); border-bottom: 0; font-weight: 500; height: 44px; }
.t tr.muted .l1 { color: var(--ink-2); font-weight: 400; }
.t tr.muted .amt { color: var(--ink-2); }
.t .chev { color: var(--ink-4); width: 32px; }
.t tr:hover .chev { color: var(--ink); }
.t td.cb, .t th.cb { width: 40px; }
.t tr.sub > td { padding: 0; background: var(--surface-2); }
.subt { margin: 4px 16px 12px 48px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.subt table { width: 100%; border-collapse: collapse; }
.subt td { white-space: nowrap; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; background: var(--surface); }
.subt tr:last-child td { border-bottom: 0; }
.subt th { position: static; height: auto; text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.subt th.r, .subt td.r { text-align: right; }
.subt tr.tot td { font-weight: 600; background: var(--surface-2); }
.idlink { font-family: var(--font-mono); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; background: none; border: 0; padding: 0; color: var(--ink); }
.idlink:hover { text-decoration: underline; text-underline-offset: 3px; }
.comp { display: inline-flex; gap: 1px; width: 80px; height: 8px; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 10px; }
.comp i { display: block; height: 100%; }
.hatch { background: repeating-linear-gradient(45deg, var(--ink-3) 0 1px, var(--c-pending) 1px 4px); }
.t tr.rule-row > td { background: var(--surface-2); }
.t tr.groupr td { background: var(--bg); font-size: 12.5px; color: var(--ink-2); font-weight: 500; height: 34px; }
.t tr.groupr:hover td { background: var(--bg); }
@container (max-width: 1099px) { .c-lg { display: none; } }
@container (max-width: 1399px) { .c-xl { display: none; } }
@container (min-width: 1100px) { .c-nlg, .c-lg-hide { display: none; } }

.bulk { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ink); color: var(--ink-inverse); }
.bulk .btn.primary { background: var(--ink-inverse); color: var(--ink); }
.bulk .btn.ghost { color: var(--ink-inverse); }
.bulk .btn.ghost:hover { background: color-mix(in srgb, var(--ink-inverse) 14%, transparent); }

/* ---------- Drawer, overlay, popover, toast, tooltip ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer-w); z-index: 31; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: din .18s var(--ease);
}
body.split .drawer { box-shadow: none; z-index: 6; }
.drawer.w420 { width: 420px; }
@keyframes din { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.dhead { display: flex; align-items: center; gap: 4px; height: 56px; flex: none; padding: 0 12px 0 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dhead .t { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); margin-right: auto; }
.dhead .tt { font-weight: 600; margin-right: auto; font-size: 15px; }
.dbody { flex: 1; overflow-y: auto; }
.dsec { padding: 20px; border-bottom: 1px solid var(--border); }
.dsec:last-child { border-bottom: 0; }
.dfoot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); flex: none; }
.dname { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.lines { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.lines .tot { border-top: 1px solid var(--border-strong); padding-top: 8px; font-size: 16px; font-weight: 600; }
.journey { list-style: none; margin: 12px 0 0; padding: 0; }
.journey li { position: relative; padding: 0 0 18px 32px; }
.journey li::before { content: ""; position: absolute; left: 10px; top: 14px; bottom: -4px; width: 2px; background: var(--border-strong); }
.journey li:last-child::before { display: none; }
.journey li.to-todo::before { background: repeating-linear-gradient(180deg, var(--border-strong) 0 4px, transparent 4px 8px); }
.journey .nd { position: absolute; left: 6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; }
.journey .nd.todo { background: var(--surface); border: 1.5px dashed var(--ink-3); }
.journey .nd.ic { left: 3px; top: 2px; width: 16px; height: 16px; background: var(--surface); display: grid; place-items: center; color: var(--ink-2); }
.journey .nd.ic.warn { color: var(--warn-fg); }
.journey .when { font-size: 12.5px; color: var(--ink-3); display: inline-block; width: 56px; }
.journey .what { font-weight: 500; }
.journey .det { font-size: 12.5px; color: var(--ink-2); margin-left: 56px; }
.journey li.todo .what { color: var(--ink-3); font-weight: 400; }
.kv2 { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; }
.kv2 dt { color: var(--ink-3); }
.kv2 dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid; font-size: 13.5px; }
.alert > svg { margin-top: 2px; }
.alert.crit { background: var(--crit-bg); border-color: var(--crit-bd); } .alert.crit > svg { color: var(--crit-fg); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-bd); } .alert.warn > svg { color: var(--warn-fg); }
.alert.info { background: var(--info-bg); border-color: var(--info-bd); } .alert.info > svg { color: var(--info-fg); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-bd); } .alert.ok > svg { color: var(--ok-fg); }
.alert .close { margin-left: auto; margin-top: -6px; margin-right: -6px; }

.popover { position: fixed; z-index: 40; min-width: 260px; max-width: 360px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); padding: 8px; }
.popover .ph { padding: 6px 8px 8px; font-weight: 600; }
.popover .opt { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; width: 100%; border: 0; background: none; text-align: left; }
.popover .opt:hover { background: var(--surface-2); }
.popover .opt .n { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.popover .opt.zero { color: var(--ink-3); }
.popover .opt.on { font-weight: 600; }
.popover .opt input { accent-color: var(--ink); margin: 0; }
.popover .hr { height: 1px; background: var(--border); margin: 6px 0; }
.popover .note { font-size: 12px; color: var(--ink-3); padding: 4px 8px; }
.popover .pfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 8px 2px; }
.popover .form { padding: 6px 8px; gap: 12px; }
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 8px; }
.mgrid button { height: 30px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; cursor: pointer; font-size: 13px; }
.mgrid button:hover:not([disabled]) { background: var(--surface-2); }
.mgrid button.on { background: var(--ink); color: var(--ink-inverse); border-color: var(--ink); }
.mgrid button[disabled] { color: var(--ink-4); cursor: default; }
.prange { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; padding: 4px 8px 4px; }
.prange .input { height: 32px; padding: 0 8px; min-width: 0; }
.prange span { color: var(--ink-3); }

.tip { position: fixed; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .06s; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-2); border-radius: var(--r-md); padding: 10px 12px; font-size: 12.5px; line-height: 18px; min-width: 180px; max-width: 300px; }
.tip.on { opacity: 1; }
.tip b { display: block; margin-bottom: 4px; font-size: 13px; }
.tip .row { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.tip .row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tip .sw.ol { border: 1.5px solid var(--c-invoiced); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 400px; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: var(--ink-inverse); box-shadow: var(--shadow-3); font-size: 14px; animation: din .18s var(--ease); }
.toast .ok { color: #5fd08f; } .toast .crit { color: #f28a8a; }
.toast button.lnk { color: var(--ink-inverse); text-decoration: underline; background: none; border: 0; cursor: pointer; padding: 0; margin-left: 8px; }

.dropall { position: fixed; inset: 0; z-index: 70; background: var(--overlay); padding: 16px; }
.dropall > div { width: 100%; height: 100%; border: 2px dashed var(--focus); border-radius: var(--r-xl); display: grid; place-content: center; text-align: center; color: #fff; font-size: 24px; font-weight: 600; gap: 8px; pointer-events: none; }
.dropall span { font-size: 14px; font-weight: 400; opacity: .85; }

/* ---------- Panou ---------- */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 8px 32px; padding: 24px; border-radius: var(--r-xl); }
.hero .big { font-size: 56px; line-height: 60px; font-weight: 600; letter-spacing: -.03em; margin: 6px 0 4px; }
.hero .big .unit { font-size: 24px; }
.verdict { border-radius: var(--r-lg); padding: 18px; border: 1px solid; display: flex; flex-direction: column; gap: 4px; align-self: start; }
.verdict.ok { background: var(--ok-bg); border-color: var(--ok-bd); }
.verdict.crit { background: var(--crit-bg); border-color: var(--crit-bd); }
.verdict .vt { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.verdict.ok .vt svg { color: var(--ok-fg); } .verdict.crit .vt svg { color: var(--crit-fg); }
.verdict .linkbtn { align-self: flex-start; margin-top: 6px; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); font-size: 13px; }
.linkbtn:hover { text-decoration-color: var(--ink); }
.flowwrap { grid-column: 1 / -1; margin-top: 16px; }
.flow { width: 100%; height: auto; display: block; overflow: visible; }
.flow .band { transition: opacity .15s; cursor: pointer; outline: none; }
.flow.dim .band { opacity: .12 !important; }
.flow.dim .band.on { opacity: .9 !important; }
.flow .lb { font-size: 12.5px; fill: var(--ink-2); }
.flow .lv { font-size: 14px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.flow .nl { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; fill: var(--ink-3); }
.flow .guide { stroke: var(--ink-4); stroke-width: 1; }
.flow .grow { animation: grow .7s var(--ease) both; }
@keyframes grow { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl { stroke: var(--border); }
.chart .ax { fill: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .ax.fut { fill: var(--ink-4); }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hov { fill: var(--surface-2); opacity: 0; }
.chart g.col:hover .hov, .chart g.col:focus-within .hov { opacity: 1; }
.chart.dim .seg { opacity: .35; }
.chart.dim .seg.on { opacity: 1; }
.chart .bar, .chart .seg { transition: height .24s var(--ease), y .24s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend .sw.ol { border: 1.5px solid var(--c-invoiced); }
.hb { display: grid; gap: 2px; }
.hb a { display: grid; grid-template-columns: 176px 1fr; gap: 12px; align-items: center; height: 28px; text-decoration: none; color: inherit; border-radius: 6px; padding: 0 6px; margin: 0 -6px; }
.hb a:hover { background: var(--surface-2); }
.hb .nm { display: flex; align-items: center; gap: 8px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hb .bar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hb .bar i { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 3px; }
.hb .bar span { font-size: 12.5px; white-space: nowrap; }
.mini-rows { display: grid; gap: 10px; }
.mini-rows .r { display: grid; grid-template-columns: 1fr 110px 90px; gap: 12px; font-size: 14px; }
.mini-rows .r .d { color: var(--crit-fg); font-weight: 600; text-align: right; }
.vhead { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 14px; }
.vhead.crit svg { color: var(--crit-fg); } .vhead.ok svg { color: var(--ok-fg); }
.plist { display: grid; gap: 12px; }
.pitem { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.pitem .idchips { margin-top: 4px; }
.wf { display: grid; grid-template-columns: 120px 1fr auto; gap: 10px 14px; align-items: center; font-size: 14px; }
.wf .wb { height: 12px; position: relative; }
.wf .wb i { position: absolute; top: 0; height: 100%; border-radius: 3px; }
.wf .tot { font-weight: 600; }

/* ---------- Probleme ---------- */
.pcard { padding: 18px 20px; display: grid; gap: 8px; }
.pcard.crit { border-color: var(--crit-bd); }
.pcard.atentie { border-color: var(--warn-bd); }
.pcard .ph { display: flex; align-items: center; gap: 8px; }
.pcard .ph .label { color: inherit; }
.pcard.crit .ph { color: var(--crit-fg); } .pcard.atentie .ph { color: var(--warn-fg); }
.pcard h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; gap: 12px; }
.pcard h3 .amt { margin-left: auto; font-size: 16px; }
.pcard p { margin: 0; color: var(--ink-2); max-width: 90ch; }
.idchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.idchip { font-family: var(--font-mono); font-size: 12.5px; height: 26px; padding: 0 8px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.idchip:hover { background: var(--surface-2); }
.infolist .it { display: flex; gap: 10px; align-items: baseline; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.infolist .it:last-child { border-bottom: 0; }
details.card > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { border-bottom: 1px solid var(--border); }

/* ---------- Import ---------- */
.dz { height: 160px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); display: grid; place-content: center; justify-items: center; text-align: center; gap: 6px; cursor: pointer; transition: border-color .12s, background .12s; }
.dz:hover, .dz.over { border-color: var(--focus); border-style: solid; background: var(--info-bg); }
.dz .ic { color: var(--ink-2); transition: transform .12s; }
.dz:hover .ic, .dz.over .ic { transform: translateY(-2px); }
.dz b { font-size: 15px; }
.src { display: flex; flex-direction: column; gap: 8px; }
.src .st { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.src p { margin: 0; color: var(--ink-2); font-size: 13px; }
.src .acts { margin-top: auto; display: flex; gap: 12px; align-items: center; padding-top: 6px; }
.hist .it { display: grid; grid-template-columns: 110px 80px minmax(0, 280px) 130px 1fr; gap: 12px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.hist .it:last-child { border-bottom: 0; }
.hist .fn, .res .fn { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.res .it { display: grid; grid-template-columns: minmax(0, 340px) 140px 1fr; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.empty .eic { width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-4); margin-bottom: 4px; }
.empty.good .eic { color: var(--ok-fg); background: var(--ok-bg); }
.empty b { font-size: 15px; }
.empty p { margin: 0; color: var(--ink-2); font-size: 13.5px; max-width: 44ch; }
.empty .chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.callout { margin-top: 16px; }
.np { display: grid; gap: 12px; }
.content > .np { margin-bottom: 16px; }
.np .chead { margin-bottom: 0; }
.np .acts { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.np .alert .acts { margin-top: 10px; }
.npsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.npsteps li { display: grid; grid-template-columns: 20px auto 1fr; gap: 8px; align-items: center; }
.npsteps li .mk { display: grid; place-items: center; width: 20px; height: 20px; }
.npsteps li.done .mk { color: var(--ok-fg); }
.npsteps li.todo { color: var(--ink-3); }
.npsteps li.todo .mk::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.npsteps li.now { font-weight: 600; }
.npsteps .progress { grid-column: 2 / -1; height: 6px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok-fg); }
.form { display: grid; gap: 16px; padding: 20px; }
.rform { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 16px 16px 16px; }
.rform .field { min-width: 200px; }
.rform .field.w { min-width: 320px; flex: 1; }
.rform .note { flex-basis: 100%; font-size: 12.5px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.busybar { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 80; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(90deg, transparent, var(--focus), transparent); background-size: 40% 100%; background-repeat: no-repeat; }
body[data-busy] .busybar { opacity: 1; animation: bb 1.1s linear infinite; }
@keyframes bb { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Tabelul furnizor × lună nu e lipit sus sau jos: stă deasupra tabelului principal. */
.mx tfoot td { position: static; }
