/* The ZBRIX kit (CONTRACTS-P2 5.4): ZB:web/public/console.html:20-93 ported
   to the console. Linked from index.html after console.css; modules have no
   manifest "styles" for it, so /bff/nav stays byte-identical with ZBRIX off.

   Every class is prefixed .zb- (module-only classes are .m-zoffers-*).
   console.html's tokens map to the console's (C1 5.8):
     --bg -> --bg            --panel -> --ink-2      --ink -> --ink-3
     --muted -> --slate      --line -> --line        --accent -> --brass
     --accent-soft -> --accent-soft                  --good -> --ok
     --warn -> --warn        --bad -> --bad          --bar -> --line-strong
   The dark set of console.html (13-19) is dropped (Q11); the font is the
   console kit's. The helpers of ds/zb.js build exactly this markup. */

/* An optional root for a ZBRIX view: the console's view padding, and
   console.html's body size and line height (21-23). */
.zb-view { padding:24px 28px 48px; max-width:1200px; font-size:14px; line-height:1.45; color:var(--ink-3); }
.zb-view.on { display:block; }

/* Controls inside ZBRIX views (console.html:30-33, 45-47, 54). :where() keeps
   these at element weight, so a kit or console class on the control wins. */
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) :is(select, button) {
  font:inherit; font-size:13.5px; color:var(--ink-3); background:var(--ink-2); border:1px solid var(--line);
  border-radius:8px; padding:6px 10px;
}
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) button { cursor:pointer; }
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) button:hover:not(:disabled) { border-color:var(--brass); }
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) button:disabled { opacity:.6; cursor:not-allowed; }
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) a { color:var(--brass); }
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) :is(input[type="text"], input[type="number"]) {
  font:inherit; font-size:13.5px; color:var(--ink-3); background:var(--ink-2); border:1px solid var(--line);
  border-radius:6px; padding:5px 8px; width:100%; box-sizing:border-box;
}
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) :is(input[type="text"], input[type="number"], select):focus {
  outline:none; border-color:var(--brass);
}
:where(.zb-view, .zb-kpis, .zb-grid, .zb-panel, .zb-notice) input:disabled { opacity:.6; }
:where(.zb-panel, .zb-notice) code {
  font:12.5px var(--mono); background:var(--accent-soft); padding:1px 5px; border-radius:4px;
}
.zb-table td button { padding:3px 10px; }

/* A select for a module toolbar (the ZOffers period, 5.5). */
.zb-select { font:inherit; font-size:12.5px; font-weight:600; color:var(--mist); background:var(--ink-2); border:1.5px solid var(--line); border-radius:10px; padding:7px 10px; }
.zb-select:focus { outline:none; border-color:var(--brass); }
.zb-field-label { font-size:12.5px; color:var(--slate); }

/* Badges (34-35, 43-44) */
.zb-badge { display:inline-block; font-size:12px; padding:1px 8px; border-radius:999px; background:var(--accent-soft); color:var(--brass); white-space:nowrap; }
.zb-badge.warn { background:transparent; color:var(--warn); border:1px solid var(--warn); }
.zb-badge.inherited { background:transparent; color:var(--slate); border:1px solid var(--line); }

/* Notices (36-42); .proposal is the inline border colour of console.html:479 */
.zb-notice { background:var(--ink-2); border:1px solid var(--line); border-left:3px solid var(--warn); border-radius:8px; padding:8px 12px; color:var(--slate); margin-bottom:16px; }
.zb-notice.alert { border-left-color:var(--bad); color:var(--ink-3); }
.zb-notice.alert strong { color:var(--bad); }
.zb-notice.masq { border-left-color:var(--brass); color:var(--ink-3); }
.zb-notice.masq strong { color:var(--brass); }
.zb-notice.masq button { margin-left:10px; padding:3px 9px; }
.zb-notice.proposal { border-left-color:var(--brass); }

