/* Conel offer tracker. Tokens from the rr design system with Conel's values (tokens.conel.css). */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/roboto-v30-latin-ext_latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/roboto-v30-latin-ext_latin-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 600 800; font-display: swap; src: url("/fonts/roboto-v30-latin-ext_latin-700.woff2") format("woff2"); }
:root {
  --navy: #00447a; --navy-dark: #002d52; --orange: #fa9600; --orange-deep: #d97b00;
  --bg: #ffffff; --surface: #f3f7fb; --text: #333a40; --heading: #1f2a33; --muted: #5c6670; --border: #d9e1e8;
  --brand: var(--navy); --brand-tint: #e6f0f8; --row-sel: #f5f9fd; --on-brand: #ffffff;
  --info: #3b5b85; --info-soft: #e6ecf3; --success: #3f6b4a; --success-soft: #e7efe8;
  --warning: #8a6420; --warning-soft: #f5eddd; --error: #9c3b32; --error-soft: #f5e3e0;
  --due: #a35c00; --due-soft: #fff4e3; --due-line: #f2c47a; --due-ink: #7a4600;
  --side: #002d52; --side-text: #ffffff; --side-muted: #9fb6cc; --side-active: #00447a;
  --radius: 6px; --radius-s: 4px; --radius-l: 10px;
  /* App type scale (round 3): fixed sizes, the rr tokens at app width. Five steps, no others. */
  --text-xs: 12px; --text-ui: 14px; --text-m: 16px; --text-xl: 22px; --text-2xl: 27px;
  --lh-xs: 16px; --lh-ui: 20px; --lh-m: 24px; --lh-xl: 28px; --lh-2xl: 34px;
  --shadow: 0 12px 40px rgb(0 32 58 / 0.2);
  color-scheme: light;
}
/* Dark mode: follows the system unless the switch picks one (html[data-theme]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16222f; --surface: #0f1822; --text: #d6dde5; --heading: #ffffff; --muted: #9aa6b2; --border: #2a3a4b;
    --brand: #7fbaf0; --brand-tint: #1a2c40; --row-sel: #1a2a3b; --on-brand: #0f1822;
    --info: #8fb3e0; --info-soft: #1c2c40; --success: #8fcf9f; --success-soft: #1b2e22;
    --warning: #e6b866; --warning-soft: #33291a; --error: #f09a90; --error-soft: #3a1f1c;
    --due: #f0b35a; --due-soft: #33261a; --due-line: #6b4a1d; --due-ink: #f6c98a;
    --side: #0a131c;
    --shadow: 0 12px 40px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16222f; --surface: #0f1822; --text: #d6dde5; --heading: #ffffff; --muted: #9aa6b2; --border: #2a3a4b;
  --brand: #7fbaf0; --brand-tint: #1a2c40; --row-sel: #1a2a3b; --on-brand: #0f1822;
  --info: #8fb3e0; --info-soft: #1c2c40; --success: #8fcf9f; --success-soft: #1b2e22;
  --warning: #e6b866; --warning-soft: #33291a; --error: #f09a90; --error-soft: #3a1f1c;
  --due: #f0b35a; --due-soft: #33261a; --due-line: #6b4a1d; --due-ink: #f6c98a;
  --side: #0a131c;
  --shadow: 0 12px 40px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: var(--text-ui)/var(--lh-ui) Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; background: var(--surface); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { color: var(--heading); margin: 0; text-wrap: balance; }
.muted { color: var(--muted); }
.small { font-size: var(--text-xs); }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 10px 8px 20px; }
.brand-mark { width: 30px; height: 30px; border-radius: 5px; background: var(--orange); color: var(--navy-dark); font-weight: 800; display: grid; place-items: center; }
.brand div b { display: block; font-size: var(--text-ui); }
.brand div span { display: block; font-size: var(--text-xs); color: var(--side-muted); }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--side-text); text-decoration: none; font-size: var(--text-ui); border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.nav:hover { background: rgb(255 255 255 / 0.07); }
.nav[aria-current="page"] { background: var(--side-active); font-weight: 600; }
.nav .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav svg { color: #cfe0f1; flex: none; }
.count { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 500; color: var(--side-muted); font-variant-numeric: tabular-nums; }
.nav[aria-current="page"] .count.hot, .count.hot { background: var(--orange); color: var(--navy-dark); font-weight: 600; padding: 0 7px; border-radius: 999px; }
.side-head { display: flex; align-items: center; padding: 20px 0 4px 12px; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--side-muted); }
.side-head .grow { flex: 1; }
.icon-btn { border: 0; background: none; color: inherit; padding: 6px; border-radius: var(--radius-s); cursor: pointer; display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; }
.icon-btn:hover { background: rgb(127 127 127 / 0.15); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.theme { margin-top: auto; display: flex; gap: 2px; padding: 3px; border-radius: var(--radius); background: rgb(255 255 255 / 0.08); }
.theme button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: none; color: var(--side-muted); font-size: var(--text-xs); padding: 6px 4px; border-radius: var(--radius-s); cursor: pointer; min-height: 30px; }
.theme button:hover { color: #fff; }
.theme button[aria-pressed="true"] { background: rgb(255 255 255 / 0.16); color: #fff; font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1d4f75; display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; color: #fff; flex: none; }
.me small { display: block; color: var(--side-muted); }
.me .link-btn { color: var(--side-muted); }

.main { padding: 28px 32px 96px; min-width: 0; }
.topbar { display: none; }
.bottomnav { display: none; }
/* First load: a static skeleton in the app's own layout, shown only if loading takes over a second. */
.boot { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; opacity: 0; animation: boot-in 0s 1s forwards; }
.boot-side { background: var(--side); }
.boot-main { padding: 32px; display: flex; flex-direction: column; gap: 12px; }
.boot i { display: block; height: 14px; border-radius: 4px; background: var(--border); }
.boot-card { margin-top: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.boot-card i:nth-child(odd) { width: 70%; }
.boot-card i:nth-child(even) { width: 45%; }
@keyframes boot-in { to { opacity: 1; } }
.boot-fail { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
@media (max-width: 860px) { .boot { grid-template-columns: 1fr; } .boot-side { display: none; } .boot-main { padding: 16px; } }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head h1 { font-size: var(--text-2xl); line-height: var(--lh-2xl); font-weight: 600; }
.page-sub { margin: 4px 0 0; color: var(--muted); max-width: 72ch; text-wrap: pretty; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--muted); margin-bottom: 6px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg); color: var(--brand); font-weight: 500; font-size: var(--text-ui); line-height: var(--lh-ui); cursor: pointer; text-decoration: none; min-height: 36px; white-space: nowrap; }
.btn:hover { border-color: var(--brand); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.accent { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.pri:hover, .btn.accent:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 10px; min-height: 32px; }
.btn.text { border-color: transparent; background: none; padding-left: 8px; padding-right: 8px; }
.btn.text:hover { background: var(--surface); }
.btn.danger { color: var(--error); border-color: transparent; background: none; padding-left: 4px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.link-btn { border: 0; background: none; color: var(--brand); padding: 2px 0; cursor: pointer; font-weight: 500; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.input, .textarea, .select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--bg); min-height: 40px; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.search { position: relative; flex: 1 1 280px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 36px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); font-size: var(--text-ui); cursor: pointer; white-space: nowrap; min-height: 32px; }
.chip[aria-pressed="true"] { background: var(--brand-tint); border-color: var(--brand); color: var(--heading); font-weight: 600; }
/* Segmented control: one choice out of a few (periods, client groups). */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.seg button { border: 0; background: none; color: var(--text); font: inherit; padding: 5px 12px; min-height: 32px; border-radius: var(--radius-s); cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--heading); }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--heading); font-weight: 600; box-shadow: 0 0 0 1px var(--border); }
.seg .n { font-size: var(--text-xs); color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: var(--text-xs); font-weight: 600; color: var(--heading); }
.field > span small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.row { display: flex; gap: 14px; }
.row > * { flex: 1; min-width: 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-ui); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- cards ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 16px; }
.offer-card { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.offer-card .grow { flex: 1; min-width: 0; }
.offer-card p { margin: 4px 0 0; white-space: pre-wrap; }
.label { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.summary { display: grid; grid-template-columns: 250px 1fr; gap: 12px; margin-bottom: 18px; }
.due-box { background: var(--due-soft); border: 1px solid var(--due-line); border-radius: var(--radius); padding: 16px; color: var(--due-ink); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.due-box b { font-size: var(--text-2xl); line-height: 1.1; }
.due-box .head { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: var(--text-ui); }
.due-box.calm { background: var(--bg); border-color: var(--border); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stat { border: 0; background: none; text-align: left; padding: 4px 6px; border-radius: var(--radius-s); cursor: pointer; }
.stat:hover, .stat[aria-pressed="true"] { background: var(--surface); }
.stat b { display: block; font-size: var(--text-2xl); color: var(--heading); line-height: 1.2; }
.stat span { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--muted); }
.bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 12px 0 10px; background: var(--surface); }
.bar i { display: block; }

/* status colours */
.s-do { --sb: var(--surface); --sc: var(--muted); }
.s-wys { --sb: var(--info-soft); --sc: var(--info); }
.s-zain { --sb: var(--brand-tint); --sc: var(--brand); }
.s-zam { --sb: var(--success-soft); --sc: var(--success); }
.s-nie { --sb: var(--surface); --sc: var(--muted); }
.s-brak { --sb: var(--warning-soft); --sc: var(--warning); }
.sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc); display: inline-block; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--sb); color: var(--sc); font-size: var(--text-xs); font-weight: 500; white-space: nowrap; }
/* Status chip: a select drawn as a pill, with the status icon in front (colour is never the only signal). */
.st { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.st > svg { position: absolute; left: 9px; pointer-events: none; color: var(--sc); }
.pill-select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; padding: 4px 28px 4px 12px; background: var(--sb) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6670' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--sc); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 500; cursor: pointer; max-width: 100%; min-height: 28px; }
.st > .pill-select { padding-left: 28px; }
.pill-select option { background: var(--bg); color: var(--text); }
.tag { display: inline-block; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 500; padding: 0 6px; border-radius: var(--radius-s); background: var(--surface); color: var(--text); white-space: nowrap; }
.tag.warn { background: var(--warning-soft); color: var(--warning); }

/* ---------- list (table on desktop, cards on phone) ---------- */
.list { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; }
/* A table card: toolbar (tabs, search, bulk bar) and the list in one bordered box. */
.tcard { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; }
.tcard > .list { border: 0; border-radius: 0; }
.tcard > .tabs-bar { margin: 0; padding: 0 16px; }
.tcard > .toolbar { margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lrow { display: grid; align-items: center; border-top: 1px solid var(--border); }
.lrow:first-child { border-top: 0; }
.lrow > * { padding: 12px; min-width: 0; }
.lhead { background: none; font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--muted); }
.lhead > * { padding-top: 10px; padding-bottom: 10px; }
.lrow.sel { background: var(--row-sel); }
.entries .lrow { grid-template-columns: 44px minmax(200px, 1.6fr) 210px 110px minmax(220px, 1.3fr); }
.clients-list .lrow { grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1.3fr) 150px 120px 120px 110px; }
.reports-list .lrow { grid-template-columns: minmax(200px, 1fr) 100px 100px 100px 100px 260px; }
.lrow .num { text-align: right; }
.cell-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.company { font-weight: 600; color: var(--heading); font-size: var(--text-ui); }
.note-cell { font-size: var(--text-ui); white-space: pre-wrap; overflow-wrap: anywhere; }
.chk { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.late { color: var(--error); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.today-flag { color: var(--warning); font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.list-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--muted); display: flex; gap: 12px; align-items: center; }
.list-foot .grow { flex: 1; }
.empty { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--muted); }
.empty .e-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.empty h3 { margin: 0; font-size: var(--text-m); line-height: var(--lh-m); color: var(--heading); font-weight: 600; text-wrap: balance; }
.empty p { margin: 0; max-width: 440px; text-wrap: pretty; }
.empty .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding-top: 4px; }

