:root {
  --bg: #f5f6fa; --panel: #ffffff; --panel-2: #fafbfd; --line: #e6e8ef; --line-strong: #d7dae4;
  --text: #171a26; --muted: #6b7185; --faint: #9aa0b2;
  --accent: #0d7d70; --accent-ink: #ffffff; --accent-soft: #e3f4f1; --accent-line: #a8dcd4;
  --ok: #138a4b; --ok-soft: #e3f6ec; --warn: #b5650a; --warn-soft: #fdf0dc; --bad: #c8312b; --bad-soft: #fde7e6;
  --side: #ffffff; --side-text: #3f4558; --side-hover: #f2f3f8; --side-active: #e3f4f1;
  --row-hover: #f6f7fb; --input: #ffffff; --shadow: 0 1px 2px rgba(23,26,38,.04), 0 2px 8px rgba(23,26,38,.04);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117; --panel: #171a22; --panel-2: #1b1e27; --line: #262a35; --line-strong: #323746;
    --text: #e7e9f0; --muted: #9196a8; --faint: #6b7083;
    --accent: #2bb3a3; --accent-ink: #0f1117; --accent-soft: #12302c; --accent-line: #1f5a52;
    --ok: #45c47f; --ok-soft: #15301f; --warn: #f0a53c; --warn-soft: #33270f; --bad: #f2716a; --bad-soft: #3a1b1a;
    --side: #12141b; --side-text: #b6bacb; --side-hover: #1b1e28; --side-active: #12302c;
    --row-hover: #1d212b; --input: #12141b; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --panel: #171a22; --panel-2: #1b1e27; --line: #262a35; --line-strong: #323746;
  --text: #e7e9f0; --muted: #9196a8; --faint: #6b7083;
  --accent: #2bb3a3; --accent-ink: #0f1117; --accent-soft: #12302c; --accent-line: #1f5a52;
  --ok: #45c47f; --ok-soft: #15301f; --warn: #f0a53c; --warn-soft: #33270f; --bad: #f2716a; --bad-soft: #3a1b1a;
  --side: #12141b; --side-text: #b6bacb; --side-hover: #1b1e28; --side-active: #12302c;
  --row-hover: #1d212b; --input: #12141b; --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

/* ---------- sidebar layout ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: width .18s ease, transform .2s ease; }
.content { margin-left: 248px; min-height: 100vh; transition: margin .18s ease; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 12px 18px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo .mark svg { width: 30px; height: 30px; display: block; }
.logo .mark rect { fill: #0e3b34; }
.logo .mark circle, .logo .mark polyline { stroke-linecap: round; stroke-linejoin: round; fill: none; }
.logo .mark circle { stroke: #e6f2ef; stroke-width: 7; }
.logo .mark polyline { stroke: #2bb3a3; stroke-width: 5.5; }
:root[data-theme="dark"] .logo .mark rect { stroke: #1f5a52; stroke-width: 3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .mark rect { stroke: #1f5a52; stroke-width: 3; } }
.word { font-size: 15.5px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.word b { font-weight: 750; margin-left: 2px; color: var(--accent); }
.side-credit { margin: 4px 14px 10px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 600; }
.side-credit b { font-size: 15px; }
.side-credit.low { background: var(--bad-soft); color: var(--bad); }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 10px 12px; }
.side-section { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 16px 10px 6px; white-space: nowrap; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: var(--side-text); font-weight: 500; white-space: nowrap; overflow: hidden; }
.side-link:hover { background: var(--side-hover); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--side-active); color: var(--accent); font-weight: 650; }
.side-link.active svg { stroke-width: 2.2; }
.side-bottom { border-top: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.view-as-pick { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--input); }
.view-as-pick select { border: 0; padding: 7px 2px; background: transparent; }
.view-as-pick select:focus { outline: none; }
.me { display: flex; align-items: center; gap: 4px; padding: 4px 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; margin-right: 6px; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--muted); font-size: 11.5px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--side-hover); color: var(--text); }
.bell { position: relative; }
.dot-count { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.mobilebar { display: none; }
.side-scrim { display: none; }

/* collapsed sidebar */
body.side-mini .side { width: 68px; }
body.side-mini .content { margin-left: 68px; }
body.side-mini .side .word, body.side-mini .side-link span, body.side-mini .side-section, body.side-mini .who,
body.side-mini .side-credit, body.side-mini .view-as-pick select, body.side-mini .me .icon-btn:not([data-act="logout"]):not(.bell) { display: none; }
body.side-mini .side-top { flex-direction: column; gap: 8px; padding: 14px 0 8px; }
body.side-mini .side-link { justify-content: center; padding: 10px 0; }
body.side-mini .side-section { display: block; height: 1px; padding: 0; margin: 10px 12px; font-size: 0; background: var(--line); }
body.side-mini .me { flex-direction: column; }
body.side-mini .avatar { margin: 0; }
body.side-mini .view-as-pick { justify-content: center; padding: 8px 0; }

/* burger menu at every width: the sidebar slides in over the page and closes on choice or outside click */
.side { transform: translateX(-100%); width: 260px; box-shadow: 0 0 40px rgba(0,0,0,.25); }
body.side-open .side { transform: none; }
body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(10,12,20,.45); z-index: 35; }
.content, body.side-mini .content { margin-left: 0; }
.mobilebar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.mobilebar .word { font-weight: 700; }
/* on wide screens the open menu pushes the page instead of covering it (and stays open across pages) */
@media (min-width: 901px) {
  body.side-open .side-scrim { display: none; }
  body.side-open .content { margin-left: 260px; }
  .content { transition: margin-left .2s ease; }
}

