/* ProducerMatrix. Look: steel filing cabinet, signature-blue ink, manila folder tabs. */

:root {
  --ink: #16202b;
  --ink-2: #44515e;
  --ink-3: #5d6976;
  --line: #cfd6de;
  --line-soft: #e4e8ed;
  --bg: #eceff3;
  --surface: #ffffff;
  --band: #f4f6f8;
  --blue: #1f47b8;
  --blue-dark: #17368c;
  --blue-wash: #e9eefb;
  --manila: #f0d9a0;
  --manila-deep: #d9bd76;
  --manila-wash: #fbf5e3;
  --manila-ink: #4f3f10;
  --green: #17693f;
  --green-wash: #e2f2e9;
  --amber: #8a4f00;
  --amber-wash: #fbecd2;
  --red: #a8231c;
  --red-wash: #fae7e5;
  --chrome: #172230;
  --radius: 8px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'IBM Plex Sans Condensed', 'IBM Plex Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.icon { flex: none; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.late { color: var(--red); font-weight: 500; }
.soon { color: var(--amber); font-weight: 500; }
.done { color: var(--ink-3); text-decoration: line-through; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.loading { padding: 48px 0; text-align: center; color: var(--ink-3); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--chrome); color: #fff; }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; min-height: 54px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: 0.01em; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; fill: var(--manila); }
.brand-dark { color: var(--ink); }
.brand-dark .brand-mark { fill: var(--manila-deep); }
.nav { display: flex; gap: 2px; align-self: stretch; }
.nav a { display: flex; align-items: center; padding: 0 12px; color: #c3cdd9; font-weight: 500; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a[aria-current='page'] { color: #fff; border-bottom-color: var(--manila); }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 10px; color: #9fb0c2; pointer-events: none; }
.topbar .search input { width: 100%; padding: 7px 10px 7px 32px; border: 1px solid #33455a; border-radius: 6px; background: #223043; color: #fff; }
.topbar .search input::placeholder { color: #9fb0c2; }
.topbar .search input:focus-visible { outline-color: var(--manila); border-color: var(--manila); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 28px rgba(22, 32, 43, 0.22); overflow: hidden; }
.hit { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; }
.hit:hover, .hit:focus-visible { background: var(--blue-wash); }
.hit strong { display: block; }
.hit-group { padding: 6px 12px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--band); }
.hit-none { padding: 12px; color: var(--ink-3); }
.who { display: flex; align-items: center; gap: 6px; color: #c3cdd9; }
.who-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #aab4bf; text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-accent { background: var(--manila); border-color: var(--manila); color: var(--manila-ink); }
.btn-accent:hover { background: #f6e3b4; border-color: #f6e3b4; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-quiet-danger { border-color: transparent; background: none; color: var(--red); }
.btn-quiet-danger:hover { border-color: var(--red); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px; border: 0; background: none; color: var(--blue); font-weight: 500; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--line-soft); color: var(--ink); text-decoration: none; }
.icon-btn-small { width: 22px; height: 22px; }
.icon-btn-light { color: #c3cdd9; }
.icon-btn-light:hover { background: #2a394c; color: #fff; }
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 15; min-width: 200px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(22, 32, 43, 0.18); }
.menu-item { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--blue-wash); }

/* ---------- page ---------- */
.main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 14px; margin-bottom: 14px; }
.page-head h1 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-right: auto; }
.page-head .btn { align-self: center; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.inline-field { display: flex; flex-direction: column; gap: 3px; }
.inline-field.grow { flex: 1; min-width: 220px; }
.inline-field label, .field label, .cell-label { font-size: 12px; color: var(--ink-3); }
.problem { margin: 60px auto; max-width: 420px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- inputs ---------- */
input[type='text'], input[type='search'], input[type='email'], input[type='tel'], input[type='number'], input[type='date'], input[type='password'], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #b4bec9; border-radius: 6px; background: var(--surface); min-height: 34px;
}
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; border-color: var(--blue); }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.req { color: var(--red); }
.form-grid { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-error { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: var(--red-wash); color: var(--red); }

/* ---------- record: toolbar, overview, folder tabs ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.overview { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px 14px; }
.ov-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.ov-title h1 { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.15; }
.avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--blue-wash); color: var(--blue-dark); font-weight: 600; font-size: 16px; }
.avatar-policy { background: var(--manila-wash); color: var(--manila-ink); }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px 20px; padding-top: 12px; }
.ov-value { font-size: 15px; overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--green-wash); color: var(--green); }
.pill-info { background: var(--blue-wash); color: var(--blue-dark); }
.pill-warn { background: var(--amber-wash); color: var(--amber); }
.pill-bad { background: var(--red-wash); color: var(--red); }
.pill-mute { background: var(--line-soft); color: var(--ink-2); }
.pill-plain { background: none; border: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }

.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 3px; margin-top: 18px; padding: 0 14px; }
.tab { position: relative; top: 1px; display: flex; align-items: center; gap: 6px; padding: 7px 15px 6px; border: 1px solid var(--manila-deep); border-bottom: 0; border-radius: 9px 9px 0 0; background: var(--manila); color: var(--manila-ink); font-weight: 500; }
.tab:hover { background: #f6e3b4; text-decoration: none; }
.tab[aria-current='page'] { z-index: 1; padding-top: 10px; background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 600; }
.tab-count, .count { padding: 0 6px; border-radius: 999px; background: rgba(22, 32, 43, 0.1); font-size: 12px; font-weight: 600; }
.count { margin-left: 7px; }
.folder { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-height: 240px; }

/* ---------- sections ---------- */
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; align-items: start; }
.side-nav { position: sticky; top: 74px; display: grid; gap: 1px; padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--band); }
.side-nav h4 { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.side-nav button { padding: 4px 6px; border: 0; border-radius: 5px; background: none; color: var(--blue); text-align: left; cursor: pointer; }
.side-nav button:hover { background: var(--blue-wash); }
.sec { margin-bottom: 26px; scroll-margin-top: 74px; }
.sec:last-child { margin-bottom: 0; }
.sec-sub { margin-bottom: 14px; }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.sec-head .sec-title { margin: 0 auto 0 0; }
.sec-title { display: flex; align-items: center; margin-bottom: 8px; font-size: 15px; font-weight: 600; }
h4.sec-title { font-size: 13px; color: var(--ink-2); }
.sec-note { margin: -4px 0 8px; font-size: 13px; color: var(--ink-3); }
.sec-body { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.grid-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-row:nth-child(odd) { background: var(--band); }
.cell { padding: 8px 14px 9px; min-height: 54px; }
.cell-value { min-height: 1.45em; font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.masked { display: inline-flex; align-items: center; gap: 6px; }
.sec-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.sec-form { background: var(--surface); }
.sec-form .form-grid { padding: 14px; }
.sec-form .form-error { margin: 0 14px 12px; }
.none { padding: 22px 14px; text-align: center; color: var(--ink-3); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--band); text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .check { width: 46px; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover, .table tr.clickable:focus-visible { background: var(--blue-wash); outline: none; }
.row-detail { margin-top: 2px; color: var(--ink-2); white-space: pre-line; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* ---------- files ---------- */
.files { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.files-add { display: grid; gap: 10px; }
.dropzone { display: grid; justify-items: center; gap: 8px; padding: 22px 14px; border: 2px dashed var(--manila-deep); border-radius: var(--radius); background: var(--manila-wash); color: var(--manila-ink); text-align: center; }
.dropzone.over { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-dark); }
.dropzone small { color: var(--ink-3); }
.upload-status { min-height: 1.4em; font-size: 13px; color: var(--ink-2); }

/* ---------- dialogs ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: start center; padding: 6vh 16px 16px; background: rgba(22, 32, 43, 0.48); overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: 12px; box-shadow: 0 24px 60px rgba(22, 32, 43, 0.35); }
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.modal-body { padding: 18px; }
.modal-intro { margin-bottom: 14px; color: var(--ink-2); }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.pick-list { display: grid; gap: 4px; margin-top: 12px; }
.pick { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--surface); text-align: left; cursor: pointer; }
.pick:hover { background: var(--blue-wash); border-color: var(--blue); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); padding: 9px 16px; border-radius: 8px; background: var(--chrome); color: #fff; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- dashboard ---------- */
.dash-title { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.dash-title h1 { margin-right: 0; }
.page-head .dash-scope { width: auto; align-self: center; }
/* Each number draws its own right and bottom hairline, so the strip stays tidy however many there are and however they wrap. */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.figure { display: grid; gap: 2px; padding: 14px 20px; color: var(--ink); box-shadow: 1px 0 0 var(--line-soft), 0 1px 0 var(--line-soft); }
a.figure:hover { background: var(--blue-wash); text-decoration: none; }
.figure-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; }
.figure-label { color: var(--ink-3); }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: dense; gap: 18px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.widget.wide { grid-column: span 2; }
.widget h2 { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; font-weight: 600; }
.widget-head { display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); }
.widget-head h2 { flex: 1; min-width: 0; border-bottom: 0; }
.widget-tools { display: flex; gap: 2px; padding-right: 10px; opacity: 0; transition: opacity 0.12s; }
.widget:hover .widget-tools, .widget:focus-within .widget-tools { opacity: 1; }
.widget-tools button:disabled { opacity: 0.3; cursor: default; }
@media (hover: none) { .widget-tools { opacity: 1; } }

/* Circular graph: the colours are assigned in this order and were checked to stay apart for colour-blind readers. */
:root { --series-1: #1f47b8; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-other: #c9d0d8; }
.donut { display: grid; gap: 14px; padding: 18px 16px 14px; }
.donut-plot { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.donut-ring { display: block; width: 168px; height: 168px; }
.donut-arc { fill: none; stroke-width: 20; transition: opacity 0.12s; }
.donut-arc.dim { opacity: 0.28; }
.donut-arc.s1 { stroke: var(--series-1); } .donut-arc.s2 { stroke: var(--series-2); } .donut-arc.s3 { stroke: var(--series-3); }
.donut-arc.s4 { stroke: var(--series-4); } .donut-arc.s5 { stroke: var(--series-5); } .donut-arc.other { stroke: var(--series-other); }
.donut-center { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 1px; padding: 0 36px; text-align: center; pointer-events: none; }
.donut-total { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.1; }
.donut-unit { max-height: 2.5em; overflow: hidden; font-size: 12px; line-height: 1.25; color: var(--ink-3); }
.legend { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 5px; }
.legend-row.on { background: var(--band); }
.swatch { width: 10px; height: 10px; border-radius: 2px; }
.swatch.s1 { background: var(--series-1); } .swatch.s2 { background: var(--series-2); } .swatch.s3 { background: var(--series-3); }
.swatch.s4 { background: var(--series-4); } .swatch.s5 { background: var(--series-5); } .swatch.other { background: var(--series-other); }
.legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-share { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Widget gallery */
.gallery-tabs { margin-top: 0; }
.gallery-tabs .tab { font: inherit; cursor: pointer; }
.gallery-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gallery-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.gallery-row:last-child { border-bottom: 0; }
.gallery-row.on { background: var(--band); }
.gallery-text { flex: 1; min-width: 0; }
.gallery-state { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--green); white-space: nowrap; }
.modal-foot .push { margin-left: auto; }
.bars { display: grid; gap: 10px; padding: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 28px; gap: 10px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--blue); }
.bar-count { text-align: right; font-weight: 600; }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.login-card h1 { font-size: 17px; font-weight: 600; }
.login-card form { display: grid; gap: 12px; }
.login-card .form-error { margin: 0; }
.demo-box { display: grid; gap: 10px; padding: 14px; border: 1px dashed var(--manila-deep); border-radius: var(--radius); background: var(--manila-wash); color: var(--manila-ink); }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .topbar-in { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 10px 14px; }
  .nav { order: 5; width: 100%; overflow-x: auto; }
  .nav a { padding: 6px 12px; white-space: nowrap; }
  .search { order: 4; flex-basis: 100%; max-width: none; margin-left: 0; }
  .topbar-in .btn-accent { margin-left: auto; }
  .with-side, .files, .dash { grid-template-columns: minmax(0, 1fr); }
  .side-nav { display: none; }
  .widget.wide { grid-column: auto; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .main { padding: 14px 16px 48px; }
  .who-name { display: none; }
  .grid-row, .form-row { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .folder { padding: 14px; }
  .tabs { padding: 0 6px; }
  .tab { padding: 6px 10px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* ---------- calculated amounts under a form ---------- */
.calc { display: grid; gap: 1px; margin-top: 14px; border: 1px solid var(--manila-deep); border-radius: var(--radius); background: var(--manila-deep); overflow: hidden; }
.calc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--manila-wash); }
.calc-row span { display: grid; }
.calc-row small { color: var(--ink-3); }
.calc-row strong { font-size: 16px; }
.form-heading { margin: 16px 0 8px; font-size: 14px; font-weight: 600; }
.form-heading:first-child { margin-top: 0; }
.finder { margin: 12px 0 0; }
.sec-note.after { margin: 10px 0 0; }
.scroll-box { max-height: 420px; overflow-y: auto; }
.scroll-box thead th { position: sticky; top: 0; }

/* ---------- salesroom ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); align-self: center; }
.seg button { padding: 7px 14px; border: 0; border-left: 1px solid var(--line); background: none; font-weight: 500; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed='true'] { background: var(--chrome); color: #fff; }
.period { margin-bottom: 14px; }
.sr-section { margin-bottom: 22px; }
.sr-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.sr-head h2 { font-size: 16px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tile { display: grid; gap: 2px; padding: 14px 16px; border-left: 1px solid var(--line-soft); }
.tile:first-child { border-left: 0; }
.tile-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.15; }
.tile-label { color: var(--ink-3); font-size: 13px; }
.meters, .charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 10px; }
.insights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.insights .bar-row { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 24px; }
.meter, .chart { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.meter-top, .chart-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.meter-top strong, .chart-top strong { font-size: 16px; }
.meter-track { height: 12px; margin-bottom: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--green); }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 96px; border-bottom: 1px solid var(--line); }
.col-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.col { width: 100%; border-radius: 2px 2px 0 0; background: var(--blue); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.stage { border: 1px solid var(--line); border-radius: 10px; background: var(--band); min-height: 180px; }
.stage.over { outline: 2px solid var(--blue); outline-offset: 1px; }
.stage-head { padding: 10px 12px; border-bottom: 3px solid var(--blue); border-radius: 10px 10px 0 0; background: var(--surface); }
.stage-head h3 { display: flex; align-items: center; font-size: 13px; font-weight: 600; }
.stage-head p { margin-top: 2px; font-weight: 600; }
.stage-sold .stage-head { border-bottom-color: var(--green); }
.stage-lost .stage-head { border-bottom-color: var(--red); }
.stage-cards { display: grid; gap: 8px; padding: 8px; }
.opp { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; }
.opp[draggable='true'] { cursor: grab; }
.opp-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-row { display: flex; justify-content: space-between; gap: 8px; }
.opp .mover { margin-top: 4px; min-height: 28px; padding: 3px 6px; font-size: 12px; }
@media (max-width: 980px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(4) { border-left: 0; }
  .tile:nth-child(n + 4) { border-top: 1px solid var(--line-soft); }
  .meters, .charts { grid-template-columns: minmax(0, 1fr); }
  .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(odd) { border-left: 0; }
  .tile:nth-child(4) { border-left: 1px solid var(--line-soft); }
  .tile:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .insights { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- billing and printable documents ---------- */
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.sec-head .btn-small { flex: none; }
.doc-head { display: grid; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.doc-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.doc-agency { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-2); }
.doc-agency strong { color: var(--ink); font-size: 16px; }
.doc-block { margin: 18px 0; }
.doc-block h3 { margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.doc-line { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.doc-total { margin-top: 12px; text-align: right; font-size: 16px; }
.print-area .none { text-align: left; padding: 10px 0; }
@media (max-width: 640px) {
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  body > *:not(.backdrop) { display: none !important; }
  .backdrop { position: static; display: block; padding: 0; background: none; overflow: visible; }
  .backdrop:not(:last-of-type) { display: none; }
  .modal { width: auto; box-shadow: none; border-radius: 0; }
  .modal-head, .no-print { display: none !important; }
  .modal-body { padding: 0; }
  .table th { background: none; }
}

/* ---------- notices inside dialogs ---------- */
.notice { display: grid; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--manila-deep); border-radius: var(--radius); background: var(--manila-wash); color: var(--manila-ink); }
.modal-intro .link-btn { vertical-align: baseline; }
.platform-activity { margin-top: 28px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--band); }