.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--brand-tint); color: var(--heading); padding: 8px 16px; border-bottom: 1px solid var(--border); }
.bulk b { margin-right: 8px; }
.bulk .spacer { flex: 1; }
.bulk .select { width: auto; min-height: 32px; padding: 5px 8px; }

/* ---------- today ---------- */
.group { margin-bottom: 16px; padding: 0; overflow: hidden; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.group-head .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.group-head h2 { font-size: var(--text-m); line-height: var(--lh-m); font-weight: 600; }
.todo { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(170px, 1fr) minmax(120px, 1fr) auto; gap: 16px 24px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.group-head + .todo, .group-head + .task { border-top: 0; }
.todo .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

/* ---------- reports ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.tile b { display: block; font-size: var(--text-2xl); line-height: var(--lh-2xl); font-weight: 600; color: var(--heading); margin: 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; align-items: stretch; }
.meter { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; display: flex; flex: 1 1 auto; min-width: 60px; }
.meter i { display: block; height: 100%; }
.hbar { display: grid; grid-template-columns: 170px 1fr 150px; gap: 16px; align-items: center; padding: 6px 0; }
.hbar > :last-child { text-align: right; color: var(--heading); font-variant-numeric: tabular-nums; }

/* ---------- panels and modals ---------- */
.scrim { position: fixed; inset: 0; background: rgb(15 24 34 / 0.45); z-index: 40; display: flex; justify-content: flex-end; }
.scrim.center { justify-content: center; align-items: flex-start; padding: 48px 16px; overflow-y: auto; }
.panel { background: var(--bg); width: min(560px, 100%); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal { background: var(--bg); width: min(960px, 100%); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.modal.narrow { width: min(640px, 100%); }
.p-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; }
.p-head .grow { flex: 1; min-width: 0; }
.p-head h2 { font-size: var(--text-xl); }
.p-body { padding: 4px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.p-foot { display: flex; align-items: center; gap: 10px; padding: 14px 24px; background: var(--surface); border-top: 1px solid var(--border); flex-wrap: wrap; }
.p-foot .grow { flex: 1; }
.panel .p-head { background: var(--brand-tint); padding-bottom: 16px; }
.kv { display: grid; grid-template-columns: 140px 1fr; }
.kv > * { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: var(--text-ui); overflow-wrap: anywhere; }
.kv dt { color: var(--muted); font-size: var(--text-xs); }
.kv dd { margin: 0; }
.subhead { font-size: var(--text-ui); font-weight: 600; color: var(--heading); margin-bottom: 4px; }
.hist { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; font-size: var(--text-ui); }
.status-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.status-picks label { cursor: pointer; }
.status-picks input { position: absolute; opacity: 0; pointer-events: none; }
.status-picks span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); font-size: var(--text-ui); }
.status-picks input:checked + span { background: var(--sb); border-color: var(--sc); color: var(--sc); font-weight: 600; box-shadow: inset 0 0 0 0.5px var(--sc); }
.status-picks input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.hint { font-size: var(--text-xs); color: var(--muted); }
.callout { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); background: var(--info-soft); color: var(--info); font-size: var(--text-xs); }
.reason-box { background: var(--surface); padding: 12px; border-radius: var(--radius); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4.5px var(--heading); }
.swatches input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 4px; }