.view-as { display: flex; align-items: center; gap: 10px; padding: 9px 28px; background: var(--warn-soft); color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--line); }
.view-as span { flex: 1; }
.view-as .btn { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ---------- page ---------- */
main { padding: 26px 28px 70px; max-width: 1440px; }
.page-head { margin-bottom: 20px; }
.page-head .path { font-size: 12px; color: var(--faint); margin-bottom: 2px; }
.page-head h1 { font-size: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; }
.panel-head .count { color: var(--muted); font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.panel-head .grow { flex: 1; }
.panel-body { padding: 4px 18px 18px; }
.info { margin: 0 18px 16px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.info svg { color: var(--accent); margin-top: 2px; }
.info.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.info.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.info.warn svg, .info.bad svg { color: inherit; }

/* kpi cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
  display: grid; grid-template-areas: "k" "v" "s"; align-content: start; gap: 2px; }
.kpi > div:not(.k):not(.v):not(.sub) { display: contents; }
.kpi .k { grid-area: k; font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .v { grid-area: v; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); white-space: nowrap; line-height: 1.25; }
.kpi .v.ok { color: var(--ok); } .kpi .v.warn { color: var(--warn); } .kpi .v.bad { color: var(--bad); }
.kpi .sub { grid-area: s; font-size: 11.5px; color: var(--faint); }

/* scrollbars that follow the theme */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* tables */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.nowrap { white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; width: 1%; }
td.actions .icon-btn { width: 28px; height: 28px; }
td.actions .icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
td a b { color: var(--text); } td a:hover b { color: var(--accent); }
.empty { padding: 44px 18px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.pager:empty { display: none; }

/* badges: dot + label */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.yes { color: var(--ok); font-weight: 600; } .no { color: var(--faint); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost { background: var(--panel); color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--accent-line); color: var(--accent); filter: none; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--input); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
label.f { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 14px; }
label.f > span.h { display: block; margin-bottom: 6px; color: var(--text); }
label.f .hint { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid2 > .panel { margin-bottom: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 400; }
.checks label { display: inline-flex; gap: 6px; align-items: center; }
.search { position: relative; width: 240px; }
.search input { padding-right: 32px; }
.search svg { position: absolute; right: 10px; top: 10px; color: var(--faint); }
.form-section { padding: 18px 20px 6px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.form-section h3 { font-size: 13.5px; padding-top: 2px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; background: var(--panel-2); }
.inline-num { width: 78px; padding: 4px 6px; text-align: center; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 130px; padding: 8px 0 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; max-width: 22px; background: var(--accent-line); border-radius: 5px 5px 2px 2px; min-height: 3px; position: relative; overflow: hidden; }
.bars .col .lead { position: absolute; bottom: 0; left: 0; right: 0; background: var(--accent); }
.bars .lbl { font-size: 10.5px; color: var(--faint); }
.meter { height: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; min-width: 90px; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.full > i { background: var(--bad); }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10,12,20,.5); backdrop-filter: blur(2px); display: flex; align-items: flex-start; justify-content: center; z-index: 60; padding: 70px 16px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 24px 60px rgba(0,0,0,.28); overflow: hidden; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; padding: 16px 20px 6px; }
.modal-head h2 { font-size: 16px; flex: 1; }
.modal-body { padding: 12px 20px 6px; }
.modal .err { color: var(--bad); font-size: 13px; min-height: 18px; }
.modal .form-actions { border-top: 1px solid var(--line); }
#toast { position: fixed; bottom: 22px; right: 22px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
#toast .t { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 380px; font-weight: 500; }
#toast .t.bad { background: var(--bad); color: #fff; }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) 1.2fr; }
.login .l { display: flex; align-items: center; justify-content: center; padding: 32px; background: var(--panel); }
.login .r { position: relative; overflow: hidden; background: #071d1a; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; padding: 64px; }
.login .r::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(43,179,163,.07) 0 1px, transparent 1px 6px); mask-image: linear-gradient(to bottom, #000 40%, transparent 95%); }
.login .r-mark { position: absolute; top: 8%; right: 7%; width: min(34vw, 380px); opacity: .22; }
.login .r-mark svg { display: block; width: 100%; height: auto; }
.login .r-mark rect { fill: #0e3b34; stroke: #2bb3a3; stroke-width: 1; }
.login .r-mark circle, .login .r-mark polyline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.login .r-mark circle { stroke: #e6f2ef; stroke-width: 7; } .login .r-mark polyline { stroke: #2bb3a3; stroke-width: 5.5; }
.login .wave { position: absolute; left: 64px; right: 64px; top: 50%; height: 120px; transform: translateY(-50%); display: flex; align-items: center; gap: 5px; z-index: 1; }
.login .wave span { flex: 1; min-width: 2px; height: var(--h); border-radius: 99px; background: #2bb3a3; opacity: .85; transform-origin: center; animation: talk 1.6s ease-in-out var(--d) infinite alternate; }
.login .wave span:nth-child(3n) { opacity: .5; }
@keyframes talk { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .login .wave span { animation: none; } }
.login .r p { color: #b9e3dc; }
.login .r h2 { font-size: 34px; line-height: 1.15; margin-bottom: 12px; max-width: 520px; position: relative; z-index: 1; }
.login .r p { max-width: 460px; opacity: .85; position: relative; z-index: 1; }
.login form { width: 100%; max-width: 340px; }
.login h1 { font-size: 24px; margin: 34px 0 6px; }
.login .lead-in { color: var(--muted); margin: 0 0 22px; }
.login .logo .mark svg { width: 34px; height: 34px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .side { transform: translateX(-100%); width: 260px; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.side-open .side { transform: none; }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(10,12,20,.45); z-index: 35; }
  .content, body.side-mini .content { margin-left: 0; }
  body.side-mini .side { width: 260px; }
  .mini-toggle { display: none; }
  .mobilebar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--side); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  main { padding: 18px 16px 60px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 1fr; gap: 6px; }
  .login { grid-template-columns: 1fr; } .login .r { display: none; }
  .search { width: 100%; }
  .view-as { padding: 9px 16px; }
}

/* tabs, supplier compare */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -6px 0 18px; }
.tab { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.sup-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; }
.sup-status .grow { flex: 1; }
.sup-status .sup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quote-form { display: grid; grid-template-columns: 2fr 1fr 1.4fr auto; gap: 14px; align-items: end; }
.quote-form .btn { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
table.kv td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.kv td:first-child { width: 42%; }
@media (max-width: 900px) { .sup-status, .quote-form { grid-template-columns: 1fr; } }

.bench { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-line); }
.bench > svg { color: var(--accent); }
.bench > span { flex: 1; }
.chips .grow { flex: 1; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
tr.win td { background: color-mix(in srgb, var(--ok-soft) 70%, transparent); }
tr.win td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

.steps { padding-left: 18px; } .steps li { margin-bottom: 6px; }

.notice { padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice div + div { margin-top: 4px; }
.steps-line { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: s; }
.steps-line li { counter-increment: s; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--bg-soft, rgba(127,127,127,.12)); color: var(--muted); }
.steps-line li::before { content: counter(s) ". "; }
.steps-line li.ok { background: var(--ok-soft); color: var(--ok); }
.steps-line li.now { background: var(--accent-soft, rgba(80,120,255,.15)); color: var(--accent); font-weight: 600; }
.steps-line li.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.srv-facts { margin-bottom: 10px; }
.radios { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.radios label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.radios input { width: auto; margin: 0; }

/* setup wizard (Server automatici) */
.wizard > summary { cursor: pointer; list-style: none; }
.wizard > summary::-webkit-details-marker { display: none; }
.wizard > summary .meter { width: 140px; }
.wiz { list-style: none; margin: 0; padding: 0 18px 8px; }
.wiz li { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.wiz-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--line-strong); color: var(--muted); }
.wiz li.ok .wiz-dot { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.wiz li.manual .wiz-dot { border-style: dashed; }
.wiz li.ok .wiz-body b { color: var(--muted); }
.wiz-body { flex: 1; min-width: 0; }
.wiz-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bad-t { color: var(--bad); }
@media (max-width: 700px) { .wiz li { flex-wrap: wrap; } .wiz-links { width: 100%; justify-content: flex-start; padding-left: 42px; } }

/* campaign settings: tabs inside the form, per-day hours, recycle table, import mapping */
.form-tabs { margin: 0; padding: 4px 16px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.form-tabs .tab { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mini-table { border-collapse: collapse; width: auto; margin-bottom: 6px; }
.mini-table td, .mini-table th { padding: 5px 14px 5px 0; border: 0; background: none; font-weight: 400; }
.mini-table th { font-size: 11px; }
.mini-table input[type=time] { width: 110px; padding: 4px 6px; margin-left: 4px; }
.checkline { display: inline-flex; gap: 8px; align-items: center; min-width: 170px; }
.map-table td { vertical-align: middle; }
.map-table select { min-width: 180px; }
.checks input[type=time] { width: 110px; }
.field-chips { margin: -6px 0 14px; align-items: center; }
.tts-out { margin: -4px 0 14px; display: grid; gap: 6px; }
.tts-out audio { width: 100%; max-width: 420px; }

/* costs and margins */
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
a.chip:hover { text-decoration: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; padding-top: 16px; }
.filter-row .btn { margin-bottom: 14px; }
.search.dates { display: flex; gap: 6px; align-items: center; width: auto; }
.search.dates input[type=date] { width: 140px; }
.chip .icon-btn { width: 18px; height: 18px; margin-left: 2px; vertical-align: middle; }

/* funnel */
.funnel { display: grid; gap: 12px; padding-top: 14px; }
.fhead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.fhead span:first-child { flex: 1; }
.fbar { height: 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.fbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* statement + printing */
.st-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 14px 0 12px; border-bottom: 2px solid var(--line-strong); margin-bottom: 8px; }
.st-month { font-size: 18px; font-weight: 650; text-transform: capitalize; }
.st-sum { width: 100%; margin: 6px 0 4px; }
.st-sum td { padding: 8px 4px; }
.st-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.st-h { font-size: 13.5px; margin: 18px 0 8px; }
@media print {
  .side, .mobilebar, .side-scrim, .view-as, .no-print, .page-head .path, #toast { display: none !important; }
  .content { margin: 0 !important; }
  main { padding: 0; max-width: none; }
  body, .panel, th, td { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .panel { border: 0; }
  .table-wrap { overflow: visible; border: 0; }
  :root { --line: #ccc; --line-strong: #999; --muted: #555; --faint: #555; }
}
.qr { display: flex; justify-content: center; margin: 4px 0 14px; }
.qr img, .qr svg { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; }
.pace { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pace .icon-btn { width: 26px; height: 26px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 15px; }
.pace .icon-btn:disabled { opacity: .35; cursor: default; }
.pace b { min-width: 22px; text-align: center; }
.pace-n { min-width: 34px; padding: 2px 6px; border: 1px dashed var(--line-strong); border-radius: 6px; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: text; }
.pace-n:hover { border-color: var(--accent); }

/* real-time statistics (hopper) */
.stats-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.stats-head select { width: 260px; }
.hop .panel-head h2 a { color: var(--text); }
.hop-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 14px; }
.hop-kpis > div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.hop-kpis b { font-size: 22px; letter-spacing: -.02em; }
.hop-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.hop-bar i { display: block; height: 100%; }
.hop-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 14px; color: var(--muted); }
.hop-legend span { display: inline-flex; align-items: center; gap: 6px; }
.hop-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.h-new { background: var(--accent); } .h-retry { background: #6aa7ff; } .h-wait { background: var(--warn); }
.h-call { background: var(--ok); } .h-hlr { background: #b083ff; } .h-done { background: var(--line-strong); } .h-off { background: var(--bad); opacity: .55; }
.hop-detail h3 { font-size: 12px; color: var(--muted); font-weight: 650; margin: 0 0 6px; }
.hop-detail .chips { margin-bottom: 12px; }
.hop details { margin-top: 4px; }
.hop details summary { cursor: pointer; margin-bottom: 8px; }

/* wallboard (TV mode) */
body.tv .side, body.tv .mobilebar, body.tv .view-as, body.tv .side-scrim { display: none !important; }
body.tv .content { margin-left: 0 !important; }
body.tv main { max-width: none; padding: 18px 24px; }
.wallboard { display: grid; gap: 18px; }
.wb-top { display: flex; align-items: center; }
.wb-title { flex: 1; font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.wb-title span { margin-left: 14px; font-size: 18px; font-weight: 500; color: var(--muted); }
.wb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.wb-kpis > div, .wb-camp { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.wb-kpis b { display: block; font-size: clamp(36px, 5vw, 64px); line-height: 1.05; font-weight: 800; letter-spacing: -.03em; }
.wb-kpis span, .wb-nums span { color: var(--muted); font-size: 15px; }
.wallboard b.ok { color: var(--ok); } .wallboard b.bad { color: var(--bad); }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.wb-camp { display: grid; gap: 12px; }
.wb-camp.bad { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.wb-camp.off { opacity: .55; }
.wb-name { font-size: 22px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.wb-name span { font-size: 14px; font-weight: 600; color: var(--muted); }
.wb-camp.bad .wb-name span { color: var(--bad); }
.wb-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wb-nums b { display: block; font-size: clamp(26px, 3.2vw, 44px); font-weight: 800; line-height: 1.1; }
.wb-foot { color: var(--muted); font-size: 14px; }

/* what needs attention */
.attn { list-style: none; margin: 0; padding: 0 18px 8px; }
.attn li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.attn .txt { flex: 1; }
.attn .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); }
.attn li.bad .dot { background: var(--bad); } .attn li.warn .dot { background: var(--warn); }
.attn li.bad .txt { font-weight: 600; }
.attn-ok { color: var(--ok); display: flex; gap: 8px; align-items: center; padding-top: 10px; }
.camp-tabs { overflow-x: auto; scrollbar-width: none; }
.camp-tabs .tab { white-space: nowrap; }

.attn.ready li.ok .dot { background: var(--ok); }
.attn.ready li.ok .txt { color: var(--muted); }
.wizard-steps .tab { display: inline-flex; gap: 8px; align-items: center; }
.step-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; border: 1.5px solid var(--line-strong); }
.wizard-steps .tab.active .step-n { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.wizard-steps .tab.done .step-n { border-color: transparent; background: var(--ok-soft); color: var(--ok); }

/* in-page confirmation */
.ask-bg { z-index: 80; align-items: center; }
.modal.ask { max-width: 440px; }
.modal.ask p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.btn.bad-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.pace-input { width: 72px; padding: 3px 6px; text-align: center; font-weight: 700; }
/* tables as cards on phones */
@media (max-width: 640px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border-bottom: 1px solid var(--line); padding: 8px 14px; }
  .table-wrap td { border: 0; padding: 3px 0; text-align: left !important; display: flex; gap: 10px; justify-content: space-between; align-items: center; }
  .table-wrap td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; font-weight: 600; flex: none; }
  .table-wrap td.actions { justify-content: flex-start; width: auto; }
  tbody tr:hover { background: none; }
}

/* global search */
.side-search { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); color: var(--muted); font: inherit; cursor: pointer; }
.side-search span { flex: 1; text-align: left; }
.side-search kbd { font-size: 10.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
body.side-mini .side-search span, body.side-mini .side-search kbd { display: none; }
body.side-mini .side-search { justify-content: center; margin: 0 10px 8px; }
.search-bg { z-index: 85; }
.modal.palette { max-width: 620px; }
.pal-in { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in input { border: 0; background: none; font-size: 16px; padding: 4px 0; }
.pal-in input:focus { outline: none; box-shadow: none; }
.pal-res { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.pal-res li { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pal-res li.on, .pal-res li:hover { background: var(--accent-soft); }
.pal-res li b { flex: none; } .pal-res li .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-foot { padding: 8px 16px; border-top: 1px solid var(--line); }
/* sparkline */
.spark { display: inline-flex; align-items: flex-end; gap: 1px; height: 22px; width: 96px; }
.spark i { flex: 1; background: var(--accent); border-radius: 1px; opacity: .85; }
.spark i.z { background: var(--line-strong); opacity: .6; }
.bars.week .b { flex: 1; }
