/* Connect4Sure brand: cyan #13C2ED -> indigo #3943E8 (the "4"), grey #575757 (lettering) */
:root {
  --brand-cyan: #13c2ed;
  --brand-blue: #1aa7ee;
  --brand-indigo: #3943e8;
  --brand-grey: #575757;
  --brand-gradient: linear-gradient(120deg, #13c2ed 0%, #1aa7ee 45%, #3943e8 100%);
  --button-gradient: linear-gradient(120deg, #1279bd 0%, #3943e8 100%); /* the logo's blue to indigo, deep enough for white text */
  --on-gradient: #ffffff;
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f6f9fc;
  --text: #24272d;
  --muted: #646a73;
  --border: #dbe2ea;
  --primary: #2f4be0;
  --primary-text: #ffffff;
  --ok: #157a3b;
  --ok-bg: #e4f4e9;
  --warn: #8f5500;
  --warn-bg: #fff2d9;
  --info: #1d63d6;
  --info-bg: #e5f6fd;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --h0: #b7d3f6; --h1: #86b6ef; --h2: #5598e7; --h3: #2a78d6; --h4: #1c5cab; --h5: #104281; --grid: #e1e0d9; --est: #bebeb8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --h0: #184f95; --h1: #1c5cab; --h2: #2a78d6; --h3: #5598e7; --h4: #86b6ef; --h5: #b7d3f6; --grid: #2c2c2a; --est: #5c5c58;
    --bg: #10141a; --surface: #192029; --surface-2: #1d2530; --text: #e6e9ee; --muted: #9aa3b0; --border: #2c3440;
    --primary: #4cc7f2; --ok: #5fd08a; --ok-bg: #173323; --warn: #f2b857; --warn-bg: #3a2c12;
    --info: #6fd2f4; --info-bg: #10303f; --err: #ff8a80; --err-bg: #3d1c1a; --shadow: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1 { font-size: 20px; margin: 0; }
h2 { margin: 0 0 8px; font-size: 18px; }
h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
a { color: var(--primary); }
code { font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, .uid-cell { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--brand-gradient); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand-logo { height: 16px; width: auto; display: block; }
.brand span { font-weight: 500; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--border); }
.topbar nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.topbar nav a { padding: 6px 9px; border-radius: 8px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.topbar nav a:hover { background: var(--surface-2); }
.topbar nav a.active { background: var(--info-bg); color: var(--info); font-weight: 600; }
.nav-count { background: var(--warn); color: var(--surface); border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.mode-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.mode-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mode-direct { background: var(--ok-bg); color: var(--ok); }
.mode-import { background: var(--warn-bg); color: var(--warn); }
.mode-unknown { background: var(--surface-2); color: var(--muted); }
.mode-banner { background: var(--warn-bg); color: var(--warn); padding: 9px 24px; border-bottom: 1px solid var(--border); font-size: 13px; }
.mode-banner a { color: inherit; font-weight: 600; }

main { padding: 20px 24px 60px; max-width: 1440px; margin: 0 auto; }
.page-head { margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.empty { text-align: center; color: var(--muted); padding: 28px 0 12px; }

/* ---------- buttons, pills ---------- */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--button-gradient); border-color: transparent; color: var(--primary-text); font-weight: 600; }
.btn-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.06); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; font-weight: 600; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { padding: 5px 10px; font-size: 12px; }
.pill { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-block; }
.pill-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-err { background: var(--err-bg); color: var(--err); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-info { background: var(--info-bg); color: var(--info); }

/* ---------- upload ---------- */
.upload-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.upload-layout .upload-card { grid-row: span 2; }
.upload-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.step { display: flex; gap: 14px; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--button-gradient); color: var(--on-gradient); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step-body { flex: 1; min-width: 0; }
.step-body h3 { margin: 5px 0 10px; }
.pick-entry { display: flex; gap: 8px; }
.pick-entry input { flex: 1; min-width: 0; font: inherit; font-size: 15px; font-weight: 600; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.pick-entry.invalid input { border-color: var(--err); }
.suggest-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; }
.suggest li { padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.suggest li.active, .suggest li:hover { background: var(--ok-bg); }
.suggest li mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; }
.suggest li.note { cursor: default; color: var(--muted); font-size: 13px; background: none; }
.pick-confirmed { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }
.pick-confirmed span { min-width: 0; overflow-wrap: anywhere; }
.pick-confirmed strong { font-size: 16px; white-space: nowrap; }
.pick-confirmed small { font-weight: 400; opacity: .85; }
.hint { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 24px; border: 2px dashed var(--border); border-radius: var(--radius); cursor: pointer; text-align: center; background: var(--surface-2); }
.dropzone:not(.disabled):hover, .dropzone.over { border-color: var(--primary); background: var(--info-bg); }
.dropzone.disabled { opacity: .55; cursor: not-allowed; }
.dropzone small { color: var(--muted); }
.upload-msg { margin-top: 10px; white-space: pre-wrap; font-size: 13px; }
.upload-msg .rej { color: var(--err); }
.batch-card { border-color: var(--primary); }
.batch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.uid { font-size: 22px; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.file-list, .recent-list { list-style: none; margin: 0; padding: 0; }
.file-list li, .recent-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.file-list li a, .recent-list li a { color: var(--text); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li a:hover, .recent-list li a:hover { color: var(--primary); }
.recent-list .meta { color: var(--muted); font-size: 12px; }

/* ---------- queue ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; font: inherit; color: var(--muted); display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.tile .n { font-size: 22px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tile.active { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: -2px; }
.tile[data-status="needs_review"] .n { color: var(--warn); }
.tile[data-status="extraction_failed"] .n, .tile[data-status="post_failed"] .n { color: var(--err); }
.tile[data-status="done"] .n { color: var(--ok); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { flex: 1 1 260px; font: inherit; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--info-bg); color: var(--info); border-radius: 99px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 13px; }
.chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; }
.inline-check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.inline-check.block { display: flex; align-items: flex-start; margin-top: 6px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.table td.file { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tr.dim td { opacity: .55; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { display: flex; gap: 4px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- review ---------- */
.review-head { margin-bottom: 14px; }
.back { text-decoration: none; font-size: 13px; }
.review-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; }
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.doc { position: sticky; top: 70px; padding: 10px; margin: 0; }
.doc-frame { height: calc(100vh - 170px); min-height: 420px; border-radius: 8px; overflow: auto; background: var(--surface-2); }
.doc-frame iframe { width: 100%; height: 100%; border: 0; }
.doc-frame img { width: 100%; display: block; }
.doc a { display: inline-block; margin-top: 8px; }
.form-section { padding: 16px 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.span2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field input, .field select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
.field input:focus, .field select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.field input.readonly { background: var(--surface-2); color: var(--muted); font-weight: 700; }
.field input.upper { text-transform: uppercase; }
.field.missing input, .field.missing select { border-color: var(--warn); background: var(--warn-bg); }
.field.invalid input { border-color: var(--err); }
.field.invalid .hint { color: var(--err); }
.field.disabled { opacity: .45; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.quick button { font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; }
.quick button:hover { color: var(--primary); border-color: var(--primary); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.tag-found { background: var(--ok-bg); color: var(--ok); }
.tag-missing { background: var(--warn-bg); color: var(--warn); }
.tag-derived { background: var(--info-bg); color: var(--info); }
.tag-edited { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.amount-check { margin-top: 12px; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.amount-check:empty { display: none; }
.amount-check.ok { background: var(--ok-bg); color: var(--ok); }
.amount-check.bad { background: var(--err-bg); color: var(--err); }
.note-field { margin-top: 14px; }
.banner { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.banner-warn { background: var(--warn-bg); color: var(--warn); }
.banner-err { background: var(--err-bg); color: var(--err); }
.banner-ok { background: var(--ok-bg); color: var(--ok); }
.banner-info { background: var(--info-bg); color: var(--info); }
.banner .btn { margin-top: 8px; }
.voucher-preview table { width: 100%; border-collapse: collapse; font-size: 13px; }
.voucher-preview td, .voucher-preview th { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.voucher-preview .cc { display: block; font-size: 12px; color: var(--muted); }
.voucher-preview .narr { margin-top: 8px; font-size: 12px; color: var(--muted); }
.action-bar { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.checklist { margin: 0 0 8px; padding-left: 18px; color: var(--warn); font-size: 13px; }
.checklist:empty { display: none; }
.confirm { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13px; }
.confirm input { margin-top: 2px; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.actions.left { justify-content: flex-start; }
.spacer { flex: 1; }
.error { color: var(--err); margin-top: 8px; white-space: pre-wrap; font-size: 13px; }
.error:empty { display: none; }

.doc-noview { padding: 40px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.doc-noview strong { color: var(--text); }

/* ---------- users: vendor ledgers ---------- */
.mono-ish { font-size: 13px; overflow-wrap: anywhere; }
.super-toggle { display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; color: var(--muted); cursor: pointer; }
.warn-text { color: var(--warn) !important; font-weight: 600; }
.ledger-picker { display: flex; gap: 8px; }
.ledger-picker input { flex: 1; }
.ledger-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ledger-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--info-bg); color: var(--info); border-radius: 99px; padding: 2px 4px 2px 10px; font-size: 12px; font-weight: 600; }
.ledger-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.v-account { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; font-size: 13px; }
.v-account select { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.v-acc { font-size: 11px; color: var(--muted); }

/* ---------- dashboard ---------- */
.dash-card { overflow-x: auto; background: #f5f7fa; color: #24272d; padding: 0; }

/* ---------- Tally payments ---------- */
.pay-table td { vertical-align: top; }
.pay-table td.small { max-width: 260px; }
.flag-box { margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--warn); background: var(--warn-bg); color: var(--text); border-radius: 4px; font-size: 12px; }
.flag-box .link, .pay-table .link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 12px; }
.hint-ok { margin-top: 4px; color: var(--info); font-weight: 600; }

/* ---------- activity ---------- */
.act-filters { padding: 10px 14px; }
.act-custom { display: inline-flex; gap: 10px; margin-left: 6px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.act-custom input { font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.act-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.act-tile { cursor: default; }
.act-table th { white-space: normal; vertical-align: bottom; }
.act-table td .sub { font-size: 11px; color: var(--muted); white-space: nowrap; }
.link-num { font: inherit; background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; }
.link-num:hover strong { text-decoration: underline; }
@media (max-width: 900px) { .act-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- settings ---------- */
/* ---------- settings ---------- */
.settings-page { max-width: 1240px; margin: 0 auto; }
.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; color: var(--muted); background: none; border: 0; border-left: 2px solid var(--border); padding: 8px 12px; cursor: pointer; }
.settings-nav button:hover { color: var(--text); background: var(--surface-2); }
.settings-nav button.active { color: var(--text); font-weight: 600; border-left-color: var(--brand-blue); background: var(--info-bg); }
.settings-nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.settings-nav .dot.ok { background: var(--ok); }
.settings-nav .dot.bad { background: var(--err); }
.settings .set-card { padding: 22px 24px; margin-bottom: 18px; scroll-margin-top: 76px; }
.set-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.set-head h2 { font-size: 16px; margin: 0 0 4px; }
.set-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 640px; }
.set-head .pill { flex: none; }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-bottom: 16px; }
.set-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.set-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings .field { margin: 0; }
.settings .field .hint { margin-top: 2px; }
.req { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); background: var(--warn-bg); padding: 1px 6px; border-radius: 99px; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.more { margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.more summary { cursor: pointer; color: var(--primary); font-weight: 600; width: fit-content; }
.more ul, .more ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.more p { margin: 8px 0 0; }
.settings .sub-head { margin: 18px 0 10px; font-size: 12px; }
.settings .field label.inline-check { display: flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 4px; cursor: pointer; }
.settings .field label.inline-check input { width: auto; padding: 0; margin: 0; flex: none; }
.set-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.set-stats .stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-stats .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.set-stats .val { font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.set-stats .sub { font-size: 12px; color: var(--muted); }
.set-stats .stat-wide { grid-column: 1 / -1; margin: 0; }
.conn-status .banner { margin: 0 0 12px; }
.choice-group { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-group legend { font-size: 12px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--surface); }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--brand-blue); background: var(--info-bg); box-shadow: 0 0 0 1px var(--brand-blue) inset; }
.choice input { margin-top: 3px; accent-color: var(--brand-indigo); }
.choice small, .switch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 400; }
.choice .pill { font-size: 10px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.switch { appearance: none; flex: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border); position: relative; cursor: pointer; margin: 1px 0 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch:checked { background: var(--button-gradient); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.gst-wrap { position: relative; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; }
.settings #set-gst { padding-left: 16px; padding-right: 16px; }
#set-gst .set-head, #set-gst .set-grid { padding-left: 8px; padding-right: 8px; }
.gst-wrap .table th { background: var(--surface-2); }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 0 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
.save-bar .save-msg { color: var(--muted); font-size: 13px; }
.save-bar.dirty { border-color: var(--brand-blue); }
.save-bar.dirty .save-msg { color: var(--text); font-weight: 600; }
.save-bar.dirty .save-msg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 8px; vertical-align: 1px; }
.save-bar.error { border-color: var(--err); }
.save-bar.error .save-msg { color: var(--err); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .settings-nav { position: sticky; top: 56px; z-index: 6; flex-direction: row; overflow-x: auto; background: var(--bg); padding: 6px 0; margin: 0 -4px; }
  .settings-nav button { border-left: 0; border-radius: 99px; white-space: nowrap; padding: 6px 12px; border: 1px solid var(--border); background: var(--surface); }
  .settings-nav button.active { border-color: var(--brand-blue); }
  .set-grid, .set-grid.cols-2, .set-grid.cols-3, .choice-group { grid-template-columns: minmax(0, 1fr); }
  .settings .set-card { padding: 18px 16px; }
  .set-head { flex-direction: column; }
}
.conn-status { margin-bottom: 12px; }
.conn-status:empty { display: none; }

/* ---------- dialog, toast ---------- */
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 460px; width: calc(100% - 32px); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(10, 15, 25, .45); }
.reasons { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.reasons label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.reasons input[type="text"] { flex: 1; font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); min-width: 0; }
dialog .actions { justify-content: flex-end; }
/* in-app reason / confirmation dialog (askReason) */
dialog.ask-dlg { max-width: 520px; padding: 0; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.ask-form { display: grid; gap: 14px; padding: 22px 22px 18px; }
.ask-head { display: flex; gap: 14px; align-items: flex-start; }
.ask-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--info-bg, rgba(59, 130, 246, .12)); color: var(--info, #3b82f6); }
.ask-ic-danger { background: var(--err-bg, rgba(220, 38, 38, .12)); color: var(--err, #dc2626); }
.ask-ic-warn { background: var(--warn-bg, rgba(234, 179, 8, .15)); color: var(--warn, #b45309); }
.ask-ic-ok { background: var(--ok-bg, rgba(22, 163, 74, .12)); color: var(--ok, #16a34a); }
.ask-ic-ask, .ask-ic-info { background: var(--info-bg, rgba(59, 130, 246, .12)); color: var(--info, #3b82f6); }
.ask-head-txt { min-width: 0; padding-top: 2px; }
.ask-head-txt .ask-intro:first-child { color: var(--text); font-size: .98rem; margin-top: 8px; }
.ask-copy { display: flex; gap: 8px; }
.ask-copy input { flex: 1; min-width: 0; font: inherit; font-size: .85rem; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.ask-form input#ask-reason { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.ask-form input#ask-reason:focus { outline: 2px solid var(--primary, #6366f1); outline-offset: 1px; }
.ask-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask-title { margin: 2px 0 4px; font-size: 1.1rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.ask-intro { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.ask-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg, transparent); }
.ask-facts dt { font-size: .75rem; color: var(--muted); }
.ask-facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips .chip { font-size: .82rem; }
.ask-label { font-weight: 600; font-size: .9rem; margin-bottom: -8px; }
.ask-form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; min-height: 76px; box-sizing: border-box; }
.ask-form textarea:focus { outline: 2px solid var(--primary, #6366f1); outline-offset: 1px; }
.ask-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: -8px; font-size: .78rem; }
.ask-err { color: var(--err, #dc2626); }
.ask-count { color: var(--muted); margin-left: auto; }
.ask-notes { margin: 0; padding: 10px 12px 10px 28px; border-radius: 8px; background: var(--warn-bg, rgba(234, 179, 8, .12)); font-size: .85rem; line-height: 1.45; }
.ask-notes li + li { margin-top: 4px; }
.ask-form .actions { margin-top: 2px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 10px 18px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); z-index: 30; max-width: calc(100% - 32px); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .review { grid-template-columns: minmax(0, 1fr); }
  .doc { position: static; }
  .doc-frame { height: 60vh; }
  .upload-layout { grid-template-columns: minmax(0, 1fr); }
  .upload-layout .upload-card { grid-row: auto; }
}
@media (max-width: 640px) {
  main { padding: 14px 16px 60px; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
  .topbar nav { order: 3; width: 100%; }
  .mode-banner { padding: 9px 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: span 1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pick-entry { flex-wrap: wrap; }
  .pick-entry .btn { width: 100%; justify-content: center; }
  .actions .spacer { display: none; }
}

/* ---------- sign in ---------- */
.login-wrap { min-height: calc(100vh - 40px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 400px; padding: 28px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.login-logo { width: 190px; height: auto; display: block; }
.login-brand span { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.login-card { position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--brand-gradient); }
.login-card form { display: grid; gap: 12px; }
.login-card h2 { margin: 0; }
.login-card p { margin: 0; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.code-input { font-size: 22px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; background: #fff; border-radius: 8px; padding: 8px; }
.qr svg { width: 200px; height: 200px; }
.secret { display: block; text-align: center; font-size: 13px; word-break: break-all; padding: 6px; }
.enroll-steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.login-foot { margin-top: 14px !important; text-align: center; }

/* ---------- user menu ---------- */
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); white-space: nowrap; font-size: 13px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 180px; padding: 4px; z-index: 20; }
.user-menu .menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; color: var(--text); cursor: pointer; }
.user-menu .menu button:hover, .user-menu .menu a:hover { background: var(--surface-2); }
.user-menu .menu a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.user-menu .menu a.active { background: var(--info-bg); color: var(--info); font-weight: 600; }
.user-menu .menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
body:not(.is-admin) .admin-only { display: none !important; }
body:not(.is-super) .super-only { display: none !important; }

/* ---------- supplier pick, ready queue, audit ---------- */
.pick-create { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--warn-bg); color: var(--warn); border-radius: 8px; font-size: 13px; }
.ready-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--info-bg); color: var(--info); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.ready-bar.offline { background: var(--warn-bg); color: var(--warn); }
.tile[data-status="ready"] .n { color: var(--info); }
.search.narrow { flex: 0 1 200px; }
.table.audit td { font-size: 13px; vertical-align: top; }
.table.audit td.details { max-width: 420px; color: var(--muted); word-break: break-word; }
.act { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.act.fail { color: var(--err); font-weight: 600; }
.who { font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* top bar: nav moves to its own scrollable row on narrower screens */
.topbar nav a { white-space: nowrap; }
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar .brand { flex: 1; }
  .topbar nav:not(.mod-hop) { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
}
@media (max-width: 520px) {
  .mode-badge #mode-text { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .user-menu summary .role { display: none; }
}
.table.audit td.details { min-width: 260px; }
.table.audit td:nth-child(3) { min-width: 150px; }
.act { font-family: inherit; font-size: 13px; font-weight: 600; }

/* position within a multi-invoice upload */
.batch-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.batch-steps { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; text-decoration: none; border: 2px solid var(--border); color: var(--muted); background: var(--surface-2); }
.step-dot.current { border-color: var(--primary); color: var(--primary); }
.step-dot.s-posted, .step-dot.s-exported { background: var(--ok-bg); color: var(--ok); }
.step-dot.s-ready { background: var(--info-bg); color: var(--info); }
.step-dot.s-needs_review { background: var(--warn-bg); color: var(--warn); }
.step-dot.s-extraction_failed, .step-dot.s-post_failed { background: var(--err-bg); color: var(--err); }
.batch-arrows { display: inline-flex; gap: 12px; margin-left: auto; }
.batch-arrows a { text-decoration: none; font-weight: 600; }

/* ---------- posting ---------- */
.nav-count.ready { background: var(--info); }
.posting-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.summary-card { position: sticky; top: 76px; }
.summary { margin: 0 0 12px; display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary .total { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
.summary .total dd { font-size: 18px; }
.sum-lists { display: grid; gap: 8px; margin-bottom: 12px; }
.sum-lists h4 { margin: 0 0 2px; font-size: 12px; }
.table.posting tr.group td { background: var(--surface-2); font-weight: 600; font-size: 13px; }
.table.posting tr.group td .muted { font-weight: 400; }
.table.posting td:first-child { width: 32px; }
.table.posting tr.sel td { background: var(--info-bg); }
.table.posting tr.group.sel td { background: var(--info-bg); }
.run-table td { font-size: 13px; }
@media (max-width: 980px) {
  .posting-layout { grid-template-columns: minmax(0, 1fr); }
  .summary-card { position: static; }
}
.table.posting td:nth-child(3), .table.posting td:nth-child(5), .run-table td:nth-child(5) { white-space: nowrap; }
.run-table tr.err-row td { color: var(--err); background: var(--err-bg); font-size: 12px; padding-top: 4px; }

/* ---------- master data requests / approvals ---------- */
.master-help { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.master-help.pending { background: var(--info-bg); color: var(--info); }
.master-help.rejected { background: var(--err-bg); color: var(--err); }
.master-help .btn { font-size: 12px; padding: 4px 10px; }
.checklist li.info { color: var(--info); }
.request-list { display: grid; gap: 10px; }
.request { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.request .name { font-size: 16px; font-weight: 700; }
.request .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.request .edit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.request .edit input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); min-width: 0; }
.request .buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .request { grid-template-columns: minmax(0, 1fr); } .request .buttons { justify-content: flex-start; } }

/* ---------- charges on the invoice ---------- */
.items-table td { vertical-align: middle; }
.items-table input, .items-table select { width: 100%; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.items-table td.num input { text-align: right; max-width: 140px; margin-left: auto; display: block; }
.items-table .remove { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 6px; }
.items-table .remove:hover { color: var(--err); }
#items-card .amount-check:empty { display: none; }
.items-table { table-layout: fixed; }
.items-table th:nth-child(1) { width: 40%; }
.items-table th:nth-child(2) { width: 20%; }
.items-table th:nth-child(3) { width: 22%; }
.items-table th:nth-child(4) { width: 15%; }
.items-table th:nth-child(5) { width: 36px; }
.items-table td { vertical-align: top; }
.item-period { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.items-table .item-period input { flex: 1 1 120px; min-width: 120px; width: auto; font-size: 12px; padding: 3px 4px; }
.items-table input.invalid { border-color: var(--err); }
.banner-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- GST registrations (settings) ---------- */
.gst-table { table-layout: fixed; width: 100%; min-width: 880px; }
.gst-table col.c-state { width: 128px; }
.gst-table col.c-code { width: 52px; }
.gst-table col.c-gstin { width: 136px; }
.gst-table col.c-x { width: 36px; }
.gst-table th, .gst-table td { padding: 6px 5px; vertical-align: middle; }
.gst-table th:first-child, .gst-table td:first-child { padding-left: 10px; }
.gst-table input { width: 100%; min-width: 0; font: inherit; font-size: 12.5px; padding: 6px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); text-overflow: ellipsis; }
.gst-table td:nth-child(3) input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.gst-table .remove { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.gst-table .remove:hover { color: var(--err); }

/* ---------- vendor portal ---------- */
body.is-vendor .topbar { justify-content: space-between; }
.v-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.v-tile .v-paid { color: var(--ok); }
.v-asof { margin: -6px 0 12px; }
.v-table tfoot td { border-bottom: 0; color: var(--muted); }
.v-table tfoot tr.total td { color: var(--text); border-top: 1px solid var(--border); }
.v-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.v-tile .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.v-tile .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.v-tile .v-overdue.has { color: var(--err); }
.v-tile .v-returned.has { color: var(--warn); }
.v-result { margin-top: 12px; font-size: 13px; }
.v-result ul { margin: 6px 0 0; padding-left: 18px; }
.v-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.v-head h3 { margin: 0; }
.v-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.v-filters input { min-width: 160px; font: inherit; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.v-filters select { max-width: 280px; font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.chip { font: inherit; font-size: 12px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.active { background: var(--info-bg); color: var(--info); border-color: var(--info); font-weight: 600; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v-table .reason { margin-top: 4px; font-size: 12px; color: var(--warn); }
.v-table .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) {
  .v-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding: 16px 16px 48px; }
  /* Tables become one card per row on phones */
  .v-table thead { display: none; }
  .v-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .v-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .v-table td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .v-table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
  .v-table td:empty { display: none; }
  .v-table td:not([data-label]):not(:first-child) { justify-content: flex-end; }
  .v-filters input { flex: 1; min-width: 0; }
  .v-filters select { flex: 1 1 100%; max-width: 100%; }
}

/* Customers (Zoho CRM copy) and invoice connections */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--info-bg); }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin: 0; }
.kv-grid > div { min-width: 0; }
.kv-grid dt { font-size: 12px; color: var(--muted); }
.kv-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.kv-grid > .kv-full { grid-column: 1 / -1; }             /* a long value (the 64-character IRN) on its own row */
.kv-grid dd.kv-wrap { white-space: normal; word-break: break-all; }
.conn-link { margin-top: 10px; position: relative; }
.conn-link input { width: 100%; }
.conn-results { display: grid; gap: 2px; margin-top: 4px; }
.conn-hit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
.conn-hit-row:hover { background: var(--accent-soft); }
.conn-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.conn-suggest .chip { cursor: pointer; }
#conn-card .conn-link { margin: 6px 0 12px; }
#conn-checks .banner { margin-bottom: 8px; }

/* ---- App layout: slim top bar + left sidebar menu ---- */
.topbar .conn-wrap { margin-left: auto; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 18px; line-height: 1; padding: 5px 9px; color: var(--text); cursor: pointer; }
body.signed-in .shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 14px 10px 24px; }
.sidebar nav { display: grid; gap: 16px; }
.nav-group { display: grid; gap: 2px; }
.nav-head { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 1px; }
.sidebar a.active { background: var(--info-bg); color: var(--info); font-weight: 600; border-left-color: var(--brand-blue); }
.sidebar .nav-count { margin-left: auto; }
.nav-scrim { position: fixed; inset: 0; background: rgba(16, 20, 26, .45); z-index: 29; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  body.signed-in .shell { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: auto; width: min(280px, 85vw); z-index: 30;
    padding-top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  body.menu-open .sidebar { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* Customers: filters and vendor payment projection */
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; }
.filter-grid .field input, .filter-grid .field select { width: 100%; }
.period-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.period-label { font-weight: 600; align-self: center; }
.field.inline { display: flex; align-items: center; gap: 6px; }
.field.inline label { margin: 0; }
.quick-periods { display: flex; flex-wrap: wrap; gap: 6px; }
.projection { border-top: 3px solid var(--brand-blue); }
.proj-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 6px 0 12px; }
.proj-figures > div { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; min-width: 0; }
.proj-figures .lbl { font-size: 12px; color: var(--muted); }
.proj-figures .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.proj-figures .proj-main .val { font-size: 28px; color: var(--info); }
.proj-figures .sub { font-size: 12px; color: var(--muted); }
.proj-breakdowns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 10px; }
.proj-breakdowns > div { min-width: 0; overflow-x: auto; }
.proj-breakdowns h4 { margin: 0 0 6px; font-size: 13px; }
.table.compact td, .table.compact th { padding: 6px 8px; }

/* ======================================================================
   Look & feel (reference: "Invoice Operations" concept)
   Orbit by Connect4Sure: the logo's colours. Charcoal sidebar (the logo's lettering, #575757 deepened),
   the "4"'s gradient (cyan #13C2ED -> blue #1AA7EE -> indigo #3943E8) on buttons, the active menu item and
   the Orbit mark; bold headings, roomy cards.
   ====================================================================== */
:root {
  --primary: #3943e8; --primary-hover: #2c35c9; --primary-text: #ffffff;
  --button-gradient: linear-gradient(120deg, #1279bd 0%, #3943e8 100%);
  --accent-soft: #eceefe; --accent-line: #b7bdf6;
  --nav-bg: #26282d; --nav-text: #d6d9de; --nav-muted: #8d929b; --nav-hover: rgba(255, 255, 255, .07);
  --wordmark-on-dark: linear-gradient(120deg, #13c2ed 0%, #4fb0ff 50%, #8a93ff 100%);
  --bg: #f4f6f9; --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --side-w: 236px;
}
@media (prefers-color-scheme: dark) {
  :root { --primary: #4cc7f2; --primary-hover: #7ad6f6; --primary-text: #04212c; --button-gradient: linear-gradient(120deg, #1279bd 0%, #3943e8 100%);
    --accent-soft: #172a45; --accent-line: #2d4f7a; --nav-bg: #17181b; --bg: #0f141b; }
}
body { font-size: 14.5px; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
a { color: var(--primary); }
.card { border-radius: var(--radius); }
.btn { border-radius: 10px; }
.btn-primary { background: var(--button-gradient); color: var(--on-gradient); }
.btn-outline { background: var(--surface); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.btn-outline:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--primary); }
.btn-lg { padding: 10px 18px; font-size: 15px; font-weight: 700; }
.btn .ic, .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 40px; height: 40px; stroke-width: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* sidebar: full height, navy */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side-w); height: auto; z-index: 30; background: var(--nav-bg); border-right: 0;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 12px 24px; overflow-y: auto; }
.side-brand { display: grid; gap: 4px; padding: 4px 10px 18px; margin-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .12); text-decoration: none; }
.side-brand img { height: 19px; width: auto; justify-self: start; }
.side-brand span { color: var(--nav-text); font-size: 13.5px; }
.nav-head { color: var(--nav-muted); }
.sidebar a { color: var(--nav-text); border-left: 0; padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 500; }
.sidebar a:hover { background: var(--nav-hover); color: #fff; }
.sidebar a.active { background: var(--button-gradient); color: var(--on-gradient); font-weight: 700; }
.sidebar a.active .ic { stroke: currentColor; }
.sidebar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand-gradient); } /* the logo's cyan-to-indigo */
.sidebar a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.sidebar .nav-count { background: #f5a524; color: #1b1300; }
.sidebar .nav-count.ready { background: #4cc7f2; color: #04212c; }
body.signed-in .shell { display: block; margin-left: var(--side-w); }
body.signed-in .topbar, body.signed-in .mode-banner { margin-left: var(--side-w); }
.topbar { background: var(--bg); border-bottom: 1px solid var(--border); padding: 10px 28px; }
.topbar::after { display: none; }
body.signed-in .topbar .brand { display: none; }
main { padding: 24px 28px 64px; }
@media (max-width: 900px) {
  body.signed-in .shell, body.signed-in .topbar, body.signed-in .mode-banner { margin-left: 0; }
  body.signed-in .topbar .brand { display: inline-flex; }
  .topbar { padding: 10px 16px; background: var(--surface); }
  main { padding: 16px 16px 60px; }
  .sidebar { width: min(280px, 85vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
  body.menu-open .sidebar { transform: none; }
}

/* ---- Overview ---- */
.ov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ov-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.ov-sub { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.ov-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.month-pick { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted); }
.month-pick input { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--text); padding: 2px 0; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
a.kpi { text-decoration: none; }
.kpi { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); cursor: pointer; font: inherit; color: var(--text); min-width: 0; }
.kpi:hover { border-color: var(--accent-line); }
.kpi:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kpi-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-ic .ic { width: 24px; height: 24px; }
.kpi-ic.brand { background: var(--accent-soft); color: var(--primary); }
.kpi-ic.green { background: var(--ok-bg); color: var(--ok); }
.kpi-ic.amber { background: var(--warn-bg); color: var(--warn); }
.kpi-ic.red { background: var(--err-bg); color: var(--err); }
.kpi-txt { display: grid; gap: 1px; min-width: 0; }
.kpi-lbl { font-size: 14px; color: var(--text); font-weight: 500; }
.kpi-n { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.ov-alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.ov-alert strong { color: var(--text); font-size: 15.5px; }
.ov-alert .link { margin-left: auto; color: var(--primary); font-weight: 700; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; }
.ov-alert.info { background: var(--accent-soft); color: var(--primary); border-color: var(--accent-line); }
.ov-alert.info span { color: var(--text); }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-team { margin-bottom: 0; }
.ov-team .feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); column-gap: 24px; }
.ov-side { display: grid; gap: 16px; }
.worklist { margin-bottom: 0; }
.ov-grid h2 { font-size: 20px; font-weight: 800; margin: 0 0 12px; }
.wl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab-n::before { content: "("; } .tab-n::after { content: ")"; } .tab-n:empty { display: none; }
.wl-filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.search-box { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface); color: var(--muted); }
.search-box input { border: 0; outline: 0; background: transparent; flex: 1; padding: 9px 0; font: inherit; color: var(--text); min-width: 0; }
.search-box:focus-within { border-color: var(--primary); }
.wl-filters select { min-width: 160px; border-radius: 10px; }
.wl-table th { background: var(--surface-2); }
.wl-table td { vertical-align: middle; }
.wl-table .circuit { font-weight: 700; color: var(--primary); text-decoration: none; }
.actions-cell { white-space: nowrap; }
.wl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pages { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pages .pg { min-width: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.pages .pg.cur { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 700; }
.pages .pg:disabled { opacity: .45; cursor: default; }
.pages .gap { color: var(--muted); }
.ov-drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px; border: 2px dashed var(--accent-line); border-radius: 12px; color: var(--primary); cursor: pointer; }
.ov-drop strong { color: var(--text); font-size: 16px; }
.ov-drop.over, .ov-drop:hover { background: var(--accent-soft); }
.ov-drop:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ov-drop .btn { margin-top: 6px; pointer-events: none; }
.ov-steps { list-style: none; counter-reset: s; padding: 0; margin: 14px 0 8px; display: grid; gap: 10px; }
.ov-steps li { counter-increment: s; display: flex; gap: 10px; align-items: center; }
.ov-steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary); font-weight: 700; font-size: 12px; flex: none; }
.fine { border-top: 1px solid var(--border); padding-top: 10px; margin: 6px 0 0; font-style: italic; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed li::before { content: ""; width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.feed li.feed-ok::before { background: var(--ok-bg); box-shadow: inset 0 0 0 2px var(--ok); }
.feed li.feed-warn::before { background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--warn); }
.feed li.feed-err::before { background: var(--err-bg); box-shadow: inset 0 0 0 2px var(--err); }
.feed li.muted::before { display: none; }
.ov-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 14px 18px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.ov-foot a { font-weight: 700; }
#fu-dialog { max-width: 560px; width: calc(100% - 32px); }
#fu-dialog .field { margin: 10px 0; display: grid; gap: 4px; }
#fu-dialog textarea, #fu-dialog input[type=email] { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
#fu-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } .ov-title { font-size: 24px; } .kpi-n { font-size: 26px; } }
button.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }
.sidebar a.side-brand { display: grid; gap: 4px; padding: 4px 10px 18px; border-radius: 0; font-weight: 400; }
.sidebar a.side-brand:hover { background: none; }
@media (max-width: 520px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpi-ic { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-ic .ic { width: 20px; height: 20px; }
  .kpi-lbl { font-size: 12.5px; }
  .kpi-n { font-size: 24px; }
  .ov-actions { width: 100%; }
}
@media (max-width: 900px) {
  .sidebar { box-shadow: none; visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; }
  body.menu-open .sidebar { box-shadow: 0 10px 40px rgba(0,0,0,.35); visibility: visible; transition: transform .2s ease; }
}

/* Choosing a link (circuit) per file before uploading */
.stage { margin-top: 12px; padding: 14px; border: 1px solid var(--accent-line, var(--border)); border-radius: 12px; background: var(--surface-2); }
.stage-head { margin: 0 0 10px; }
.stage-table td { vertical-align: middle; }
.stage-table .stage-link { width: 100%; min-width: 220px; }
.stage-link.invalid { border-color: var(--err); outline: 1px solid var(--err); }
.stage-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Vendor management */
.page-tabs { margin-bottom: 16px; }
.page-tabs a { padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
.page-tabs a:hover { color: var(--text); }
.page-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.vm-kpis .kpi { cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft, var(--surface-2)); color: var(--text); font-size: 12.5px; margin: 2px 2px 2px 0; }
.chips { margin: 8px 0; }
.vmd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; margin: 8px 0 18px; }
.vmd-grid > div { min-width: 0; }
.vmd-add { display: flex; gap: 8px; margin: 8px 0; }
.vmd-add input { flex: 1; min-width: 0; }
.vmd-links-head { margin-top: 8px; }
.cred-box { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--warn); border-radius: 10px; background: var(--warn-bg); }
.cred-box pre { white-space: pre-wrap; font-size: 13px; margin: 8px 0; color: var(--text); }

/* ---- Renewal watch (Overview) */
.rw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.rw-head h2 { margin: 0 0 2px; }
.rw-head p { margin: 0; max-width: 62ch; }
.rw-days { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.rw-days select { width: auto; }
.rw-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.rw-kpi { display: grid; gap: 2px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--text); }
.rw-kpi:hover { border-color: var(--accent-line); }
.rw-kpi.ok { border-left-color: var(--ok); } .rw-kpi.warn { border-left-color: #d98a00; } .rw-kpi.err { border-left-color: var(--err); }
.rw-lbl { font-size: 13px; font-weight: 500; }
.rw-n { font-size: 26px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rw-sub { font-size: 12px; color: var(--muted); }
.hot { color: var(--err) !important; font-weight: 600; }
.rw-charts { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.rw-chart { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.rw-chart h3 { font-size: 14px; margin: 0 0 8px; }
.rw-chart p { margin: 8px 0 0; }
.rw-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rw-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.ok, .rw-track i.ok { background: var(--ok); } .sw.warn, .rw-track i.warn { background: #e5a019; }
.rw-track i.info { background: var(--info); } .rw-track i.err { background: var(--err); } .rw-track i.brand { background: var(--primary); }
.rw-bars, .rw-stages { display: grid; gap: 8px; }
.rw-bar, .rw-meter { display: grid; grid-template-columns: 112px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; }
.rw-meter { grid-template-columns: 150px 1fr 44px; }
.rw-bar-lbl small { display: block; color: var(--muted); font-size: 11px; }
.rw-bar-n, .rw-meter strong { text-align: right; font-variant-numeric: tabular-nums; }
.rw-track { display: flex; gap: 2px; height: 12px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.rw-track i { display: block; height: 100%; border-radius: 4px; min-width: 0; }
#rw .tabs { margin-top: 4px; }
@media (max-width: 1100px) { .rw-charts { grid-template-columns: 1fr 1fr; } .rw-charts .rw-chart:first-child { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .rw-kpis { grid-template-columns: 1fr 1fr; }
  .rw-charts { grid-template-columns: 1fr; }
  .rw-bar { grid-template-columns: 92px 1fr 44px; } .rw-meter { grid-template-columns: 120px 1fr 40px; }
}

/* ---- Vendor management: pager and vendor page */
.pager-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.per-page { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.per-page select { width: auto; padding: 4px 8px; }
.back-link { display: inline-block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
#company-other { margin-top: 6px; }
/* Top-bar Tally badge: a button anyone can press to test the connection */
.conn-wrap { position: relative; }
button.mode-badge { border: 0; cursor: pointer; font-family: inherit; }
button.mode-badge:hover { filter: brightness(0.96); }
button.mode-badge:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.conn-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); z-index: 60; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(14, 22, 49, .18); padding: 14px 16px; font-size: 13px; }
.conn-pop .cp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.conn-pop .cp-row { display: flex; gap: 10px; padding: 3px 0; }
.conn-pop .cp-row .lbl { color: var(--muted); min-width: 96px; }
.conn-pop .cp-why { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.conn-pop .cp-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.conn-pop .cp-foot .muted { margin-right: auto; }
.set-actions { align-items: center; }
.stat .val.small-val { font-size: 15px; line-height: 1.3; }
.saved-lists { margin-top: 10px; }
.field .inline-check input[type=radio], .field .inline-check input[type=checkbox] { width: auto; flex: none; margin: 3px 0 0; }
/* Users page: who is online */
.presence { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.presence i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.presence.on { color: var(--ok); } .presence.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.presence.idle { color: var(--warn); } .presence.idle i { background: var(--warn); }
.presence.off { color: var(--muted); font-weight: 500; } .presence.off i { background: transparent; border: 1.5px solid var(--muted); }
.users-live { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.conn-suggest .chip { padding: 4px 12px; border: 0; font-family: inherit; }

/* Roles & access: menus and buttons follow the user's permissions */
body:not(.can-post) .need-post, body:not(.can-upload) .need-upload, body:not(.can-manage_users) .need-manage_users, body:not(.can-pay_approve) .need-pay_approve,
body:not(.can-bill_create) .need-bill_create, body:not(.can-bill_approve) .need-bill_approve { display: none !important; }
body:not(.is-super):not(.can-manage_users):not(.can-fin_settings) .need-admin-menu,
body:not(.is-super):not(.can-fin_settings) .need-fin-settings { display: none !important; }
.access-table th.center, .access-table td.center { text-align: center; }
.access-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.access-table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
.access-table tr.muted td { opacity: .6; }

/* Phones: long addresses and codes in help text wrap instead of widening the page */
.settings code, .more code, .more li, .hint code { overflow-wrap: anywhere; word-break: break-word; }
/* Home-screen app on phones with a home bar: keep sticky bottom bars clear of it */
.save-bar { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* Email inbox */
/* email inbox: see the block further down */

/* Link details drawer (Zoho CRM) */
.ld-shade { position: fixed; inset: 0; background: rgba(10, 15, 25, .35); z-index: 80; }
.link-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 81; background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(14, 22, 49, .18); display: flex; flex-direction: column; outline: none; }
.ld-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.ld-head h3 { margin: 2px 0 4px; font-size: 20px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.ld-close { border: 0; background: var(--surface-2); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; flex: none; }
.ld-body { padding: 14px 18px 24px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.ld-checks { display: grid; gap: 6px; }
.ld-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.ld-check > span { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; color: #fff; }
.ld-check.ok { background: var(--ok-bg); } .ld-check.ok > span { background: var(--ok); }
.ld-check.warn { background: var(--warn-bg); } .ld-check.warn > span { background: var(--warn); }
.ld-check.info { background: var(--info-bg); } .ld-check.info > span { background: var(--info); }
.ld-key { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.ld-key dt { color: var(--muted); font-size: 12px; } .ld-key dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ld-all summary { cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.ld-open { font-weight: 700; text-decoration: underline dotted; text-underline-offset: 3px; }
@media (max-width: 520px) { .link-drawer { width: 100vw; border-left: 0; } .ld-key { grid-template-columns: minmax(0, 1fr); } }

/* Modules: chooser, switch, per-module menu */
body[data-module="payments"] .nav-group[data-module]:not([data-module="payments"]),
body[data-module="invoices"] .nav-group[data-module]:not([data-module="invoices"]),
body[data-module="billing"] .nav-group[data-module]:not([data-module="billing"]),
body[data-module="home"] .nav-group[data-module] { display: none; }
.module-switch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 99px;
  color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; background: var(--surface); white-space: nowrap; }
.module-switch:hover { border-color: var(--accent-line); }
.topbar .module-switch { margin-left: auto; } .topbar .module-switch + .conn-wrap { margin-left: 8px; }
.home-wrap { max-width: 980px; margin: 24px auto; }
.home-wrap h1 { font-size: 30px; margin: 0 0 6px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 22px; }
.module-tile { display: grid; gap: 8px; padding: 22px; text-decoration: none; color: var(--text); border: 1px solid var(--border); transition: border-color .15s, transform .15s; }
.module-tile:hover { border-color: var(--primary); transform: translateY(-2px); }
.module-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary); }
.module-ic .ic { width: 24px; height: 24px; }
.module-name { font-size: 20px; font-weight: 700; } .module-desc { color: var(--muted); line-height: 1.45; } .module-go { color: var(--primary); font-weight: 700; }
.access-table th.access-group { border-bottom: 2px solid var(--accent-line); color: var(--primary); }
.access-table th.access-mod { color: var(--primary); }
/* Payments: to pay */
.pay-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay-list { display: grid; gap: 8px; margin-top: 8px; }
.pay-sup { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.pay-sup summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; flex-wrap: wrap; }
.pay-name { font-weight: 700; } .pay-amts { display: inline-flex; gap: 10px; align-items: center; }
.pay-sup .table-wrap { padding: 0 8px 8px; }
@media (max-width: 760px) { .pay-kpis { grid-template-columns: minmax(0, 1fr); } }
.module-switch[hidden] { display: none; }
.topbar .module-switch[hidden] + .conn-wrap { margin-left: auto; }

.module-tile.soon { opacity: .6; } .module-tile.soon .module-go { color: var(--muted); }
#home-hello .back-link { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

/* Payments: picking bills and batches */
.pick-col { width: 34px; } .pick-col input { width: 18px; height: 18px; }
.pay-amt { width: 130px; text-align: right; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.pay-tray { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom)); background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(16, 24, 40, .08); }
.pay-tray .spacer { flex: 1; } .err-text { color: var(--err); font-weight: 600; }
.bt-sup { margin-bottom: 14px; } .bt-sup-head { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.bt-mode { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
.kpi-n.small-val { font-size: 15px; line-height: 1.4; font-weight: 600; } .kpi-n.small-val .link { font-size: 15px; }

.pre-ledger { padding: 0 14px 6px; font-size: 13px; } .pre-ledger select { font: inherit; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.vmd-terms-head { margin-top: 18px; } .choice-row { display: grid; gap: 6px; margin: 6px 0; }

/* Invoices list: who did each step, whom it waits on */
.who-cell { min-width: 190px; max-width: 280px; font-size: 12.5px; line-height: 1.35; }
.who-done { color: var(--muted); }
.who-done strong { color: var(--text); font-weight: 600; }
.who-wait { font-weight: 600; color: var(--warn); margin-bottom: 2px; }
.who-wait.me { color: var(--info); }
#review-sub .who-wait { margin-top: 4px; font-size: 13px; }

/* Payments › Online payments */
.wip-pill { font-size: 10.5px; vertical-align: middle; margin-left: 6px; }
.nav-head .wip-pill { font-size: 9.5px; letter-spacing: 0; text-transform: none; }
.wip-note { margin: 8px 0; }
.kpi-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.kpi-btn.active { outline: 2px solid var(--primary); outline-offset: -2px; }
.po-table td { vertical-align: top; }
.po-portal { min-width: 220px; }
.po-portal .btn { margin: 0 4px 4px 0; }
.po-url { margin-top: 2px; word-break: break-all; }
.txt-err { color: var(--err); } .txt-warn { color: var(--warn); }
#po-pager { align-items: center; }

.po-toggle { border: 0; background: none; cursor: pointer; padding: 0 4px 0 0; font-size: 13px; color: var(--muted); }
.po-member td { background: var(--surface-2); font-size: 13px; }
.po-member td:first-child { padding-left: 34px; }

.po-table td { font-size: 13px; }
.po-bank { margin-top: 2px; color: var(--text); }
.txt-ok { color: var(--ok); }
.bt-res-pick { flex-direction: row; gap: 18px; }
.bt-res-pick .inline-check { font-size: 14px; color: var(--text); }
.bt-res-pick input[type=radio] { width: auto; flex: none; margin: 0; }

.bank-steps { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.bank-steps summary { cursor: pointer; font-weight: 600; }
.bank-steps h3 { font-size: 14px; margin: 14px 0 6px; }
.bank-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.bank-steps ol strong { color: var(--text); }

/* ---------- forecast & due ---------- */
.fc-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .fc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fc-months { display: grid; gap: 8px; }
.fc-month { display: grid; grid-template-columns: 90px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 13px; }
.fc-m { color: var(--muted); }
.fc-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.fc-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.fc-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.fc-table td { vertical-align: top; }
.fc-acts { white-space: nowrap; text-align: right; }
.fc-acts .btn + .btn { margin-left: 6px; }
.fc-ext { color: var(--warn); margin-top: 4px; }
tr.fc-soon > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
tr.fc-urgent > td:first-child { box-shadow: inset 3px 0 0 var(--err); }
tr.fc-urgent { background: var(--err-bg); }
tr.fc-soon { background: var(--warn-bg); }
.app-note { display: block; margin-top: 3px; font-size: 12px; }
@media (max-width: 640px) { .fc-month { grid-template-columns: 70px minmax(0, 1fr) 100px; } .fc-acts { white-space: normal; } .fc-acts .btn { margin: 2px 0; } }
.text-err { color: var(--err); }
.vd-period { align-items: center; gap: 8px; margin-bottom: 12px; }
.vd-ranges { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin: 4px 0 12px; }
.vd-ranges input { width: 120px; }
.vmd-led { min-width: 220px; }
.vmd-led-in { width: 100%; min-width: 220px; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.vmd-led-acts { margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vm-merge { display: flex; gap: 10px; align-items: center; padding: 8px 12px; margin-bottom: 10px; background: var(--info-bg); border-radius: 8px; flex-wrap: wrap; }
.vm-merge-list { margin: 8px 0 12px; padding-left: 18px; }
.vm-merge-list li { margin: 4px 0; }
.vmd-rename { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vmd-rename input { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 260px; }
.vmd-merged { margin-bottom: 16px; }
.learn-tpl { margin: 14px 0 6px; }
.learn-tpl h4 { margin: 0 0 6px; font-size: 15px; }
#set-learning .wl-filters input { min-width: 240px; }

/* Billing (customer invoices) */
.bill-form { align-items: end; }
.bill-form .full, .bill-form h3, .bill-form h4 { grid-column: 1 / -1; }
.bill-form h4 { margin: 14px 0 0; }
.bill-form textarea, .bill-page .field textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-width: 0; resize: vertical; }
.bill-page .check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.bill-page .check input { width: 16px; height: 16px; }
.bill-lines input.pay-amt { width: 96px; text-align: right; }
.bill-lines tr.row-warn td { background: var(--warn-bg); }
.bill-party input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; min-width: 120px; }
.bill-party input.upper { text-transform: uppercase; }
.bill-terms { max-width: 320px; margin-top: 14px; }
.bill-note { max-width: 640px; margin-top: 12px; }
.bill-skip { margin-top: 10px; } .bill-skip summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.bill-skip ul, .bill-events { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.bill-events li { margin: 3px 0; }
#bs-form .set-grid input:disabled, #bs-form textarea:disabled, #bs-form td input:disabled { background: var(--surface-2); color: var(--muted); }
#bs-form td input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; min-width: 140px; }
@media (max-width: 720px) { .bill-form { grid-template-columns: minmax(0, 1fr); } }
#bc-q, #bl-q { min-width: 260px; flex: 1 1 260px; }
.bn-basis { border: 0; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bn-basis legend { font-size: 12px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.bn-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.bn-opt:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }
.bn-opt input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.bn-opt span { display: grid; gap: 3px; } .bn-opt small { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .bn-basis { grid-template-columns: minmax(0, 1fr); } }
.bill-lines input.bl-led { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); min-width: 200px; max-width: 260px; }
.bl-all { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bl-all input { font: inherit; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.bl-totals { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; font-size: 13px; }
.bill-lines td:nth-child(5) { white-space: nowrap; }
.bill-lines td { vertical-align: top; }
.bill-gst input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; min-width: 120px; }
.bill-gst input.upper { text-transform: uppercase; } .bill-gst input:disabled { background: var(--surface-2); color: var(--muted); }
#bs-gst select { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
#bs-gst h4 { margin: 18px 0 4px; }
.pan-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 6px 0 12px; }
.pan-form .field { min-width: 160px; } .pan-form .full { flex-basis: 100%; margin: 0; }
.pan-form input.upper { text-transform: uppercase; }
.card-danger { border-color: var(--err); }
.card-danger h3 { color: var(--err); }
th.bl-ck, td.bl-ck { width: 32px; text-align: center; }
.pk-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 8px 0; }
.pk-filters input[type="search"] { min-width: 260px; flex: 1; }
.pk-wrap { max-height: 520px; overflow: auto; }
.rc-q { margin-bottom: 10px; }
.rc-owner { max-width: 420px; }
.rc-table input.pay-amt, .pk-wrap input.pay-amt { width: 110px; }
.bill-party input.bp-sname { margin-bottom: 4px; }
.hsn-table input, .hsn-table select { width: 100%; }
.spacer { flex: 1; }
.pk-filters input, .pk-filters select, #rc-newbw, .hsn-table input, .hsn-table select { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.pk-filters input:focus, .pk-filters select:focus, #rc-newbw:focus, .hsn-table input:focus, .hsn-table select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.pk-filters input#rl-fill { width: 100px; flex: none; min-width: 0; }
@media (max-width: 640px) { .pk-filters input[type="search"] { min-width: 0; width: 100%; } }
.learn-summary p { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.learn-help { margin-top: 8px; font-size: 14px; }
.learn-help summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.learn-help ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
details.learn-tpl { border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; background: var(--surface); }
details.learn-tpl > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; list-style: none; }
details.learn-tpl > summary::-webkit-details-marker { display: none; }
details.learn-tpl > summary::before { content: "▸"; color: var(--muted); margin-right: 2px; }
details.learn-tpl[open] > summary::before { content: "▾"; }
details.learn-tpl > summary .lt-name { flex: 1; min-width: 200px; }
details.learn-tpl > summary .lt-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
details.learn-tpl > .table-wrap { padding: 0 12px 8px; }
.led-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.led-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.led-row input { flex: 1; min-width: 200px; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.led-row input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.led-row .led-warn { flex-basis: 100%; }
#bs-charge-add { align-self: flex-start; width: auto; }
body:not(.is-super) .sa-col, body:not(.is-super) #vm-rows .pick-col, body:not(.is-super) .vm-kpis .kpi:nth-child(n+3) { display: none !important; }
.rn-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rn-edit input { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.rn-edit input.rn-note { min-width: 140px; flex: 1; }

/* ---- app assistant */
.as-fab { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border: 0; border-radius: 999px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.as-fab svg { width: 20px; height: 20px; }
.as-fab:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.as-panel { position: fixed; right: 20px; bottom: 20px; z-index: 901; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 40px));
  display: flex; flex-direction: column; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22); overflow: hidden; }
.as-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.as-tabs { display: flex; gap: 4px; flex: 1; }
.as-tabs button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.as-tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.as-x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.as-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; padding: 10px 12px; gap: 8px; }
#as-ask { overflow: hidden; padding: 0; }
.as-msgs { flex: 1; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.as-msg { max-width: 100%; padding: 8px 10px; border-radius: 10px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.as-msg p { margin: 0 0 6px; }
.as-msg p:last-child { margin-bottom: 0; }
.as-me { align-self: flex-end; background: var(--primary); color: #fff; max-width: 85%; }
.as-bot { align-self: stretch; background: var(--surface-2); border: 1px solid var(--border); }
.as-wait { color: var(--muted); font-style: italic; }
.as-title { font-weight: 700; }
.as-small { font-size: 12px; color: var(--muted); }
.as-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; background: var(--surface); }
.as-links { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; }
.as-go { font-weight: 600; }
.as-sugg, .as-ex { display: flex; flex-wrap: wrap; gap: 6px; }
.as-sugg { padding: 6px 12px 0; }
.as-chip { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--primary); cursor: pointer; text-align: left; }
.as-chip:hover { border-color: var(--primary); }
.as-form { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--border); }
.as-form input { flex: 1; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.as-tw { overflow: auto; max-height: 260px; margin: 6px 0; border: 1px solid var(--border); border-radius: 6px; }
.as-t { border-collapse: collapse; width: 100%; font-size: 12.5px; background: var(--surface); }
.as-t th, .as-t td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.as-t th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; }
.as-chart { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; }
.as-bar { display: grid; grid-template-columns: minmax(70px, 38%) 1fr auto; gap: 6px; align-items: center; font-size: 12px; }
.as-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-bt { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.as-bt span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.as-bv { font-variant-numeric: tabular-nums; color: var(--muted); }
.as-rate { font-size: 12px; color: var(--muted); margin-top: 6px; }
.as-rate button { border: 0; background: transparent; cursor: pointer; font-size: 14px; padding: 0 3px; }
#as-faq input[type=search] { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.as-fi { border-bottom: 1px solid var(--border); padding: 6px 0; font-size: 14px; }
.as-fi summary { cursor: pointer; font-weight: 600; }
.as-fi p { margin: 6px 0; }
.as-ff { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 13px; }
.as-ff input, .as-ff textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.as-ff fieldset { border: 0; padding: 0; margin: 0; }
@media (max-width: 640px) { .as-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); } .as-fab { right: 12px; bottom: 12px; } }
@media print { .as-fab, .as-panel { display: none !important; } }
.as-ai { font-style: italic; }
.bn-period { display: flex; gap: 8px; flex-wrap: wrap; }
.bn-period select { flex: 1; min-width: 140px; }
.bn-period select:first-child { flex: 0 0 auto; min-width: 120px; }

/* ---- assistant: pending tasks */
.as-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.as-tabs button.on .as-badge { background: #fff; color: var(--primary); }
.as-fab[data-count]:not([data-count=""])::after { content: attr(data-count); position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--err); color: #fff; font-size: 12px; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.as-fab { position: fixed; }
.as-tgroup { margin: 10px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.as-tlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.as-tlist li { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; background: var(--surface); }
.as-tlink { font-weight: 600; }
.as-age { float: right; margin-left: 8px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.as-age-ok { background: #e3f6ea; color: #17633a; } .as-age-yellow { background: #fbf6cf; color: #6b5d00; } .as-age-amber { background: #fff2d6; color: #8a5a00; } .as-age-red { background: #fde3e3; color: #a3221d; }
@media (prefers-color-scheme: dark) { .as-age-ok { background: #173a26; color: #8fe0ad; } .as-age-yellow { background: #3a3510; color: #e9dc72; } .as-age-amber { background: #3d2f12; color: #f3c96b; } .as-age-red { background: #45191a; color: #f59b98; } }
.as-congrats { text-align: center; padding: 18px 8px; }
.as-cg-svg { width: 130px; height: 130px; }
.as-cg-ring { fill: none; stroke: #2fa66a; stroke-width: 6; stroke-dasharray: 280; stroke-dashoffset: 280; animation: as-draw .8s ease-out forwards; }
.as-cg-tick { fill: none; stroke: #2fa66a; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 70; stroke-dashoffset: 70; animation: as-draw .5s .7s ease-out forwards; }
.as-cg-confetti > * { fill: var(--primary); opacity: 0; animation: as-pop .6s 1.1s ease-out forwards; }
.as-cg-confetti > *:nth-child(2n) { fill: #f2b01e; } .as-cg-confetti > *:nth-child(3n) { fill: #e0457b; }
.as-cg-title { font-size: 20px; font-weight: 700; margin: 6px 0 2px; color: #2fa66a; }
@keyframes as-draw { to { stroke-dashoffset: 0; } }
@keyframes as-pop { 0% { opacity: 0; transform: scale(.3); transform-origin: 60px 60px; } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .as-cg-ring, .as-cg-tick, .as-cg-confetti > * { animation: none; stroke-dashoffset: 0; opacity: 1; } }
.as-pop { width: min(560px, calc(100vw - 32px)); max-height: min(80vh, 680px); border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.as-pop::backdrop { background: rgba(10,15,25,.45); }
.as-pop-body { padding: 16px 18px; overflow: auto; max-height: calc(min(80vh, 680px) - 70px); }
.as-pop-head { font-size: 13px; font-weight: 700; color: var(--primary); margin: 0 0 6px; }
.as-pop-acts { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px 14px; border-top: 1px solid var(--border); }
.bs-parents { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.act-days { display: flex; align-items: flex-end; gap: 1px; height: 28px; margin-top: 4px; max-width: 220px; }
.act-days span { flex: 1; min-width: 2px; background: var(--primary); border-radius: 1px; }
.act-days span.zero { background: var(--border); }
.act-where { min-width: 180px; }
.act-mbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border); margin-bottom: 3px; }
.act-mbar .m0 { background: #2f4be0; } .act-mbar .m1 { background: #0e9f8e; } .act-mbar .m2 { background: #f2b01e; }
.act-mbar .m3 { background: #e0457b; } .act-mbar .m4 { background: #8a63d2; } .act-mbar .m5 { background: #9aa3b0; }

/* ---- charts (static/charts.js) */
.ch-tip { position: fixed; z-index: 1000; pointer-events: none; background: var(--text); color: var(--surface); font-size: 12px; line-height: 1.4;
  padding: 6px 9px; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 260px; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ch-plot { position: relative; height: 200px; padding-left: 44px; }
.ch-grid > div { position: absolute; left: 44px; right: 0; border-top: 1px solid var(--grid); }
.ch-grid span { position: absolute; left: -44px; top: -8px; width: 40px; text-align: right; font-size: 11px; color: var(--muted); }
.ch-bars { position: absolute; left: 44px; right: 0; top: 0; bottom: 0; display: flex; align-items: flex-end; gap: 2px; }
.ch-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 3px; outline: none; }
.ch-col:hover .ch-stack, .ch-col:focus .ch-stack { filter: brightness(1.08); }
.ch-stack { display: flex; flex-direction: column-reverse; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.ch-stack span { display: block; min-height: 1px; }
.ch-col em { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ch-cols { margin-bottom: 22px; }
.ch-rows { display: flex; flex-direction: column; gap: 10px; }
.ch-row { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 10px; align-items: center; }
.ch-rl { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-rb { display: flex; flex-direction: column; gap: 2px; }
.ch-hb { display: flex; align-items: center; gap: 6px; height: 9px; outline: none; }
.ch-hb span { display: block; height: 8px; border-radius: 0 4px 4px 0; min-width: 1px; }
.ch-hb em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ch-heat { width: 100%; height: auto; display: block; }
.ch-heat .ch-ax { font-size: 9px; fill: var(--muted); }
.ch-heat rect { outline: none; }
.ch-heat rect:hover, .ch-heat rect:focus { stroke: var(--text); stroke-width: 1.5; }
.ch-heat-key { display: flex; gap: 3px; align-items: center; justify-content: flex-end; margin-top: 6px; font-size: 11px; color: var(--muted); }
.ch-heat-key i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.ch-share { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; }
.ch-share span { outline: none; }
.act-dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.act-dash .card { margin: 0; }
.act-dash .wide { grid-column: 1 / -1; }
.act-dash h3 { margin: 0 0 4px; }
.act-dash .ch-note { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.act-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.act-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.act-kpi b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.act-kpi span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .act-dash { grid-template-columns: 1fr; } }
.act-person td { vertical-align: middle; }
.act-tbar { width: 160px; max-width: 100%; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; outline: none; }
.act-tbar span { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.act-pbar { display: flex; gap: 2px; height: 12px; border-radius: 4px; overflow: hidden; min-width: 4px; }
.act-pbar span { outline: none; }
.pb-ok { background: #2fa66a; } .pb-yellow { background: #e3d33b; } .pb-amber { background: #f08a24; } .pb-red { background: #d03b3b; }
.ch-legend i.pb-ok, .ch-legend i.pb-yellow, .ch-legend i.pb-amber, .ch-legend i.pb-red { display: inline-block; }
.act-plist td { background: var(--surface-2); }
.act-tbar { display: flex; }
.act-tbar span.est { background: repeating-linear-gradient(45deg, var(--s1) 0 3px, transparent 3px 6px); opacity: .7; border-radius: 0 4px 4px 0; }
.act-est { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; outline: none; }
.act-est small { font-size: 10px; }

/* virtual manager */
.mgr-banner { position: fixed; left: 50%; transform: translateX(-50%); top: 10px; z-index: 900; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px);
  background: #fff2d6; color: #5c3d00; border: 1px solid #f1c56b; border-radius: 10px; padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 14px; }
.mgr-lock { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 15, 25, .72); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 40px 16px; }
.mgr-card { background: var(--surface); color: var(--text); border-radius: 14px; max-width: 760px; width: 100%; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.mgr-card h2 { margin: 0 0 6px; font-size: 20px; }
.mgr-task { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; display: grid; gap: 8px; }
.mgr-choice { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; }
.mgr-choice select, .mgr-choice input[type=date] { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
.mgr-row { display: flex; gap: 8px; }
.mgr-row .mgr-reason { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; }
.mgr-verdict { font-weight: 600; font-size: 16px; margin: 0 0 6px; padding: 10px 12px; border-radius: 8px; }
.mgr-great { background: #e3f6ea; color: #17633a; } .mgr-info { background: var(--surface-2); color: var(--text); } .mgr-good { background: #e8f0fe; color: #1c4fa0; } .mgr-bad { background: #fde3e3; color: #a3221d; }
@media (prefers-color-scheme: dark) { .mgr-great { background: #173a26; color: #8fe0ad; } .mgr-good { background: #172a45; color: #9cc2ff; } .mgr-bad { background: #45191a; color: #f59b98; }
  .mgr-banner { background: #3d2f12; color: #f3d38b; border-color: #6b5320; } }
.row-hl td { background: var(--surface-2); }
.as-mgr { font-weight: 600; padding: 8px 10px; border-radius: 8px; margin: 0 0 8px; }
.mgr-common { border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-top: 12px; display: grid; gap: 8px; background: var(--surface-2); }
.mgr-common h3 { margin: 0; font-size: 15px; }
.mgr-own { display: grid; gap: 8px; }
.stage-card { margin-top: 16px; display: grid; gap: 8px; }
.stage-card h3 { margin: 0; }
#module-name .pill { margin-left: 4px; font-size: 10px; }

/* assistant: modes, actions */
.as-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 12px 0; }
.as-mode button { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; padding: 6px 10px; cursor: pointer; text-align: left; display: grid; }
.as-mode button b { font-size: 13px; } .as-mode button small { font-size: 11px; color: var(--muted); }
.as-mode button.on { border-color: var(--accent, #2b59c3); box-shadow: 0 0 0 1px var(--accent, #2b59c3) inset; background: rgba(43,89,195,.08); }
.as-manager .as-mode button[data-m="manager"].on { border-color: #7a3fc0; box-shadow: 0 0 0 1px #7a3fc0 inset; background: rgba(122,63,192,.08); }
.as-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.as-acts .as-act { text-align: left; white-space: normal; }
.as-next { margin-top: 6px; }
.as-ok { color: #17633a; font-weight: 600; }
.as-fu { margin: 0 0 4px; }
.as-nudge { position: fixed; right: 20px; bottom: 84px; z-index: 950; max-width: 340px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-left: 4px solid #2b59c3; border-radius: 12px; padding: 12px 14px 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 14px; animation: as-in .25s ease-out; }
.as-nudge p { margin: 0 18px 6px 0; }
.as-nudge-warn { border-left-color: #f08a24; } .as-nudge-bad { border-left-color: #d03b3b; }
.as-nx { position: absolute; top: 4px; right: 6px; border: 0; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
@keyframes as-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.as-mic { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.as-mic svg { width: 18px; height: 18px; }
.as-mic.on { background: #d03b3b; color: #fff; border-color: #d03b3b; animation: as-pulse 1s infinite; }
@keyframes as-pulse { 50% { box-shadow: 0 0 0 6px rgba(208,59,59,.2); } }
.rw-days { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rw-custom { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rw-custom input[type=date] { width: auto; }
.rw-upd .rn-edit { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.xp-dlg { max-width: 560px; }
.xp-form h3 { margin: 0 0 4px; }
.xp-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.xp-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.xp-roles { border: 0; padding: 0; margin: 8px 0; display: flex; gap: 16px; }
.xp-cols { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: grid; gap: 2px; }
.xp-cols label[hidden] { display: none; }
.xp-group { font-weight: 600; margin: 8px 0 2px; font-size: 13px; color: var(--muted); }
body[data-dept="hr"] .nav-shared { display: none; }  /* Inventory is for every department except HR */
.einv-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.xp-set + .xp-set { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.xp-set h3 { margin: 0; }
.nav-group.mod-hide { display: none; }
.bd-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bd-chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.bd-chip b { margin-left: 4px; }
.bd-chip.active { background: var(--brand, #3b5bdb); color: #fff; border-color: transparent; }
.bd-chip.zero { opacity: .55; }
.bd-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bd-filter input { max-width: 380px; }
.bd-table td { font-size: 13px; vertical-align: top; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pl-card { display: block; color: inherit; text-decoration: none; }
.pl-card:hover { border-color: var(--brand, #3b5bdb); }
.pl-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pl-top h3 { margin: 0; }
.pl-n { font-size: 22px; font-weight: 700; }
.pl-row { display: grid; grid-template-columns: 1.3fr 1fr auto 40px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }

/* ---------- landing page: the customer journey (each department has its own colour, --c) ---------- */
.home-wrap.hx { max-width: 1180px; }
.hx section { margin-top: 26px; }
.hx-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.hx-head h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.hx-kicker { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hx-sub { margin: 6px 0 0; color: var(--muted); max-width: 56ch; font-size: 14.5px; }
.hx-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: end;
  padding: 30px 30px 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); margin-top: 0 !important; }
.hx-hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, #13c2ed 18%, transparent), transparent 70%),
  radial-gradient(520px 260px at 100% 100%, color-mix(in srgb, #3943e8 16%, transparent), transparent 70%); pointer-events: none; }
.hx-hero > * { position: relative; }
.hx-hero h1, .dx-hero h1 { font-size: 34px; letter-spacing: -.02em; margin: 0; }
.hx-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hx-stat { background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; }
.hx-sv { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hx-sl { font-size: 12.5px; color: var(--text); }
.hx-ss { font-size: 11.5px; color: var(--muted); }
.hx-track { list-style: none; margin: 0; padding: 8px 2px 4px; display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: 12px; position: relative; overflow-x: auto; }
.hx-track::before { content: ""; position: absolute; left: 36px; right: 36px; top: 46px; height: 3px; border-radius: 3px; z-index: 0;
  background: var(--brand-gradient); opacity: .7; }
.hx-track::after { content: ""; position: absolute; left: 36px; right: 36px; top: 46px; height: 3px; z-index: 0;
  background: repeating-linear-gradient(90deg, transparent 0 22px, color-mix(in srgb, var(--surface) 85%, transparent) 22px 30px); animation: hx-flow 2.4s linear infinite; }
@keyframes hx-flow { to { background-position: 60px 0; } }
.hx-stop { position: relative; z-index: 1; }
.hx-stop > a, .hx-stop > div { display: grid; gap: 4px; justify-items: start; height: 100%; padding: 14px 14px 12px; border-radius: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c); transition: transform .15s, box-shadow .15s, border-color .15s; }
.hx-stop > a:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--c) 70%, transparent); border-color: color-mix(in srgb, var(--c) 55%, var(--border)); }
.hx-stop > a:focus-visible, .hx-found > a:focus-visible, .dx-mod:focus-visible, .dx-row:focus-visible { outline: 2px solid var(--c, var(--primary)); outline-offset: 2px; }
.hx-step { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.hx-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--c, var(--primary));
  background: color-mix(in srgb, var(--c, var(--primary)) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c, var(--primary)) 30%, transparent); }
.hx-ic .ic { width: 20px; height: 20px; }
.hx-name { font-weight: 700; font-size: 14px; line-height: 1.25; margin-top: 4px; }
.hx-line { font-size: 12px; color: var(--muted); }
.hx-num { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 6px; line-height: 1; }
.hx-lbl { font-size: 11.5px; color: var(--muted); min-height: 16px; }
.hx-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; margin-top: 4px; }
.hx-tag-live { background: var(--ok-bg); color: var(--ok); } .hx-tag-test { background: var(--warn-bg); color: var(--warn); } .hx-tag-soon { background: var(--surface-2); color: var(--muted); }
.hx-stop.locked > div, .hx-found.locked > div { opacity: .55; filter: grayscale(.6); }
.hx-fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hx-found > a, .hx-found > div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 16px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 9%, var(--surface)), var(--surface) 60%); border: 1px solid var(--border); text-decoration: none; color: var(--text); height: 100%; }
.hx-found > a:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--border)); }
.hx-found .hx-ic { grid-row: span 3; }
.hx-fname { font-weight: 700; } .hx-fmods { font-size: 12px; color: var(--muted); grid-column: 2; } .hx-found .hx-line, .hx-found .hx-num { grid-column: 2; }
.hx-found .hx-num.small { font-size: 12.5px; font-weight: 600; margin: 0; }
/* a department's page */
.dx-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px 20px; align-items: center; padding: 26px 28px; border-radius: 18px; margin-top: 10px !important;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--c) 30%, var(--border)); }
.dx-big { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 10px 24px -12px var(--c); }
.dx-big .ic { width: 32px; height: 32px; }
.dx-kpis { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.dx-kpi { display: grid; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--border); min-width: 120px; }
.dx-kpi.main { border-color: color-mix(in srgb, var(--c) 45%, var(--border)); }
.dx-path { display: flex; align-items: center; gap: 0; margin-top: 14px !important; }
.dx-path a { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; text-decoration: none;
  color: var(--c); border: 2px solid color-mix(in srgb, var(--c) 50%, var(--border)); background: var(--surface); }
.dx-path a.on { background: var(--c); color: #fff; border-color: var(--c); }
.dx-path i { flex: 1; max-width: 60px; height: 2px; background: var(--border); }
.dx-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dx-mod { display: grid; gap: 6px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c);
  text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.dx-mod:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, var(--border)); }
.dx-mname { font-weight: 700; font-size: 15px; } .dx-mdesc { font-size: 13px; color: var(--muted); } .dx-mgo { font-size: 13px; color: var(--primary); font-weight: 600; }
.dx-wait { display: grid; gap: 8px; }
.dx-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); text-decoration: none; color: var(--text); }
a.dx-row:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--border)); }
.dx-days { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; display: grid; line-height: 1; }
.dx-days small { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dx-what { display: grid; }
.hx .hot { color: var(--err); }
@media (max-width: 900px) {
  .hx-hero { grid-template-columns: 1fr; padding: 22px; } .hx-hero h1, .dx-hero h1 { font-size: 26px; }
  .hx-track { grid-template-columns: 1fr; } .hx-track::before, .hx-track::after { left: 33px; right: auto; width: 3px; height: auto; top: 30px; bottom: 30px; }
  .hx-track::before { background: linear-gradient(180deg, #13c2ed 0%, #1aa7ee 45%, #3943e8 100%); }
  .hx-track::after { display: none; }
  .hx-stop > a, .hx-stop > div { margin-left: 52px; }
  .hx-fgrid { grid-template-columns: 1fr; }
  .dx-hero { grid-template-columns: 1fr; } .dx-row { grid-template-columns: 52px 1fr; } .dx-row .pill { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { .hx-track::after { animation: none; } .hx-stop > a, .dx-mod { transition: none; } }

/* Live now: departments with a module in production, first on the landing page */
.hx-livesec { display: grid; gap: 12px; }
.hx-live { border-radius: 18px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 13%, var(--surface)), var(--surface) 65%); }
.hx-live-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 20px 22px 14px; text-decoration: none; color: var(--text); }
.hx-live-head > span:nth-child(2) { display: grid; gap: 2px; }
.hx-live-head .hx-kicker { color: var(--c); margin: 0; }
.hx-live-name { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
.hx-live-n { display: grid; justify-items: end; }
.hx-live-n .hx-num { margin: 0; font-size: 30px; }
.hx-live-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 0 22px 20px; }
.hx-live-mod { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); transition: transform .15s, border-color .15s; }
.hx-live-mod:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, var(--border)); }
.hx-live-mod:focus-visible, .hx-live-head:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.hx-live-mod .hx-tag { margin: 0; }
.hx-live-mname { font-weight: 650; }
@media (max-width: 900px) { .hx-live-head { grid-template-columns: auto 1fr; } .hx-live-n { grid-column: 1 / -1; justify-items: start; } }
@media (prefers-reduced-motion: reduce) { .hx-live-mod { transition: none; } }
.hx-hero { grid-template-columns: 1fr; }
.hx-live-head { grid-template-columns: auto 1fr; }
.st-table tbody tr { cursor: pointer; }
.st-table tbody tr:hover { background: var(--surface-2); }
.st-av { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-right: 8px; font-size: 11px; font-weight: 700; vertical-align: middle;
  color: #0aa5cc; background: color-mix(in srgb, #0aa5cc 15%, var(--surface)); }
.st-av.big { width: 52px; height: 52px; font-size: 18px; margin: 0; }
.st-dlg { max-width: 720px; }
.st-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 8px; }
.st-head h3 { margin: 0; font-size: 18px; text-transform: none; letter-spacing: 0; color: var(--text); }
.st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; max-height: 60vh; overflow: auto; margin: 0; }
.st-fields dt { font-size: 11.5px; color: var(--muted); } .st-fields dd { margin: 2px 0 0; word-break: break-word; }
/* tabs made of links (department boards, HR) */
.tabs a.tab { border-bottom: 3px solid transparent; padding: 10px 14px; font-size: 15px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a.tab:hover { color: var(--text); }
.tabs a.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.st-table td { font-size: 13.5px; vertical-align: top; }
.st-table .nowrap { white-space: nowrap; }
.st-name { display: flex; gap: 10px; align-items: flex-start; min-width: 190px; }
.st-name .st-av { margin: 0; flex: 0 0 auto; }
.st-name > span:last-child { display: grid; }
.st-table .who { white-space: nowrap; }

/* filter bar (department boards, HR staff): search with an icon, matching drop-downs */
.bd-filter { gap: 10px; padding: 4px 0 6px; }
.bd-filter input, .bd-filter select { font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--text);
  background-color: var(--surface-2); border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s, background-color .15s; }
.bd-filter input { flex: 1 1 260px; max-width: 420px; padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 16px; }
.bd-filter input::placeholder { color: var(--muted); }
.bd-filter select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; min-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.bd-filter input:hover, .bd-filter select:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.bd-filter input:focus, .bd-filter select:focus { outline: none; background-color: var(--surface); border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.bd-filter select option { background: var(--surface); color: var(--text); }
.bd-filter .muted.small { margin-left: 2px; }
.bd-filter .btn { height: 38px; border-radius: 10px; }
@media (max-width: 700px) { .bd-filter input, .bd-filter select { flex: 1 1 100%; max-width: none; } }

/* Email inbox: counts as tabs, paging, supplier drop-down */
.em-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 6px 0 14px; }
.em-kpi { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; font: inherit; border-top: 3px solid var(--k, var(--border)); transition: transform .15s, border-color .15s; }
.em-kpi.warn { --k: #d48f00; } .em-kpi.ok { --k: #1f9d55; } .em-kpi.muted { --k: #8a94a3; }
.em-kpi:hover { transform: translateY(-2px); }
.em-kpi.on { border-color: var(--k); background: color-mix(in srgb, var(--k) 9%, var(--surface)); }
.em-kpi:focus-visible { outline: 2px solid var(--k); outline-offset: 2px; }
.em-kn { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.em-kl { font-size: 13px; color: var(--muted); font-weight: 600; }
.em-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.em-per { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.em-per select { font: inherit; height: 34px; padding: 0 30px 0 10px; border-radius: 9px; border: 1px solid var(--border); background-color: var(--surface-2); color: var(--text);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
@media (max-width: 700px) { .em-kpis { gap: 8px; } .em-kpi { padding: 10px; } .em-kn { font-size: 20px; } .em-kl { font-size: 11.5px; line-height: 1.25; } }
.em-dupbar, .em-dupnote { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.em-dupbar { margin-bottom: 12px; }
.em-dupbtns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.em-dupnote { margin: 0 0 12px; }
.em-dupok { margin: 0 0 10px; }

/* Email inbox: compact rows; one opens into the preview and the form */
.em-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.em-tools .search-box { flex: 1 1 320px; }
.em-tools > select, .em-per select { font: inherit; height: 38px; padding: 0 30px 0 10px; border-radius: 10px; border: 1px solid var(--border); background-color: var(--surface); color: var(--text); }
.em-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); position: sticky; top: 8px; z-index: 5; }
.em-bulk > span { margin-right: auto; font-size: 13.5px; }
.em-list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: opacity .15s; }
.em-list:empty { display: none; }
.em-list.em-loading { opacity: .55; pointer-events: none; }
.em-cols { --em-grid: 24px minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1.2fr) 118px 18px; }
.em-cols-done { --em-grid: 20px minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, .9fr) auto; }
.em-listhead { display: grid; grid-template-columns: var(--em-grid); gap: 12px; padding: 0 14px 6px 0; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; align-items: center; }
.em-listhead.em-cols-done { padding-left: 14px; }
.em-listhead:empty { display: none; }
.em-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); border-top: 1px solid var(--border); transition: background .12s, opacity .2s; }
.em-row:first-child { border-top: 0; }
.em-row.em-done { grid-template-columns: var(--em-grid); gap: 12px; align-items: center; padding: 10px 14px; }
.em-chk { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.em-listhead .em-chk { width: 36px; margin-right: -12px; }
.em-chk input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.em-sum { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1.2fr) 118px 18px; gap: 12px; align-items: center;
  padding: 10px 14px 10px 0; cursor: pointer; min-width: 0; }
.em-row:not(.em-done):hover { background: var(--surface-2); }
.em-sum:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 6px; }
.em-from, .em-what, .em-by { display: grid; gap: 1px; min-width: 0; }
.em-from > *, .em-what > *, .em-by > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-subj { font-weight: 600; }
.em-kind { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-right: 2px; }
.em-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.em-sug { font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-when { text-align: right; white-space: nowrap; }
.em-chev { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; transition: transform .15s; }
.em-row.open { background: var(--surface-2); }
.em-row.open .em-chev { transform: rotate(90deg); }
.em-row.em-isdup { box-shadow: inset 3px 0 0 var(--err); }
.em-row.em-gone { opacity: .35; }
.em-panel { grid-column: 1 / -1; padding: 4px 14px 16px 36px; }
.em-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.em-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); height: min(62vh, 620px); }
.em-preview iframe { width: 100%; height: 100%; border: 0; display: block; }
.em-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.em-nopreview { height: 100%; display: grid; place-content: center; gap: 4px; text-align: center; padding: 20px; }
.em-side { display: grid; gap: 12px; align-content: start; }
.em-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13.5px; }
.em-facts dt { color: var(--muted); }
.em-facts dd { margin: 0; overflow-wrap: anywhere; }
.em-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.em-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.em-dot.ok { background: var(--ok); }
.em-end { justify-self: end; }
.em-skel { grid-template-columns: 1fr 2fr 1fr !important; gap: 16px; padding: 16px; }
.em-skel span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: em-shimmer 1.2s infinite linear; }
@keyframes em-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .em-skel span { animation: none; } .em-chev, .em-list, .em-row { transition: none; } }
@media (max-width: 900px) {
  .em-body { grid-template-columns: minmax(0, 1fr); }
  .em-preview { height: 50vh; }
}
@media (max-width: 700px) {
  .em-listhead { display: none; }
  .em-sum { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from when" "what what" "tags tags"; gap: 4px 10px; }
  .em-sum .em-from { grid-area: from; } .em-sum .em-what { grid-area: what; } .em-sum .em-tags { grid-area: tags; } .em-sum .em-when { grid-area: when; } .em-sum .em-chev { display: none; }
  .em-row.em-done { grid-template-columns: 12px minmax(0, 1fr); }
  .em-row.em-done .em-what, .em-row.em-done .em-by, .em-row.em-done .em-end { grid-column: 2; justify-self: start; }
  .em-panel { padding-left: 14px; }
  .em-preview { order: 2; height: 42vh; }
  .em-tools > select { flex: 1; }
}
.em-why { color: var(--muted); font-style: italic; }

/* Inventory: correct renewal dates from Excel */
.rb-card { margin-bottom: 14px; display: grid; gap: 10px; }
.rb-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rb-head h2 { margin: 0; font-size: 17px; }
.rb-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rb-pick input[type=file] { font: inherit; max-width: 100%; }
.rb-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.rb-filters .chip { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.rb-filters .chip.on { border-color: var(--primary); background: var(--accent-soft); font-weight: 650; }
.rb-table td { vertical-align: top; }
.rb-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rb-earlier { display: grid; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--warn, #b7791f); border-radius: 10px; }
.rb-earlier label { font-size: 13px; }
.rb-earlier input { max-width: 560px; }
.rn-reason { display: grid; gap: 8px; margin: 10px 0; padding: 12px; border: 1px solid var(--warn, #b7791f); border-radius: 10px; }
.rn-reason .rn-choice { display: flex; gap: 8px; align-items: flex-start; }
.rn-reason ul { margin: 0; padding-left: 18px; }
.err-text { color: var(--err); }

/* HR › Staff: app accounts */
.st-acc { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 10px 12px; margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.st-acc .st-warn { color: var(--err); display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.st-auto { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.st-link { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0 10px; font-size: 13.5px; }
.st-linkset { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.st-linkset select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 260px; }

/* HR › Organisation chart */
.org-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.org-bar .search-box { flex: 1 1 240px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 13.5px; padding: 7px 14px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; }
.seg button.on { background: var(--accent-soft); font-weight: 650; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 22px; padding-left: 14px; border-left: 1px dashed var(--border); }
.org-tree li { margin: 6px 0; }
.org-tree summary { list-style: none; cursor: pointer; display: inline-block; }
.org-tree summary::-webkit-details-marker { display: none; }
.org-tree summary::before { content: "\25B8"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.org-tree details[open] > summary::before { transform: rotate(90deg); }
.org-tree li > .org-card { margin-left: 14px; }
.org-card { display: inline-flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); max-width: 100%; vertical-align: middle; }
.org-card > span:not(.st-av):not(.org-n) { display: grid; gap: 1px; min-width: 0; }
.org-card.hit { border-color: var(--primary); box-shadow: 0 0 0 2px var(--accent-soft); }
.org-card.desig { background: var(--surface-2); }
.org-names { font-size: 12px; color: var(--muted); }
.org-n { margin-left: 4px; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--text); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .org-tree summary::before { transition: none; } }
@media (max-width: 600px) { .org-tree ul { margin-left: 8px; padding-left: 8px; } }

/* Billing settings: Tally names checked against Tally */
.tc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.tc-table td { vertical-align: top; }
.tc-ok { color: var(--ok); font-weight: 600; }
#bs-tally-result:not(:empty) { margin-top: 10px; display: grid; gap: 8px; }

/* Refused by Tally: each ledger of the entry checked against Tally */
.tf-how { margin: 8px 0 0; }
.tf-box:not(:empty) { margin-top: 10px; display: grid; gap: 8px; background: var(--surface, #fff); border-radius: 8px; padding: 8px; color: var(--text, inherit); }
.tf-row { border: 1px solid var(--border, #e3e6ee); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.tf-row.tf-refused { border-color: var(--err, #c0392b); background: color-mix(in srgb, var(--err, #c0392b) 6%, transparent); }
.tf-row.tf-ok { opacity: .85; }
.tf-names { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: baseline; overflow-wrap: anywhere; }
.tf-fix .tf-sel { max-width: 100%; width: 100%; margin-bottom: 4px; }
.tf-fix .btn { margin: 2px 4px 2px 0; }
.tf-party .pick-entry { display: flex; gap: 6px; }

/* supplier picker: create the ledger in Tally when it isn't there */
.sp-create { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg, #fff7e6); display: grid; gap: 6px; }
.sp-create p { margin: 0; }
.sp-create-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-create-row .sp-gstin { flex: 1 1 200px; min-width: 0; }

/* posting problems: diagnosis and attempts */
.diag { display: grid; gap: 4px; }
.diag-raw code { white-space: pre-wrap; word-break: break-word; font-size: 12px; }
.diag-mini { margin-top: 6px; }
.pill-xs { font-size: 10px; padding: 1px 6px; }
.post-why { margin-top: 3px; }
.post-attempts { margin: 8px 0; }
.post-attempts summary { cursor: pointer; font-weight: 600; }

/* Email inbox: received between two days */
.em-dates { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; }
.em-dates label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.em-dates input[type=date] { font: inherit; height: 38px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--border); background-color: var(--surface); color: var(--text); }
.em-tools.em-dated .em-dates input[type=date] { border-color: var(--accent, #3b5bdb); }

/* Email inbox: assigning cases */
#em-assigned { font: inherit; height: 38px; padding: 0 30px 0 10px; border-radius: 10px; border: 1px solid var(--border); background-color: var(--surface); color: var(--text); max-width: 240px; }
.em-assignbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px;
  border: 1px dashed var(--border); background: var(--surface); font-size: 13px; }
.em-assignbar input[type=number] { width: 80px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.em-assignbar select, .em-bulk-assign select { height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; max-width: 260px; }
.em-bulk-assign { display: inline-flex; gap: 6px; align-items: center; }
.em-asg { font-size: 11px; }

/* Invoices list: superadmins assign reviews */
.rv-col { width: 34px; text-align: center; }
.rv-bar { margin: 0 0 8px; }

/* Email inbox: pick the circuit when the ledger names several */
.em-circuit { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--warn, #e8a33d); background: var(--surface); margin: 6px 0; }
.em-circuit p { margin: 0; }
.em-circ-opt { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }

/* HR › Leave, Attendance, Joiners & leavers */
.hr-h { font-size: 16px; margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.hr-seg { margin: 4px 0 12px; }
.hr-actfor { margin-bottom: 12px; max-width: 520px; }
.hr-link { display: block; text-decoration: none; margin-bottom: 12px; }
.hr-warn { color: var(--warn); }
.hr-bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hr-balcard { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--surface); }
.hr-balcard.unpaid { background: var(--surface-2); }
.hr-baltype { font-weight: 600; font-size: 13.5px; }
.hr-baln { font-size: 30px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hr-balcard.unpaid .hr-baln { color: var(--muted); }
.hr-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.hr-cols > .card { margin: 0; }
.hr-apply textarea, .hr-dlg textarea, .hr-form textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; resize: vertical; }
.hr-apply .field, .hr-dlg .field { margin-top: 10px; }
.hr-multi { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.hr-check { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); margin: 10px 0 0; }
.hr-check.ok { background: var(--ok-bg); color: var(--text); }
.hr-check.bad { background: var(--err-bg); color: var(--err); }
.hr-hol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-height: 340px; overflow: auto; }
.hr-hol li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.hr-hol li.past { color: var(--muted); }
.hr-hol .link { margin-left: auto; font-size: 12.5px; }
.hr-reqs { display: grid; gap: 10px; }
.hr-req { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.hr-req-main { display: grid; gap: 3px; min-width: 0; }
.hr-req-act { display: flex; gap: 8px; flex-shrink: 0; }
.hr-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 8px 0; }
.hr-row > .field { min-width: 180px; }
.hr-row input:not([type=checkbox]), .hr-row select, .hr-types input:not([type=checkbox]), .hr-types select, .hr-offs input:not([type=checkbox]), .hr-shifts input:not([type=checkbox]), .hr-ck input, .hr-ck select {
  font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.hr-row h3 { margin: 0; }
.hr-types input[data-k=name], .hr-offs input[data-k=name], .hr-shifts input[data-k=name] { width: 100%; min-width: 140px; }
.hr-ck input[data-f=task] { width: 100%; min-width: 260px; }
.hr-in-n { width: 76px; } .hr-in-s { width: 80px; text-transform: uppercase; } .hr-in-c { width: 112px; }
.hr-checks { display: grid; grid-template-columns: repeat(2, max-content); gap: 2px 12px; font-size: 12.5px; }
.hr-checks label { display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.hr-punch-main { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hr-punch h2 { margin: 6px 0 2px; font-size: 22px; }
.hr-punch .btn-lg { min-width: 160px; font-size: 17px; padding: 14px 22px; }
.hr-loc { margin: 10px 0 0; color: var(--muted); }
.hr-tot { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.hr-totc { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 12.5px; }
.hr-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hr-calh { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; padding: 2px 0; }
.hr-day { min-height: 70px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; background: var(--surface); overflow: hidden; }
.hr-dn { font-weight: 700; font-size: 13px; }
.hr-ds { color: var(--muted); }
.hr-dt { font-variant-numeric: tabular-nums; }
.hr-day.st-present, .hr-day.st-in { background: var(--ok-bg); }
.hr-day.st-late, .hr-day.st-half_day, .hr-day.st-short { background: var(--warn-bg); }
.hr-day.st-absent, .hr-day.st-no_checkout { background: var(--err-bg); }
.hr-day.st-leave, .hr-day.st-worked_off { background: var(--info-bg); }
.hr-day.st-holiday, .hr-day.st-off { background: var(--surface-2); }
.hr-day.st-upcoming, .hr-day.st-untracked { opacity: .55; }
.hr-bulk { padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.hr-tall { max-height: 520px; overflow: auto; }
.hr-sugg ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.hr-sugg li { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--border); }
.hr-click { cursor: pointer; }
.hr-click:hover { background: var(--surface-2); }
.hr-prog { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.hr-prog i { display: block; height: 100%; background: var(--ok); }
.hr-form { padding: 12px 14px; margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.hr-form h3 { margin-top: 0; }
.hr-dlg { width: min(760px, calc(100vw - 32px)); }
.hr-leaver { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin: 8px 0; font-size: 13.5px; }
.hr-tasks { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 2px; }
.hr-tasks li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.hr-tasks label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.hr-tasks li.done span:not(.hr-tmeta):not(.pill) { color: var(--muted); text-decoration: line-through; }
.hr-tasks li.late .hr-tmeta { color: var(--err); }
.hr-tmeta { font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (max-width: 860px) {
  .hr-cols { grid-template-columns: 1fr; }
  .hr-req { flex-direction: column; align-items: stretch; }
  .hr-day { min-height: 52px; font-size: 10.5px; }
  .hr-day .hr-ds { display: none; }
  .hr-punch .btn-lg { width: 100%; }
}
.hr-offs .inline-check, .hr-shifts .inline-check { white-space: nowrap; }
.hr-offs td, .hr-shifts td, .hr-types td { vertical-align: middle; }
.hr-dlg .st-head { grid-template-columns: 1fr auto; }
.hr-dlg .st-head h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Purchases › Renewal analytics */
.rn-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rn-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rn-head h3 { margin: 0; }
.rn-chart { min-height: 220px; }
.rn-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rn-cols > .card { margin: 0; }
.rn-fc-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.rn-fc-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.rn-fc-kpis strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.rn-fc-kpis .rn-warn { border-color: var(--warn); background: var(--warn-bg); }
.rn-more { margin-top: 10px; }
.rn-more summary { cursor: pointer; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
@media (max-width: 860px) {
  .rn-kpis, .rn-fc-kpis, .rn-cols { grid-template-columns: 1fr; }
}
.rn-chart .ch-bars { gap: 6px; }
.rn-chart .ch-col { max-width: 64px; }
.rn-chart .ch-stack { border-radius: 4px 4px 0 0; overflow: hidden; }

/* Renewal analytics: jump bar, filters, summary, details (and every page's Download PDF button) */
.pdf-dl { display: inline-flex; align-items: center; gap: 6px; }
.pdf-dl .ic { width: 16px; height: 16px; }
.rn-jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 0; margin: 0 0 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.rn-jump a { font-size: 13px; padding: 5px 12px; border-radius: 99px; color: var(--muted); text-decoration: none; }
.rn-jump a:hover { background: var(--surface-2); color: var(--text); }
.rn-filters { display: grid; gap: 10px; }
.rn-frow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rn-flbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 52px; }
.rn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rn-chips button { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.rn-chips button:hover { border-color: var(--primary); }
.rn-chips button.on { background: var(--accent-soft, var(--info-bg)); border-color: var(--primary); font-weight: 650; }
.rn-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.rn-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.rn-custom input { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.rn-fnote { margin: 0; }
.rn-insight { font-size: 15px; line-height: 1.55; padding: 14px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); margin: 0 0 16px; }
.rn-kpi .kpi-sub { line-height: 1.4; }
.rn-delta { font-weight: 700; }
.rn-delta.up { color: var(--ok); } .rn-delta.down { color: var(--err); }
.rn-kpi.warn { border-color: var(--warn); }
.rn-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rn-head p { margin: 2px 0 0; }
.rn-how-list { display: grid; gap: 4px; margin-top: 12px; }
.rn-how-row { font: inherit; display: grid; grid-template-columns: 1fr auto 48px; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.rn-how-row:hover { background: var(--surface-2); }
.rn-how-row .muted { text-align: right; }
.rn-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.rn-stats > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.rn-stats strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.rn-stats span { font-size: 12.5px; color: var(--muted); }
.rn-stats .bad strong { color: var(--err); }
.rn-fc-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.rn-fc-kpis strong { font-size: 19px; }
.rn-click { cursor: pointer; }
.rn-click:hover .ch-stack { filter: brightness(1.15); }
.rn-month { margin: 12px 0; padding: 14px; border-radius: 12px; border: 1px solid var(--primary); background: var(--surface); }
.rn-month h3 { margin: 0; font-size: 15px; }
.rn-tall { max-height: 420px; overflow: auto; }
.rn-empty { padding: 40px 0; text-align: center; }
.rn-skel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rn-skel i { height: 96px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: rn-shimmer 1.2s infinite; }
@keyframes rn-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rn-skel i { animation: none; } }
@media (max-width: 860px) {
  .rn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rn-fc-kpis { grid-template-columns: 1fr; }
  .rn-skel { grid-template-columns: 1fr 1fr; }
}

/* The Finance search box: in the middle of the top bar, Finance only */
.nav-search { display: none; position: relative; flex: 0 1 520px; min-width: 220px; margin-left: auto; }
body[data-dept="finance"] .nav-search { display: block; }
.nav-search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.nav-search input { width: 100%; font: inherit; font-size: 14px; padding: 9px 60px 9px 38px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.nav-search input::placeholder { color: var(--muted); }
.nav-search input:hover { border-color: var(--accent-line); }
.nav-search input:focus { outline: 2px solid var(--primary); outline-offset: -1px; background: var(--surface); }
.nav-search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 inherit; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); pointer-events: none; }
.nav-search input:focus ~ kbd { display: none; }
.nav-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 70vh; overflow: auto; z-index: 60;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .28); padding: 6px; }
.nr-head { margin: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-results a.nr-item { display: grid; gap: 1px; padding: 8px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.nav-results a.nr-item:hover, .nav-results a.nr-item.on { background: var(--info-bg); }
.nr-t { font-size: 14px; font-weight: 600; }
.nr-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-empty { margin: 8px 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {   /* phones: a row of its own under the top bar */
  .nav-search { order: 9; flex: 1 1 100%; max-width: none; margin: 2px 0 0; }
  .nav-search kbd { display: none; }
}

/* Overview: why Approved and Posted differ */
.ov-gap { margin: 0 0 18px; }
.ov-gap summary { cursor: pointer; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.ov-gap h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
@media (min-width: 901px) {   /* desktop: one row; the search box gives way first */
  body.signed-in .topbar { flex-wrap: nowrap; }
  .nav-search { flex: 1 1 240px; max-width: 520px; min-width: 180px; }
  .topbar .module-switch, .topbar .conn-wrap, .topbar .user-menu { flex-shrink: 0; }
}
@media (min-width: 901px) and (max-width: 1180px) { .nav-search kbd { display: none; } .nav-search input { padding-right: 14px; } }

/* Every drop-down in the app: the theme's colours, rounded, its own arrow, hover and focus ring (and the browser's
   own controls — date pickers, scrollbars, the option list — follow light / dark) */
:root { color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { color-scheme: dark; } }
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 14px; color: var(--text);
  background-color: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  padding-right: 34px !important;   /* room for the arrow, whatever padding a page gives it */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select:not([multiple]):not([size]):not([class*="pill"]) { padding-left: 12px; padding-top: 7px; padding-bottom: 7px; }
select:hover:not(:disabled) { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
select:focus { outline: none; border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
select:disabled { opacity: .6; cursor: not-allowed; }
select option, select optgroup { background: var(--surface); color: var(--text); }
input[type="date"], input[type="month"], input[type="time"] { font: inherit; color: var(--text); background-color: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; }
input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }

/* Renewal watch: the period as a pill with a calendar, the ISP filter beside the search */
.rw-days label { font-size: 13px; font-weight: 600; color: var(--muted); }
select#rw-days { width: auto; min-width: 170px; height: 40px; border-radius: 99px; font-weight: 600; padding-left: 38px !important;
  background-color: var(--surface); border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234cc7f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-position: right 12px center, left 13px center; background-size: 16px, 17px; }
.rw-custom input[type="date"] { height: 40px; }
.wl-filters { align-items: center; }
.wl-filters .search-box { min-height: 40px; }
.wl-filters select { flex: 0 1 240px; width: auto; min-width: 180px; height: 40px; }
@media (max-width: 700px) { .wl-filters select { flex: 1 1 100%; } .rw-days select { flex: 1 1 auto; } }

/* What's new: the top bar button and the release notes page */
.whats-new { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; white-space: nowrap; position: relative; }
.whats-new:hover { border-color: var(--primary); }
.whats-new .ic { width: 16px; height: 16px; }
.wn-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: var(--primary-text, #fff); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 720px) { .whats-new .wn-label { display: none; } }
.wn-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.wn-filters .wn-search { flex: 0 1 300px; min-width: 220px; }
.wn-day { margin-top: 18px; }
.wn-date { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.wn-note { margin-bottom: 10px; }
.wn-note.wn-new { border-left: 3px solid var(--info); }
.wn-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wn-note h3 { margin: 8px 0 4px; font-size: 15px; text-transform: none; letter-spacing: normal; color: var(--text); }
.wn-note ul { margin: 4px 0 0; padding-left: 20px; }
.wn-note li { margin: 3px 0; line-height: 1.45; }

/* Billing › One-time charges: the note box in the table */
.otc-note { width: 100%; min-width: 140px; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }

/* Renewal watch › Older than: the date picker and the how-long-ago line */
.rw-older-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rw-older-pick input { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.rw-ages { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 13px; }

/* HR › Staff: add / edit an employee, history, fields */
.st-dlg-wide { max-width: 920px; width: calc(100vw - 32px); }
.st-tabs { margin: 4px 0 10px; }
.st-sec-h { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-form { max-height: 68vh; overflow: auto; padding-right: 4px; }
.st-sec { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 12px; margin: 0 0 12px; }
.st-sec legend { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 6px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 16px; }
.st-grid .field { margin: 0; position: relative; }
.st-grid .st-wide { grid-column: 1 / -1; }
.st-grid .field input, .st-grid .field select, .st-grid .field textarea { width: 100%; box-sizing: border-box; }
.st-show { position: absolute; right: 8px; bottom: 8px; font-size: 12px; }
.st-foot { position: sticky; bottom: 0; background: var(--surface); padding-top: 10px; align-items: center; }
.st-foot .muted { margin-right: auto; }
.st-hist { max-height: 60vh; overflow: auto; }
.sf-table td { vertical-align: middle; }
.sf-off td { opacity: .55; }
.sf-dlg { max-width: 640px; width: calc(100vw - 32px); }
.sf-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 4px; font-size: 13.5px; }
.sf-optlist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.sf-optlist li { display: flex; gap: 10px; align-items: center; }
.sf-optlist input[data-o] { flex: 1; min-width: 0; }
@media (max-width: 600px) { .st-grid { grid-template-columns: 1fr; } }
.st-grid .field textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.sf-optlist input[data-o], .sf-form .field input, .sf-form .field select { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }

/* HR › Leave setup: type cards and the type dialog */
.ls-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.ls-type { display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.ls-type:hover, .ls-type:focus-visible { border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.ls-type.off { opacity: .6; }
.ls-type-h { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ls-chks { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }
.ls-chk { display: inline-flex; gap: 6px; align-items: flex-start; font-size: 13.5px; }
.ls-chk small { display: block; color: var(--muted); font-size: 11.5px; }
.ls-who { display: grid; gap: 6px; margin: 6px 0 10px; }
.ls-who details { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.ls-who summary { cursor: pointer; font-size: 13.5px; font-weight: 600; }
.ls-vals { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 0 2px; font-size: 13.5px; }
.ls-vals label { display: inline-flex; gap: 6px; align-items: center; }
.ls-locs select, .ls-holadd select, .ls-holadd input { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.ls-holadd { align-items: flex-start; }
.ls-holadd select[multiple] { min-width: 150px; }
.hr-desc { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin: 4px 0 8px; }

/* Billing: round off tick box */
.bn-check { display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.bn-check input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: -2px; }
.bill-note .bn-check, .bn-check > span { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; font-weight: 400; display: flex; gap: 6px; }

/* a part of a live module still in testing (menu tag, Home stage switch) */
.nav-stage { margin-left: auto; font-style: normal; font-size: .68rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.stage-part { padding-left: 1.6em; }

/* Billing: links with a conflicting status in Zoho CRM (expand for the list) */
.bill-conflicts summary { cursor: pointer; line-height: 1.5; }
.bill-conflicts .table-wrap { margin-top: 10px; }

/* Inventory: links down payment check (file or pasted IDs side by side) */
.lk-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: end; margin: 12px 0; }
.lk-in .actions { grid-column: 1 / -1; flex-wrap: wrap; }
#lk-rows td:last-child { min-width: 240px; }
.lk-in textarea { width: 100%; }
@media (max-width: 760px) { .lk-in { grid-template-columns: 1fr; } }
#lk-card { min-width: 0; max-width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); }
#lk-card .table-wrap { max-width: 100%; overflow-x: auto; }
#or-card { min-width: 0; max-width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); }
#or-card .table-wrap { max-width: 100%; overflow-x: auto; }
#or-rows tr.or-first td { border-top: 2px solid var(--border, #d8dee8); }
#or-rows td:first-child { min-width: 240px; vertical-align: top; }

/* Settings: Zoho Desk has its own connection inside the Zoho card */
.desk-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, #d8dee8); }
.desk-box h3 { margin: 0 0 6px; font-size: 1rem; }
.desk-box #desk-code { min-width: 0; flex: 1 1 260px; }

/* Links & outages: customer / vendor / ticket status filters and sort */
.flt-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 10px 0; }
.flt-bar .field { min-width: 0; flex: 1 1 180px; max-width: 280px; }
.flt-bar select { width: 100%; }
.or-tags { margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.or-due { margin: 4px 0; font-size: .9rem; }
.or-alert { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.chip-warn { border-color: var(--warn, #b26a00); }

/* multi-select filter (customer / vendor / Desk status) */
.ms-label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; }
details.ms { position: relative; }
details.ms > summary { list-style: none; cursor: pointer; border: 1px solid var(--border, #d8dee8); border-radius: 8px; padding: 7px 28px 7px 10px; background: var(--surface, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
details.ms > summary::-webkit-details-marker { display: none; }
details.ms > summary::after { content: "\25BE"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: .6; }
.ms-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(420px, 90vw); background: var(--surface, #fff); border: 1px solid var(--border, #d8dee8); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 8px; }
.ms-q { width: 100%; margin-bottom: 6px; }
.ms-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.ms-opt { display: flex; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.ms-opt:hover { background: var(--hover, rgba(0,0,0,.04)); }
.ms-foot { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--border, #d8dee8); padding-top: 6px; }
.or-actions { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.ms-opt { flex-direction: row; justify-content: flex-start; margin: 0; font-weight: 400; }
.ms-opt input[type="checkbox"] { width: auto; height: auto; margin: 0; flex: 0 0 auto; }
.ms-opt span { flex: 1 1 auto; min-width: 0; }

/* Payables (payments through Tally) */
.page-head .head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.py-table td { vertical-align: top; }
.py-cell { min-width: 280px; }
.py-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 0; }
.py-line + .py-line { border-top: 1px dashed var(--border, #e5e7eb); }
.py-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.py-cands { flex-basis: 100%; }
.py-cand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0; font-size: 0.9em; }
.py-bank { margin: 6px 0 10px; }
.actions-row { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.bank-verify { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.bank-table input:not([type=radio]), .bank-table select { width: 100%; }
.bank-table td:nth-child(3) { text-align: center; }

/* Verify in Tally, next to every ledger field */
.tv-btn { width: auto !important; align-self: flex-start; justify-self: start; margin-top: 4px; font-size: 0.78rem; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border, #d0d7de); background: transparent; color: inherit; cursor: pointer; }
.tv-btn:hover { border-color: var(--accent, #5b8def); }
.tv-btn:disabled { opacity: 0.6; cursor: wait; }
.tv-out { display: inline-block; margin: 4px 0 0 6px; font-size: 0.8rem; vertical-align: middle; }
.tv-ok { color: var(--ok, #1a7f37); }
.tv-bad { color: var(--err, #cf222e); }
.tv-fix { font-size: 0.78rem; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
td .tv-out { display: block; margin-left: 0; }
.py-split { display: grid; gap: 1px; margin-top: 4px; color: var(--muted, #667); }
.py-split strong { color: inherit; }
/* Pay first, invoice later */
.adv-results, #adv-due { display: grid; gap: 6px; margin-top: 8px; }
.adv-pick { display: grid; gap: 2px; text-align: left; padding: 8px 12px; border: 1px solid var(--border, #d0d7de); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.adv-pick:hover, .adv-pick:focus-visible { border-color: var(--accent, #5b8def); }
.adv-pay { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border, #d0d7de); display: grid; gap: 12px; }
.adv-link { display: grid; gap: 2px; }
.adv-found { margin-top: 6px; text-align: left; white-space: normal; }

/* Pending tasks at the top of the left menu */
.side-tasks { margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.side-tasks-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px; background: transparent; border: 0;
  color: var(--nav-muted); font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.side-tasks-head:focus-visible { outline: 2px solid var(--nav-text); border-radius: 6px; }
.side-tasks-head::after { content: "▾"; font-size: 12px; margin-left: auto; transition: transform .15s; }
.side-tasks.collapsed .side-tasks-head::after { transform: rotate(-90deg); }
.side-tasks.collapsed .side-tasks-list, .side-tasks.collapsed .side-tasks-all { display: none; }
.side-tasks-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.sidebar .side-tasks-list a { display: block; padding: 6px 12px; font-size: 13px; font-weight: 400; line-height: 1.35; border-radius: 8px; }
.side-tasks-list .as-age { font-size: 10.5px; padding: 0 6px; }
.side-task-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-tasks-none { padding: 6px 12px; font-size: 13px; color: var(--nav-muted); }
.sidebar .side-tasks-all { margin: 4px 12px 0; padding: 0; font-size: 12.5px; color: var(--nav-text); background: none; border: 0; text-decoration: underline; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .side-tasks-head::after { transition: none; } }

/* Finance › Today (superadmins and the developer): four headline tiles, what needs attention, the rest folded away */
.fin-today { display: grid; gap: 12px; }
.ft-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .ft-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .ft-tiles { grid-template-columns: minmax(0, 1fr); } }
.ft-tile { display: grid; gap: 4px; align-content: start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s; }
.ft-tile:hover, .ft-tile:focus-visible { border-color: var(--primary); }
.ft-label { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ft-big { font-size: 1.9rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ft-sub { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.ft-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ft-bar span { display: block; height: 100%; background: var(--ok, #1a7f37); border-radius: 999px; }
.ft-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .88rem; color: inherit; text-decoration: none; }
.ft-chip:hover { border-color: var(--primary); }
.ft-chip.hot { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.ft-more summary { cursor: pointer; font-size: .88rem; color: var(--muted); }
.ft-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
@media (max-width: 900px) { .ft-cols { grid-template-columns: minmax(0, 1fr); } }
.ft-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.ft-cols li { display: grid; grid-template-columns: minmax(0, 1fr) auto 9ch; gap: 8px; }
.ft-cols li span:nth-child(n+2) { text-align: right; }
.ft-cols li.h { display: block; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; color: var(--muted); }

/* Paste a screenshot into a payment proof field */
.paste-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; }
.paste-hint { font-size: .85rem; color: var(--muted); }
.paste-preview { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: .85rem; overflow-wrap: anywhere; }
.paste-preview img { max-width: 96px; max-height: 64px; border-radius: 4px; border: 1px solid var(--border); object-fit: cover; }

/* ---- Orbit by Connect4Sure: the lockup (the "4" in an orbit ring, the word Orbit, "by Connect4Sure") */
.orbit { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.orbit-mark { width: 38px; height: 38px; flex: none; overflow: visible; }
.orbit-txt { display: grid; line-height: 1.05; }
.orbit-word { font-size: 24px; font-weight: 800; letter-spacing: -.02em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.orbit-by { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand.orbit span { padding: 0; border: 0; }
.brand.orbit .orbit-mark { width: 30px; height: 30px; }
.brand.orbit .orbit-word { font-size: 19px; }
.brand.orbit .orbit-by { font-size: 9.5px; }
.sidebar a.side-brand.orbit { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.side-brand.orbit .orbit-word { background: var(--wordmark-on-dark); -webkit-background-clip: text; background-clip: text; }
.side-brand.orbit .orbit-by { color: var(--nav-muted); }
.orbit-lg { flex-direction: column; gap: 6px; }
.orbit-lg .orbit-mark { width: 84px; height: 84px; }
.orbit-lg .orbit-txt { justify-items: center; }
.orbit-lg .orbit-word { font-size: 40px; }
.orbit-lg .orbit-by { font-size: 12px; }
.login-brand > span { text-transform: none; letter-spacing: 0; font-weight: 500; }
/* older brand rules (.login-brand span, .side-brand span) must not restyle the lockup's own parts */
.login-brand .orbit .orbit-word, .sidebar .side-brand.orbit .orbit-word, .topbar .brand.orbit .orbit-word {
  text-transform: none; letter-spacing: -.02em; font-weight: 800; color: transparent; padding: 0; border: 0; }
.login-brand .orbit .orbit-word { font-size: 40px; }
.login-brand .orbit .orbit-by, .sidebar .side-brand.orbit .orbit-by, .topbar .brand.orbit .orbit-by {
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 0; border: 0; }
.login-brand .orbit .orbit-by { font-size: 12px; color: var(--muted); }
.login-brand .orbit .orbit-txt { padding: 0; border: 0; }
.sidebar .side-brand.orbit .orbit-word { font-size: 23px; }
.sidebar .side-brand.orbit .orbit-by { font-size: 9.5px; color: var(--nav-muted); }
.sidebar .side-brand.orbit .orbit-txt { color: inherit; font-size: inherit; }
.sign-dlg { width: min(980px, 96vw); }
.sign-view { width: 100%; height: min(70vh, 780px); border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.pd-ok { color: var(--ok, #1a7f37); }
.pd-warn { color: var(--warn, #9a6700); }
.sign-steps { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.mail-dlg { width: min(640px, 94vw); }
.mail-dlg input, .mail-dlg textarea { width: 100%; }
.adv-bar { display: flex; justify-content: flex-end; margin: 0.5rem 0; }
.gst-addrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.gst-addrs textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); resize: vertical; }

/* Top bar: quick switch between a department's areas (Finance: Purchases, Payments, Billing) */
.mod-hop { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 99px;
  background: var(--surface-2); flex-shrink: 0; }
.mod-hop[hidden] { display: none; }
.mod-hop a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; color: var(--muted);
  text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mod-hop a .ic { width: 15px; height: 15px; }
.mod-hop a:hover { color: var(--text); background: var(--surface); }
.mod-hop a.on { color: var(--primary); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.mod-hop a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.topbar .mod-hop { flex: 0 0 auto; flex-wrap: nowrap; order: 0; overflow: visible; }   /* not the old full-row nav rules */
.topbar .module-switch + .mod-hop { margin-left: 8px; }
.topbar .mod-hop + .conn-wrap { margin-left: 8px; }
@media (max-width: 1180px) { .mod-hop a { padding: 5px 9px; } .mod-hop a span { display: none; } }   /* icons only; the name is in the tooltip */
@media (max-width: 700px) {   /* phones: its own row, the three areas spread evenly, with their names */
  .topbar .mod-hop { flex: 1 1 100%; }
  .mod-hop a { flex: 1; justify-content: center; padding: 6px 8px; } .mod-hop a span { display: inline; }
}
.tally-wait { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1000;
  display: flex; gap: 12px; align-items: flex-start; max-width: min(560px, 92vw); padding: 12px 16px; border-radius: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); font-size: 14px; }
.tally-wait .tw-spin { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: tw-spin .8s linear infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tally-wait .tw-spin { animation: none; } }
/* Billing lists: "What needs doing" tiles, short one-line rows, month groups */
.bl-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin: 0 0 12px; }
.bl-q { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.bl-q:hover { border-color: var(--primary); }
.bl-q.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; background: var(--info-bg); }
.bl-q.empty { opacity: .55; }
.bl-q-open { grid-column: span 2; }
.bl-q-t { font-size: 12px; color: var(--muted); font-weight: 600; }
.bl-q-n { font-size: 20px; font-weight: 700; line-height: 1.1; }
.bl-q-a { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bl-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.bl-filters input[type=search] { flex: 1 1 260px; min-width: 0; }
.bl-card { padding-top: 4px; }
.bl-table td { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; }
.bl-table .bl-cust { max-width: 360px; }
.bl-table .bl-next { text-align: right; white-space: nowrap; }
.bl-table tr.bl-month td { background: var(--bg); font-weight: 700; font-size: 13px; padding-top: 10px; padding-bottom: 6px; }
.bl-more { justify-content: center; }
.nowrap { white-space: nowrap; }
/* Billing invoice page: progress bar, More menu, facts strip, folded sections */
.bi-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bi-total { font-size: .8em; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bi-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; padding: 0; }
.bi-step { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.bi-step.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-bg); }
.bi-step.now { color: var(--text); border-color: var(--primary); font-weight: 700; box-shadow: 0 0 0 1px var(--primary) inset; }
.bi-step.bi-cancel { color: var(--err); border-color: var(--err); }
.more-menu { position: relative; display: inline-block; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; display: flex; flex-direction: column; gap: 4px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.more-pop .btn { justify-content: flex-start; width: 100%; }
.bi-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; padding: 14px 18px; }
.bf-f { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bf-f > span { font-size: 12px; color: var(--muted); }
.bf-f > strong { font-weight: 600; overflow-wrap: anywhere; }
.bf-f.wide { grid-column: span 2; }
.bf-f.total > strong { font-size: 1.25em; }
.bi-fold > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.bi-fold > summary::-webkit-details-marker { display: none; }
.bi-fold > summary h3 { margin: 0; }
.bi-fold > summary h3::before { content: "▸ "; color: var(--muted); }
.bi-fold[open] > summary h3::before { content: "▾ "; }
.bi-fold[open] > summary { margin-bottom: 10px; }
.drawer-shade { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .35); }
.bq-drawer { width: min(640px, 100vw); }
.bq-drawer .bi-facts { padding: 10px 0; border: 0; box-shadow: none; background: transparent; }
.bq-acts { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; border-top: 1px solid var(--border); }
/* the top bar never wider than the screen: on narrower laptops "What's new" shows its icon and count only, the search
   box gives way, and a long Tally badge is cut with "…" (its full text is in its tooltip) */
@media (max-width: 1520px) {
  .topbar .wn-label { display: none; }
  .topbar .nav-search { min-width: 150px; }
  .topbar #mode-badge { max-width: 200px; }
  .topbar #mode-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
/* Billing customer page: tabs, "at a glance" tiles */
.bc-tabs { margin: 0 0 12px; }
.bc-glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.bc-glance-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.bc-glance-t:hover { border-color: var(--primary); }
.bc-glance-t > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bc-glance-t > strong { font-size: 18px; overflow-wrap: anywhere; }
.bc-glance-t > small { color: var(--muted); }
.bc-glance-t.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); }
.bc-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px 18px; }
.po-head-acts { margin: 0 0 12px; }
.span-all { grid-column: 1 / -1; }

/* NOC tickets */
.noc-hot { border-color: var(--err) !important; }
.noc-hot .bl-q-n { color: var(--err); }
.noc-table td { vertical-align: top; }
.noc-row { cursor: pointer; }
.noc-row:hover, .noc-row:focus { background: var(--surface-2); outline: none; }
.noc-row.unread td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.noc-high td { background: var(--err-bg); }
.noc-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 14px; margin: 10px 0; }
.noc-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; align-items: end; margin: 10px 0; }
.noc-links { margin: 4px 0 10px; padding-left: 18px; }
.noc-links li { margin: 2px 0; }
.noc-tl { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 8px; }
.noc-ev { border-left: 3px solid var(--border); padding: 2px 0 2px 10px; }
.noc-ev-nms_down, .noc-ev-site_down, .noc-ev-flap, .noc-ev-down { border-left-color: var(--err); }
.noc-ev-nms_up, .noc-ev-site_up, .noc-ev-resolved, .noc-ev-paid, .noc-ev-up { border-left-color: var(--ok); }
.noc-ev-mail_in { border-left-color: var(--primary); }
.noc-ev-to_finance, .noc-ev-invoice { border-left-color: var(--warn); }
.noc-ev-t { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.noc-ev-mail_out { border-left-color: var(--info); }
.noc-ev-mail_failed { border-left-color: var(--err); }
/* a mail on the ticket timeline and in the Mailbox */
.nm-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 4px; background: var(--surface); display: grid; gap: 4px; min-width: 0; }
.nm-card.nm-out { background: var(--surface-2); }
.nm-head, .nm-subj { overflow-wrap: anywhere; }
.nm-subj { font-weight: 600; }
.nm-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.nm-fold { max-height: 15em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.nm-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-att { font-size: 12px; border: 1px solid var(--border); border-radius: 99px; padding: 2px 10px; background: var(--surface); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.nm-att:hover { border-color: var(--primary); color: var(--primary); }
.nm-acts { display: flex; gap: 6px; }
.nm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.nm-bar .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-bar input[type=search] { min-width: 220px; font: inherit; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.nm-sort { flex-wrap: wrap; margin-top: 10px; }
.nm-sort input { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.nt-mailf { display: grid; gap: 6px; }
.nt-mailrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.nt-mailrow .field { margin: 0; }
.nt-files { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nr-grid { display: grid; gap: 6px; margin-bottom: 8px; }
.nr-tpl { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.nr-tpl textarea { width: 100%; }
.nt-compose textarea, .nr-tpl textarea { font: inherit; }
.noc-fin { border: 1px solid var(--warn); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: var(--warn-bg); }
.noc-file { cursor: pointer; }
.noc-inline { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.noc-inline input { flex: 1 1 220px; min-width: 0; }
.noc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.noc-grid .card { min-width: 0; }
.noc-wide { grid-column: 1 / -1; }
.noc-days { max-width: 200px; margin-bottom: 10px; }
.noc-group { padding: 8px 0; border-bottom: 1px solid var(--border); }
.noc-gform { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.noc-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* Payments made */
.pm-d { margin: 0; }
#pm-q { align-self: flex-end; }


/* New Tally ledger */
.nl-found { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.nl-picked { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.nl-chip { display: inline-flex; align-items: center; gap: 6px; }
.np-find { margin-top: 6px; }
.np-q { width: 100%; min-width: 160px; }

/* NOC desk: views rail, filters, ticket list, bulk bar (static/pages/noc.js) */
.nd { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.nd-rail { position: sticky; top: 12px; display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 8px; }
.nd-rail-g { display: grid; gap: 2px; }
.nd-rail-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px 4px; }
.nd-v { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none;
  color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.nd-v:hover { background: var(--surface-2); }
.nd-v.active { background: var(--info-bg); color: var(--primary); font-weight: 600; }
.nd-v-n { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); min-width: 22px; text-align: right; }
.nd-v.hot .nd-v-n { color: var(--err); font-weight: 700; }
.nd-rail-foot { padding: 6px 8px 0; border-top: 1px solid var(--border); line-height: 1.5; }
.nd-main { padding: 0; overflow: hidden; }
.nd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px 8px; }
.nd-bar input[type=search] { flex: 1 1 280px; min-width: 0; }
.nd-bar-r { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nd-avail { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.nd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.nd-avail.away .nd-dot { background: var(--muted); }
.nd-avail.away { color: var(--muted); }
.nd-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 14px 10px; border-bottom: 1px solid var(--border); }
.nd-filters select { width: auto; flex: 0 1 auto; font-size: 12px; padding: 4px 24px 4px 8px; max-width: 190px; min-height: 0; }
.nd-sort { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.nd-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 14px; background: var(--info-bg); border-bottom: 1px solid var(--border); }
.nd-bulk select { width: auto; font-size: 12px; padding: 4px 24px 4px 8px; min-height: 0; }
.nd-bres { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.nd-bres input { flex: 1 1 220px; min-width: 0; }
.nd-head, .nd-row { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr) 120px 130px 150px 72px; gap: 10px; align-items: center; padding: 8px 14px; }
.nd-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); padding-block: 6px; }
.nd-head > span:nth-child(2) { grid-column: 2 / 4; }
.nd-row { border-bottom: 1px solid var(--border); }
.nd-row:hover { background: var(--surface-2); }
.nd-row.picked { background: var(--info-bg); }
.nd-row.unread { box-shadow: inset 3px 0 0 var(--primary); }
.nd-pri { font-size: 11px; font-weight: 700; text-align: center; border-radius: 6px; padding: 3px 0; background: var(--surface-2); color: var(--muted); }
.nd-pri-P1 { background: var(--err); color: #fff; }
.nd-pri-P2 { background: var(--err-bg); color: var(--err); }
.nd-pri-P3 { background: var(--warn-bg); color: var(--warn); }
.nd-t { display: grid; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.nd-t:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.nd-t1 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.nd-no { font-size: 12px; color: var(--muted); }
.nd-title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nd-row.unread .nd-title { font-weight: 700; }
.nd-t2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-sla { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.nd-sla-warn { background: var(--warn-bg); color: var(--warn); }
.nd-sla-bad { background: var(--err-bg); color: var(--err); }
.nd-sla-ok { background: var(--ok-bg); color: var(--ok); }
.nd-sla-hold { background: var(--info-bg); color: var(--info); }
.nd-c-with { display: flex; gap: 8px; align-items: center; min-width: 0; }
.nd-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-av { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--info-bg); color: var(--primary); font-size: 11px; font-weight: 700; }
.nd-av-none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border); }
.nd-empty { padding: 28px 14px; text-align: center; }
.nd-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; }
@media (max-width: 1100px) {
  .nd-head, .nd-row { grid-template-columns: 28px 34px minmax(0, 1fr) 110px 120px; }
  .nd-head > span:nth-child(5), .nd-head > span:nth-child(6), .nd-c-with, .nd-c-upd { display: none; }
}
@media (max-width: 860px) {
  .nd { grid-template-columns: minmax(0, 1fr); }
  .nd-rail { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 6px; }
  .nd-rail-g { display: flex; gap: 4px; }
  .nd-rail-h, .nd-rail-foot { display: none; }
  .nd-v { width: auto; white-space: nowrap; }
  .nd-head { display: none; }
  .nd-row { grid-template-columns: 24px 30px minmax(0, 1fr); row-gap: 6px; }
  .nd-c-sla, .nd-c-st { grid-column: 3; }
  .nd-sort { margin-left: 0; }
}
/* the ticket: conversation on the left, properties on the right */
.noc-drawer { width: min(1180px, 100vw); }
.nt-headline { min-width: 0; }
.nt-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.nt-nav { display: flex; gap: 6px; align-items: flex-start; }
.nt { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.nt-left { min-width: 0; display: grid; gap: 10px; }
.nt-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-compose { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; }
.nt-compose textarea { width: 100%; }
.nt-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.nt-tab { border: 0; background: none; padding: 4px 10px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.nt-tab.active { background: var(--info-bg); color: var(--primary); font-weight: 600; }
.nt-tl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nt-tl-f { display: flex; gap: 10px; }
.nt-tl-f .active { font-weight: 700; text-decoration: underline; }
.noc-ev.talk { background: var(--surface-2); border-radius: 0 8px 8px 0; padding: 6px 10px; }
.nt-right { display: grid; gap: 10px; position: sticky; top: 0; }
.nt-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: grid; gap: 8px; }
.nt-card h4 { margin: 0; font-size: 13px; }
.nt-card .field { margin: 0; }
.nt-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 13px; }
.nt-kv > span { color: var(--muted); font-size: 12px; }
.nt-kv .noc-links { margin: 0; }
.nt-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.nt-bar span { display: block; height: 100%; background: var(--ok); }
.nt-bar.warn span { background: var(--warn); }
.nt-bar.bad span { background: var(--err); }
.nt-new { display: grid; gap: 10px; max-width: 640px; }
.nt-new-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
@media (max-width: 900px) { .nt { grid-template-columns: minmax(0, 1fr); } .nt-right { position: static; } }
/* setup and policy */
.ns-jump { margin: 0 0 12px; }
.ns-mem { display: inline-flex; gap: 4px; align-items: center; margin-right: 10px; }
.ns-wide { flex: 1 1 320px; }
.ns-pol { display: grid; gap: 10px; }
.ns-esc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; }
.ns-esc .np-pct { width: 80px; }
.nh-week { display: grid; gap: 6px; margin: 8px 0; }
.nh-day { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.nh-day strong { width: 40px; }
.np ul { padding-left: 20px; line-height: 1.6; max-width: 80ch; }
.np-rfo { columns: 2 260px; }
.txt-info { color: var(--info); }

/* ---------- Sales and Service Operations (static/pages/ops.js) ---------- */
.ops-drawer { width: min(780px, 100vw); }
.ops-drawer .nt-headline h3 { text-transform: none; letter-spacing: 0; font-family: inherit; font-size: 18px; color: var(--text); margin: 2px 0 4px; }
.ops-opt .inline-check { white-space: nowrap; color: var(--text); }
.ops-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ops-bar .bd-stages { margin: 0; flex-basis: 100%; }
.ops-bar select { width: auto; }
.ops-sec { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ops-sec:last-child { border-bottom: 0; }
.ops-sec h3, .card > h3 { margin-top: 4px; }
.ops-sec-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ops-sec-h h3 { margin: 0; }
.ops-sec-h .actions { margin: 0; }
.ops-form textarea, .ops-sec textarea, .ops-sec .field input, .ops-sec .field select, .card .field textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; min-width: 0; }
.ops-done { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; border: 0; }
.ops-ev { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 80ch; }
.ops-ev li { border-left: 2px solid var(--border); padding-left: 10px; }
.ops-docs { margin: 0; padding-left: 18px; line-height: 1.8; }
.ops-sug { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.ops-crumb { margin-bottom: 8px; }
.ops-hero { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.ops-hero h2 { margin: 4px 0; }
.ops-hero > div:first-child { min-width: 0; }
.ops-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.ops-li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--border); }
.ops-li:last-child { border-bottom: 0; }
.ops-li.click, .click.ops-li { cursor: pointer; }
.ops-li.click:hover { background: var(--surface-2); }
.ops-li input[data-rn] { flex: 1 1 240px; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.ops-isp { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 6px; }
.ops-isp.dim { opacity: .55; }
.ops-isp-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ops-isp .actions { margin: 0; }
.ops-opt th, .ops-opt td { padding: 5px 8px; font-size: 13px; }
.ops-opt tr.chosen td { background: var(--ok-bg); }
.ops-opt input, .ops-opt select, .ops-qedit input, .ops-qedit select { font: inherit; padding: 5px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); width: 100%; min-width: 70px; }
.ops-ispform { margin-top: 10px; background: var(--surface-2); }
.ops-fin { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.ops-sale { font-size: 13px; margin: 4px 0 8px; }
.ops-mem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.ops-mem select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
@media (max-width: 640px) { .ops-mem { grid-template-columns: 1fr; } }

/* Sales and Service Operations, Phase B: dashboards */
.ops-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.ops-dash .card { margin: 0; min-width: 0; }
.ops-dash .card:first-child { grid-column: 1 / -1; }
.ops-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.ops-tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px; background: var(--surface); }
.ops-tile b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text); }
.ops-tile span { font-size: 12px; color: var(--muted); }
.ops-bars { display: grid; gap: 6px; }
.ops-barrow { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3rem; gap: 10px; align-items: center; font-size: 13px; }
.ops-barlbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ops-meter > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.ops-stack { display: flex; height: 8px; min-width: 90px; border-radius: 4px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.ops-stack span, .ops-legend span { display: inline-block; height: 100%; }
.ops-stack .ok, .ops-legend .ok { background: var(--ok); }
.ops-stack .bad, .ops-legend .bad { background: var(--err); }
.ops-stack .hold, .ops-legend .hold { background: var(--warn); }
.ops-legend span { width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.ops-legend span:first-child { margin-left: 0; }
.ops-poedit td:first-child input { min-width: 240px; }
.ops-poedit input[type="date"] { min-width: 130px; }