.pick-list { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow-y: auto; flex: 1; min-height: 200px; }
.pick { display: grid; grid-template-columns: 24px minmax(180px, 1.2fr) minmax(170px, 1fr) minmax(160px, 1fr) 112px; gap: 14px; align-items: center; padding: 11px 24px; border-top: 1px solid var(--border); cursor: pointer; }
.pick:first-child { border-top: 0; }
.pick.sel { background: var(--row-sel); }
.pick.dis { opacity: 0.55; cursor: default; }
.pick-head { display: flex; align-items: center; gap: 12px; padding: 9px 24px; background: var(--brand-tint); font-size: var(--text-xs); }
.pick-head .grow { flex: 1; color: var(--brand); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2a33; color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 60; box-shadow: var(--shadow); font-size: var(--text-ui); display: flex; gap: 14px; align-items: center; }
.toast button { background: none; border: 0; color: var(--orange); font-weight: 600; cursor: pointer; }
.fb-btn { position: fixed; right: 20px; bottom: 20px; z-index: 30; box-shadow: var(--shadow); }
.banner { background: var(--warning-soft); color: var(--warning); padding: 10px 14px; border-radius: var(--radius); display: flex; gap: 10px; align-items: center; margin-bottom: 14px; font-size: var(--text-ui); }
.banner .grow { flex: 1; }
.demo-note .btn { margin-left: auto; }
.demo-note { background: var(--info-soft); color: var(--info); padding: 8px 14px; border-radius: var(--radius); font-size: var(--text-xs); margin-bottom: 16px; display: flex; gap: 8px; align-items: center; }