/* The guardrail editor (48-53) */
.zb-gr-row { display:grid; grid-template-columns:1fr 150px 118px 64px; gap:10px; align-items:center; padding:7px 0; border-bottom:1px solid var(--line); }
.zb-gr-row:last-child { border-bottom:0; }
.zb-gr-row label { font-size:13.5px; }
.zb-gr-actions { margin-top:12px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.zb-gr-actions input[type="number"] { width:110px; }
@media (max-width:680px) { .zb-gr-row { grid-template-columns:1fr 1fr; } .zb-gr-row label { grid-column:1 / -1; } }

/* KPIs (55-60) */
.zb-kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin-bottom:16px; }
.zb-kpi, .zb-panel { background:var(--ink-2); border:1px solid var(--line); border-radius:10px; }
.zb-kpi { padding:14px 16px; }
.zb-kpi-label { color:var(--slate); font-size:12.5px; }
.zb-kpi-value { font-size:26px; font-weight:600; font-variant-numeric:tabular-nums; margin-top:2px; color:var(--ink-3); }
.zb-kpi-sub { color:var(--slate); font-size:12.5px; }

/* Grid and panels (61-66) */
.zb-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(320px, 1fr)); gap:12px; margin-bottom:16px; }
.zb-panel { padding:14px 16px; min-width:0; color:var(--ink-3); }
/* Panels outside a grid are separated as the console's panels are; inside a
   grid the grid's gap does it. */
.zb-panel { margin-bottom:16px; }
.zb-grid > .zb-panel { margin-bottom:0; }
.zb-panel h2 { font-size:14px; font-weight:800; letter-spacing:-.01em; margin:0 0 10px; color:var(--ink-3); }
.zb-section-title { font-size:15px; font-weight:800; letter-spacing:-.01em; margin:8px 0 10px; color:var(--ink-3); }
.zb-hint { color:var(--slate); font-size:12.5px; margin:8px 0 0; }
.zb-scroll { overflow-x:auto; }

/* Tables (67-73). The kit's tables override the console's global table rules. */
.zb-table { width:100%; border-collapse:collapse; }
.zb-table.wide { min-width:820px; }
.zb-table th, .zb-table td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; font-size:inherit; }
.zb-table th { font-size:12px; font-weight:600; color:var(--slate); background:transparent; text-transform:none; letter-spacing:normal; }
.zb-table td.num, .zb-table th.num { text-align:right; font-variant-numeric:tabular-nums; }
.zb-table tr:last-child td { border-bottom:0; }
.zb-split { display:flex; flex-wrap:wrap; justify-content:space-between; gap:2px 12px; }

/* Text (74-75) */
.zb-small { font-size:12.5px; }

/* Outcomes (78-81) */
.zb-out { font-weight:600; white-space:nowrap; }
.zb-out.no_offer { color:var(--slate); font-weight:500; }
.zb-out.cross_sell { color:var(--brass); }
.zb-out.threshold_coupon, .zb-out.session_coupon { color:var(--ok); }

/* Bar lists (82-88) */
.zb-bars { list-style:none; margin:0; padding:0; }
.zb-bars li { margin-bottom:8px; }
.zb-bar-row { display:flex; justify-content:space-between; gap:12px; }
.zb-track { height:6px; background:var(--line); border-radius:3px; margin-top:4px; overflow:hidden; }
.zb-fill { height:100%; background:var(--line-strong); border-radius:3px; }
.zb-fill.accent { background:var(--brass); }
.zb-fill.over { background:var(--bad); }

/* Definition lists (89-91) */
.zb-dl { display:grid; grid-template-columns:auto 1fr; gap:6px 14px; margin:12px 0 0; }
.zb-dl dt { color:var(--slate); }
.zb-dl dd { margin:0; font-variant-numeric:tabular-nums; }

/* Empty and error lines (92-93) */
.zb-empty { color:var(--slate); padding:8px 0; margin:0; }
.zb-error { color:var(--bad); }