/* ---------- accounts ---------- */
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius); }
.me-link:hover b { text-decoration: underline; }
.acc-form { display: flex; flex-direction: column; gap: 12px; }
.totp-key { display: inline-block; margin: 6px 0; padding: 6px 10px; background: var(--surface); border-radius: var(--radius-s); font-size: var(--text-ui); letter-spacing: 0.05em; user-select: all; }
.sess { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); font-size: var(--text-ui); }
.inv-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inv-form .grow { flex: 1 1 260px; }
.link-box { margin-top: 12px; padding: 12px; border-radius: var(--radius); background: var(--success-soft); display: flex; flex-direction: column; gap: 8px; }
.users-list .lrow { grid-template-columns: minmax(200px, 1.4fr) 170px 90px 150px minmax(220px, 1fr); }
.usr-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.audit { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; max-height: 360px; overflow-y: auto; }
@media (max-width: 860px) { .usr-acts { justify-content: flex-start; } .users-list .lrow > * { flex: 1 1 45%; } }

/* ---------- project screen ---------- */
.proj-meta { margin: 6px 0 0; font-size: var(--text-ui); }
.btn.icon-only { padding-left: 10px; padding-right: 10px; }
.menu-wrap { position: relative; }
.menu-wrap > summary { list-style: none; cursor: pointer; }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu-wrap .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu-wrap .menu button { display: flex; gap: 8px; align-items: center; border: 0; background: none; color: var(--text); text-align: left; padding: 9px 10px; border-radius: var(--radius-s); cursor: pointer; font: inherit; min-height: 36px; }
.menu-wrap .menu button:hover, .menu-wrap .menu button:focus-visible { background: var(--surface); }
.due-strip { display: flex; gap: 12px; align-items: center; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--warning-soft); color: var(--heading); }
.due-strip > svg { color: var(--warning); flex: none; }
.due-strip .grow { flex: 1; min-width: 0; }
.due-strip .link-btn { color: var(--brand); font-weight: 600; }
.tabs-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs { display: flex; gap: 24px; flex: 1 1 auto; min-width: 0; }
.tab { border: 0; background: none; font: inherit; color: var(--muted); padding: 0 2px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.tab[aria-pressed="true"] { color: var(--heading); font-weight: 600; border-bottom-color: var(--brand); }
.tab-n { font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--muted); background: var(--surface); border-radius: 999px; padding: 0 6px; }
.tabs-bar .search { margin: 6px 0; flex: 0 1 300px; max-width: 100%; }
.c-next { font-size: var(--text-ui); }
.entries .lrow:hover { background: var(--row-sel); }
.row-click { cursor: pointer; }
.row-click:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ---------- pipeline ---------- */
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pipe-col { background: var(--brand-tint); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 140px; border: 2px solid transparent; }
.pipe-col.over { border-color: var(--brand); border-style: dashed; }
.pipe-col header { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: var(--text-ui); }
.pipe-col header b { color: var(--heading); }
.pipe-empty { padding: 8px 4px; }
.deal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 7px; cursor: grab; box-shadow: 0 1px 2px rgb(0 32 58 / 0.08); }
.deal:hover { border-color: var(--brand); }
.deal.dragging { opacity: 0.5; }
.deal-top { display: flex; gap: 8px; align-items: flex-start; }
.deal-top .company { flex: 1; min-width: 0; font-size: var(--text-ui); }
.deal-val { font-weight: 700; color: var(--heading); font-size: var(--text-ui); white-space: nowrap; font-variant-numeric: tabular-nums; }
.deal-val.muted { font-weight: 400; color: var(--muted); font-size: var(--text-xs); }
.deal-next { align-self: flex-start; display: inline-flex; gap: 5px; align-items: center; font-size: var(--text-xs); font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--surface); }
.deal-next.late { background: var(--error-soft); color: var(--error); }
.deal-next.good { background: var(--success-soft); color: var(--success); }
/* ---------- tasks ---------- */
.task-add { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1.5px solid var(--brand); border-radius: var(--radius); background: var(--bg); margin-bottom: 14px; }
.task-add .grow { flex: 1; min-width: 0; }
.task-add .task-text { width: 100%; border: 0; background: none; padding: 6px 0; font-size: var(--text-ui); outline: none; }
.task-add:focus-within { box-shadow: 0 0 0 3px var(--brand-tint); }
.task-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-mini { display: inline-flex; gap: 5px; align-items: center; border: 0; background: var(--surface); color: var(--text); border-radius: var(--radius-s); padding: 4px 8px; font-size: var(--text-xs); cursor: pointer; white-space: nowrap; }
.chip-mini:hover { background: var(--error-soft); color: var(--error); }
.task { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.task.is-late { box-shadow: inset 4px 0 var(--error); }
.task-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); cursor: pointer; flex: none; }
.task-check:hover { border-color: var(--success); background: var(--success-soft); }
[role=dialog] .task { padding: 8px 0; }
[role=dialog] .task-add { margin: 8px 0 0; }
@media (max-width: 1180px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .pipe { grid-template-columns: 1fr; } .task-add { flex-wrap: wrap; } .task-add label { flex-basis: 100%; } .task { padding: 10px 12px; } }

/* ---------- import and merge ---------- */
.imp-steps { display: flex; gap: 24px; padding: 0 24px 14px; font-size: var(--text-ui); color: var(--muted); }
.imp-step { display: inline-flex; align-items: center; gap: 8px; }
.imp-step i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: var(--text-xs); font-weight: 700; }
.imp-step.on { color: var(--heading); font-weight: 600; } .imp-step.on i { background: var(--brand); color: var(--on-brand); }
.imp-step.done i { background: var(--success); color: #fff; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 40px 20px; border: 2px dashed var(--border); border-radius: 8px; cursor: pointer; color: var(--brand); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-tint); }
.drop:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.imp-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border-top: 1px solid var(--border); overflow-y: auto; flex: 1; min-height: 0; }
.imp-map { padding: 14px 24px; }
.imp-side { padding: 16px 20px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.imp-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr); gap: 12px; align-items: center; padding: 5px 0; border-top: 1px solid var(--border); font-size: var(--text-ui); }
.imp-row.imp-head { border-top: 0; font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.imp-row .select { min-height: 34px; padding: 5px 8px; }
.imp-row .select.set { border-color: var(--brand); color: var(--brand); }
.imp-col { font-weight: 500; overflow-wrap: anywhere; }
.imp-ex { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-count { display: flex; gap: 10px; align-items: baseline; font-size: var(--text-ui); }
.imp-count b { font-size: var(--text-xl); min-width: 44px; font-variant-numeric: tabular-nums; }
.mg-row { display: grid; grid-template-columns: 120px 1fr 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--text-ui); }
.mg-row.mg-head { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.mg-opt { display: flex; gap: 8px; align-items: center; cursor: pointer; overflow-wrap: anywhere; }
.mg-opt input { accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
@media (max-width: 860px) { .imp-grid { grid-template-columns: 1fr; } .imp-row { grid-template-columns: 1fr 1fr; } .imp-ex { display: none; } .mg-row { grid-template-columns: 90px 1fr 1fr; } }

/* ---------- email sync ---------- */
.mail-status { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; margin-top: auto; font-size: var(--text-xs); color: var(--side-muted); }
.mail-status.bad { color: #f6b0a8; }
.mail-status + .theme { margin-top: 4px; }
.new-reply { display: inline-flex; gap: 5px; align-items: center; border: 0; background: var(--success-soft); color: var(--success); font-weight: 600; font-size: var(--text-xs); padding: 3px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mail-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--text-ui); }
.mail-dir { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.mail-dir.in { background: var(--success-soft); color: var(--success); }
.mail-dir.out { background: var(--info-soft); color: var(--info); }

/* ---------- feedback element picker ---------- */
.fb-target { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fb-target .pill { white-space: normal; padding: 5px 10px; }
.picking, .picking * { cursor: crosshair !important; }
.pick-hi { position: fixed; z-index: 70; pointer-events: none; border: 2px solid var(--orange); border-radius: 6px; background: rgb(250 150 0 / 0.12); transition: all 0.06s; }
.pick-hi::after { content: attr(data-label); position: absolute; left: -2px; top: -22px; background: var(--orange); color: var(--navy-dark); font-size: var(--text-xs); font-weight: 700; padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.pick-bar { position: fixed; z-index: 71; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--navy-dark); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: var(--text-ui); max-width: calc(100vw - 24px); }
.pick-bar button { background: rgb(255 255 255 / 0.14); border: 0; color: #fff; border-radius: var(--radius-s); padding: 6px 10px; cursor: pointer !important; }
.flash { outline: 3px solid var(--orange) !important; outline-offset: 3px; animation: flash 0.8s ease-in-out 3; }
@keyframes flash { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } .pick-hi { transition: none; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--navy-dark); }
.login form { background: var(--bg); padding: 28px; border-radius: 8px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login h1 { font-size: var(--text-xl); }
.error { color: var(--error); font-size: var(--text-ui); min-height: 1em; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .entries .lrow { grid-template-columns: 40px minmax(180px, 1.4fr) 180px 86px minmax(160px, 1fr); }
  .todo { grid-template-columns: 1fr 1fr; }
  .todo .note, .todo .acts { grid-column: 1 / -1; }
  .todo .acts { justify-content: flex-start; }
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  body { font-size: var(--text-ui); }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); z-index: 45; }
  .topbar { display: flex; align-items: center; gap: 4px; background: var(--bg); color: var(--heading); padding: 6px 8px; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--border); }
  .topbar .icon-btn { min-width: 44px; min-height: 44px; }
  .topbar .grow { flex: 1; min-width: 0; font-size: var(--text-m); line-height: var(--lh-m); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 16px 16px 150px; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--side); z-index: 25; }
  .bottomnav > * { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--side-text); font: inherit; font-size: var(--text-xs); line-height: var(--lh-xs); text-decoration: none; border: 0; background: none; cursor: pointer; position: relative; }
  .bottomnav [aria-current="page"] { font-weight: 600; }
  .bottomnav [aria-current="page"] svg { color: var(--orange); }
  .bottomnav .count.hot { position: absolute; top: 8px; left: calc(50% + 8px); }
  /* The top bar already shows the page title; the h1 stays for screen readers. */
  .page-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .page-sub { margin-top: 0; }
  .page-head .btn { flex: 1; justify-content: center; }
  /* Phone: as in the design, only the follow-up banner; status counts live in the filter chips. */
  .summary { grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; }
  .summary > .card, .offer-card { display: none; }
  .due-box { flex-direction: row; align-items: center; gap: 10px; padding: 12px 14px; }
  .due-box b { font-size: var(--text-m); order: -1; }
  .due-box .small { margin-left: auto; }
  .search { max-width: none; flex-basis: 100%; }
  .tabs-bar { border-bottom: 0; }
  .tabs { gap: 6px 16px; border-bottom: 1px solid var(--border); flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs-bar .search { flex: 1 1 100%; }
  .page-head .menu-wrap { flex: none; }
  .toolbar .spacer { display: none; }
  .list { background: none; border: 0; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
  .tcard { background: none; border: 0; overflow: visible; }
  .tcard > .tabs-bar, .tcard > .toolbar { padding: 0; border-bottom: 0; margin-bottom: 12px; }
  .tcard > .bulk { border-radius: var(--radius); margin-bottom: 12px; border: 0; }
  .lrow.lhead { display: none; }
  .lrow { display: flex; flex-wrap: wrap; gap: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 12px 14px; position: relative; }
  .lrow:first-child { border-top: 1px solid var(--border); }
  .lrow > * { padding: 0; }
  .lrow > .c-main { flex: 1 1 100%; padding-right: 40px; }
  .entries .c-chk { position: absolute; top: 14px; right: 14px; }
  .entries .c-sent::before { content: "wysłano "; color: var(--muted); }
  .lrow .c-hide { display: none; }
  .lrow .c-note { flex-basis: 100%; }
  .lrow .num { text-align: left; }
  .list-foot { border: 0; padding: 4px 0; }
  .clients-list .lrow > *, .reports-list .lrow > * { flex: 1 1 45%; }
  .todo { grid-template-columns: 1fr; gap: 8px; }
  .tiles, .two { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 120px 1fr; }
  .hbar > :last-child { grid-column: 2; text-align: left; }
  .row { flex-direction: column; }
  .bulk { position: sticky; top: 56px; z-index: 10; }
  .pick { grid-template-columns: 24px 1fr; padding: 12px 16px; }
  .pick > :nth-child(n+3) { grid-column: 2; }
  .pick-head, .p-head, .p-body, .p-foot { padding-left: 16px; padding-right: 16px; }
  .scrim.center { padding: 0; }
  .modal, .modal.narrow { max-height: 100vh; height: 100%; border-radius: 0; }
  .kv { grid-template-columns: 110px 1fr; }
  .fb-btn { right: 12px; bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
