@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/space-grotesk-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/space-grotesk-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f5f6fd;
  --surface: #ffffff;
  --surface-2: #eceefb;
  --surface-3: #e2e7ff;
  --line: #ddd2c6;
  --line-strong: #7b8597;
  --ink: #131b2e;
  --ink-2: #554336;
  --muted: #6b5a4c;
  --accent: #8d4b00;
  --accent-hover: #6e3900;
  --accent-ink: #ffffff;
  --accent-soft: #ffe6d1;
  --accent-soft-ink: #6e3900;
  --red: #bb0112;
  --red-soft: #ffe4e1;
  --amber: #8d4b00;
  --amber-soft: #fff1dc;
  --green: #006c4a;
  --green-soft: #d3f8e6;
  --blue-soft: #e2e7ff;
  --blue-ink: #283044;
  --series-1: #3657a8;
  --series-2: #c26a00;
  --shadow: 0 2px 4px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
  --radius: 8px;
  --radius-sm: 4px;
  --side: 240px;
  --font-head: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Arabic', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #1a2336;
    --surface-2: #243049;
    --surface-3: #2c3a57;
    --line: #3a4760;
    --line-strong: #8a96ab;
    --ink: #eef0ff;
    --ink-2: #e2cdbd;
    --muted: #bcab9d;
    --accent: #ffb77d;
    --accent-hover: #ffcfa6;
    --accent-ink: #2f1500;
    --accent-soft: #4a2a0c;
    --accent-soft-ink: #ffdcc3;
    --red: #ffb4ab;
    --red-soft: #47161a;
    --amber: #ffb77d;
    --amber-soft: #3d2a12;
    --green: #68dba9;
    --green-soft: #0f3527;
    --blue-soft: #2c3a57;
    --blue-ink: #dae2fd;
    --series-1: #7f9cf0;
    --series-2: #f0a24c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.47 var(--font-body);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: var(--font-head); font-size: 1.625rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 2px; line-height: 1.2; }
h2 { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
h3 { font-family: var(--font-head); font-weight: 600; font-size: .95rem; margin: 14px 0 6px; color: var(--ink-2); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
p { margin: 0 0 8px; }
code { font-size: .86em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
pre.code { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: .8rem; white-space: pre; }
.select { user-select: all; }
.small { font-size: .84rem; }
.muted { color: var(--muted); }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 4px 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--red); border-color: var(--red); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: .875rem; }
.btn.full { width: 100%; margin-top: 8px; }
.btn.won { color: var(--green); border-color: var(--green); }
.btn.won.on, .btn.won:hover { background: var(--green); color: var(--surface); }
.btn.lost { color: var(--red); border-color: var(--red); }
.btn.lost.on, .btn.lost:hover { background: var(--red); color: var(--surface); }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 40px; height: 40px; border-radius: var(--radius-sm); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; width: 100%; min-height: 46px;
}
textarea { resize: vertical; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field .label { font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.form-grid h3 { grid-column: 1 / -1; }
.inline { display: flex; gap: 6px; }
.inline select { width: 90px; flex: none; }
.w-num { width: 80px; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .span2 { grid-column: 1 / -1; }
}

.layout { min-height: 100vh; }
.side { display: none; }
.content { padding: 0 16px 96px; max-width: 1240px; margin: 0 auto; }
main.loading { opacity: .6; transition: opacity .2s .15s; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px 12px; font-size: .72rem; font-weight: 600; color: var(--ink-2); text-decoration: none; min-height: 60px; }
.bottom-nav a.on { color: var(--accent); font-weight: 700; }
.bottom-nav a.on::after { content: ''; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -16px 14px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--surface); border-bottom: 1.5px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.top-brand img { width: 32px; height: 32px; flex: none; }
.top-names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top-names b { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; }
.top-names span { font-size: .8rem; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-chip { flex: none; font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--green); background: var(--green-soft); border: 1.5px solid color-mix(in srgb, var(--green) 35%, transparent); border-radius: var(--radius-sm); padding: 5px 10px; text-decoration: none !important; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .layout { display: grid; grid-template-columns: var(--side) 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; }
  .content { padding: 22px 28px 40px; width: 100%; min-width: 0; }
  .topbar { display: none; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img { width: 30px; height: 30px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border-left: 3px solid transparent; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a.on { background: var(--accent-soft); color: var(--accent-soft-ink); border-left-color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.me { display: flex; flex-direction: column; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-actions .search { width: 180px; flex: 1 1 140px; }
.head-actions select { width: auto; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: .86rem; color: var(--muted); margin-bottom: 4px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink-2); padding: 8px 12px; min-height: 36px; border-radius: 3px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.row-end { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.info { background: var(--surface-3); color: var(--ink); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 12px; }
.error-box { background: var(--red-soft); border: 1.5px solid var(--red); border-left-width: 4px; color: var(--ink); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 3px; }
.error-box b { color: var(--red); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: var(--surface-2); color: var(--ink-2); vertical-align: middle; white-space: nowrap; }
.badge.won, .badge.q-accepted, .badge.i-paid { background: var(--green-soft); color: var(--green); }
.badge.lost, .badge.q-declined, .badge.i-overdue { background: var(--red-soft); color: var(--red); }
.badge.q-sent, .badge.i-partial { background: var(--amber-soft); color: var(--amber); }
.badge.i-open, .badge.q-draft { background: var(--surface-2); color: var(--ink-2); }
.badge.i-void { text-decoration: line-through; }

.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; }
.stat b { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat.bad { border-color: var(--red); background: var(--red-soft); }
.stat.bad b, .stat.bad span { color: var(--red); }
.stat.warn { border-color: var(--amber); background: var(--amber-soft); }
.stat.warn b { color: var(--amber); }
.group { margin-bottom: 18px; }
.group h2 .count { font-size: .78rem; background: var(--surface-2); color: var(--ink-2); padding: 1px 8px; border-radius: 99px; }
.group h2.red .count { background: var(--red); color: var(--accent-ink); }
.group h2.amber .count { background: var(--amber); color: var(--accent-ink); }
.day { text-transform: capitalize; }
.act-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.act-main { min-width: 0; }
.act-title { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; line-height: 1.3; display: block; color: var(--ink); }
a.act-title:hover { color: var(--accent); }
.act-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.act-meta .due.red { color: var(--red); font-weight: 700; }
.tel { display: inline-flex; align-items: center; gap: 3px; }
.act-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.plan-row .act-title { font-family: var(--font-body); font-size: .95rem; font-weight: 600; }

.today-head { align-items: flex-end; }
.today-head .eyebrow { margin-bottom: 2px; }
.rule-banner { display: flex; align-items: flex-start; gap: 12px; background: var(--surface-3); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 20px; color: var(--accent); }
.rule-banner > svg { flex: none; margin-top: 2px; }
.rule-banner p { margin: 2px 0 0; color: var(--ink); font-size: .94rem; }
.tag { flex: none; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); padding: 3px 8px; }
.group { margin-bottom: 26px; }
.sec-title { font-size: 1.375rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.sec-title.red { color: var(--red); text-transform: uppercase; font-size: 1.2rem; letter-spacing: 0; }
.sec-sub { font-size: .875rem; font-weight: 500; letter-spacing: .02em; color: var(--ink-2); margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1.5px solid var(--line); }
.overdue-group { background: var(--red-soft); margin: 0 -16px 26px; padding: 16px; border-block: 1.5px solid color-mix(in srgb, var(--red) 25%, transparent); }
.overdue-group .sec-title { margin-bottom: 12px; }
.act-card { position: relative; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.act-card.overdue { border-left: 5px solid var(--red); }
.act-card.next { border: 2px solid var(--accent); margin-top: 22px; }
.next-tab { position: absolute; top: -13px; left: 12px; display: inline-flex; align-items: center; gap: 5px; background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.act-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.act-when { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.act-when.red { color: var(--red); }
.act-when .eyebrow { color: inherit; }
.act-deal { font-size: .94rem; color: var(--ink-2); margin-top: 1px; }
.act-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; text-align: right; }
.value { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .03em; padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: var(--surface); color: var(--ink-2); border: 1.5px solid var(--line); }
.pill.st-site_visit { background: var(--amber-soft); color: var(--accent-soft-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill.st-quote_sent { background: var(--blue-soft); color: var(--blue-ink); border-color: color-mix(in srgb, var(--blue-ink) 25%, transparent); }
.pill.st-negotiation { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }
.pill.st-won { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.pill.st-lost { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.act-note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 12px; color: var(--ink); font-size: .95rem; }
.act-note svg { flex: none; color: var(--accent); margin-top: 2px; }
.act-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--line); }
.act-step { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; letter-spacing: .03em; color: var(--ink-2); min-width: 0; }
.act-card .btn.primary { font-weight: 700; }
.act-card .btn.tel { background: var(--surface-3); color: var(--ink); }
.act-card .btn.directions { background: var(--surface-3); color: var(--ink); gap: 4px; }
.act-place { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-size: .9rem; color: var(--ink-2); }
.act-place svg { flex: none; color: var(--accent); margin-top: 2px; }
.act-card.compact { padding: 12px 14px 10px; box-shadow: none; }
.act-card.compact .act-title { font-size: 1rem; }
.act-card.compact .act-deal { font-size: .875rem; font-weight: 500; }
.act-card.compact .value { font-size: 1.1rem; }
.act-card.compact .act-foot { margin-top: 8px; padding-top: 8px; }
.day-box { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.day-box h3.day { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 12px 14px; background: var(--surface-2); border-bottom: 1.5px solid var(--line); color: var(--ink); font-size: 1rem; }
.day-box h3 .count { font-family: var(--font-body); font-size: .78rem; font-weight: 700; background: var(--surface); border: 1.5px solid var(--line); border-radius: 99px; padding: 1px 9px; color: var(--ink-2); }
.day-box .act-card { margin: 10px; }
.stall-banner { background: var(--red-soft); border: 1.5px solid color-mix(in srgb, var(--red) 40%, transparent); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.stall-banner p { margin: 4px 0 0; font-size: .875rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.stall-card { background: var(--surface); border: 2px dashed color-mix(in srgb, var(--red) 60%, transparent); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.stall-note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; margin: 10px 0 0; font-size: .92rem; color: var(--ink); }
.stall-card .btn.full { min-height: 48px; font-size: 1rem; margin-top: 12px; }
.hide-xs { display: none; }
@media (min-width: 360px) { .hide-xs { display: inline; } }
@media (min-width: 900px) {
  .overdue-group { margin-inline: 0; border: 1.5px solid color-mix(in srgb, var(--red) 25%, transparent); border-radius: var(--radius); }
  .today-group, .later-group, .unplanned-group, .overdue-group { max-width: 760px; }
  .rule-banner { max-width: 760px; }
}

.board-head { align-items: center; }
.pipe-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pipe-tabs a { font-family: var(--font-head); font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); color: var(--ink-2); text-decoration: none; }
.pipe-tabs a.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.board-hint { margin: -6px 0 10px; }
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; margin: 0 -16px; padding-left: 16px; padding-right: 16px; -webkit-overflow-scrolling: touch; }
.col { flex: 0 0 80%; max-width: 300px; scroll-snap-align: start; background: var(--surface-2); border-radius: var(--radius); border-top: 3px solid var(--line-strong) !important; display: flex; flex-direction: column; min-height: 200px; border: 2px solid transparent; transition: border-color .12s, background .12s; }
@media (min-width: 640px) { .col { flex-basis: 250px; } .board { margin: 0; padding-left: 0; padding-right: 0; } }
.col.over { border-color: var(--accent); background: var(--accent-soft); }
.col.kind-won { border-top-color: var(--green) !important; }
.col.kind-lost { border-top-color: var(--red) !important; }
.col.kind-won .col-head { color: var(--green); }
.col.kind-lost .col-head { color: var(--red); }
.col-head { padding: 10px 12px 6px; }
.col-title { display: flex; justify-content: space-between; font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.col-title .count { color: var(--muted); font-weight: 600; }
.col-sum { font-size: .8rem; color: var(--muted); }
.col-list { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.col-empty { border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px 8px; text-align: center; color: var(--muted); font-size: .8rem; }
.deal-card { display: block; background: var(--surface); border: 1.5px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; color: var(--ink); text-decoration: none !important; box-shadow: var(--shadow); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.deal-card.overdue { border-left-color: var(--red); }
.deal-card.unplanned { border-left-color: var(--amber); }
.deal-card.dragging { opacity: .35; }
.deal-card.pressing { transform: scale(.98); transition: transform .25s; }
.deal-card.ghost { position: fixed; z-index: 100; pointer-events: none; transform: rotate(2deg); box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: .95; }
body.is-dragging { cursor: grabbing; user-select: none; }
.deal-top { display: flex; justify-content: space-between; gap: 6px; }
.deal-title { font-family: var(--font-head); font-weight: 600; font-size: .95rem; line-height: 1.25; }
.avatar { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); font-size: .66rem; font-weight: 800; display: grid; place-items: center; }
.deal-sub { font-size: .8rem; color: var(--ink-2); margin-top: 2px; }
.deal-next { display: flex; align-items: center; gap: 4px; font-size: .76rem; color: var(--muted); margin-top: 6px; }
.deal-next.red { color: var(--red); font-weight: 700; }
.deal-next.amber { color: var(--amber); font-weight: 700; }

.deal-head { margin-bottom: 14px; }
.deal-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.deal-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; color: var(--ink-2); font-size: .9rem; }
.deal-facts b { font-family: var(--font-head); font-size: 1.15rem; color: var(--ink); }
.close-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stage-bar { display: flex; margin-top: 12px; overflow-x: auto; gap: 3px; scrollbar-width: none; }
.stage { flex: 1 0 auto; min-width: 74px; min-height: 40px; border: 0; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: .78rem; font-weight: 700; padding: 9px 14px 9px 18px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.stage:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: var(--radius-sm) 0 0 var(--radius-sm); padding-left: 12px; }
.stage.passed { background: var(--green-soft); color: var(--green); }
.stage.current { background: var(--accent); color: var(--accent-ink); }
.stage:hover:not(.current) { filter: brightness(.95); }
.deal-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .deal-grid { grid-template-columns: 340px 1fr; align-items: start; } .deal-side { position: sticky; top: 16px; } }
.plan-card.unplanned { border-color: var(--amber); background: var(--amber-soft); }
.plan-card.overdue { border-color: var(--red); }
.plan-row { display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.plan-row .act-actions { grid-column: 2; margin-top: 4px; }
.plan-row.overdue .act-icon { background: var(--red); color: var(--accent-ink); }
.unplanned-note { display: flex; gap: 8px; align-items: center; color: var(--amber); font-weight: 700; margin-bottom: 8px; }
.plan-card > .btn { margin-top: 10px; }
.p-name { font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; margin-bottom: 4px; }
.p-line { display: flex; align-items: center; gap: 6px; padding: 4px 0; color: var(--ink-2); word-break: break-word; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); border-bottom-width: 3px; }
.composer textarea { margin: 10px 0 4px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tl-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.tl-stage .tl-icon { background: var(--accent-soft); color: var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.tl-text { white-space: pre-wrap; font-size: .92rem; color: var(--ink-2); margin-top: 2px; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none !important; }
.list-row > div:first-child { flex: 1; min-width: 0; }
.list-row.on { background: var(--accent-soft); border-radius: 8px; }
.list-row.inactive { opacity: .55; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.file-tile { display: flex; flex-direction: column; gap: 4px; color: var(--ink); word-break: break-all; }
.file-tile img, .file-ic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-sm); padding: 8px 12px; min-height: 40px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.quick { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 8px; }
.quick .btn { background: var(--surface-2); }
.next-picker { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.next-q { font-size: 1.02rem; color: var(--ink); margin: 0 0 8px; }
.close-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.act-summary { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }

.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .62); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .15s; }
.modal { background: var(--surface); width: 100%; max-height: 92vh; overflow: auto; border-top: 2px solid var(--line-strong); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@media (min-width: 640px) {
  .modal-wrap { align-items: center; padding: 20px; }
  .modal { max-width: 480px; border-radius: var(--radius); border: 1.5px solid var(--line); }
  .modal.wide { max-width: 680px; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; position: sticky; bottom: -16px; background: var(--surface); padding: 10px 0 2px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); }
@media (min-width: 900px) { #toasts { top: auto; bottom: 24px; } }
.toast { background: var(--ink); color: var(--surface); padding: 12px 14px; border-radius: var(--radius-sm); box-shadow: 0 6px 20px rgba(0,0,0,.2); font-weight: 600; animation: up .2s; }
.toast.err { background: var(--red); color: var(--accent-ink); }
.toast.out { opacity: 0; transition: opacity .5s; }

.q-row { display: grid; grid-template-columns: repeat(3, 1fr) 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); position: relative; }
.q-desc { grid-column: 1 / -1; padding-right: 36px; }
.q-row > .icon-btn { position: absolute; top: 10px; right: 0; }
.q-cell { display: flex; flex-direction: column; gap: 2px; font-size: .76rem; color: var(--muted); }
.q-amt { justify-content: flex-end; text-align: right; }
.q-amount { font-size: .95rem; font-weight: 700; color: var(--ink); padding: 10px 0; }
@media (min-width: 800px) {
  .q-row { grid-template-columns: 1fr 80px 120px 80px 120px 36px; align-items: end; }
  .q-desc { grid-column: auto; padding-right: 0; }
  .q-row > .icon-btn { position: static; }
}
.q-add { margin: 8px 0; }
.q-bottom { display: grid; gap: 14px; margin-top: 10px; }
@media (min-width: 800px) { .q-bottom { grid-template-columns: 1fr 320px; } }
.q-totals { display: flex; flex-direction: column; gap: 4px; margin-left: auto; width: 100%; max-width: 340px; }
.q-totals > div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.q-totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; position: sticky; bottom: 70px; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 10px 0; backdrop-filter: blur(6px); z-index: 5; }
@media (min-width: 900px) { .action-bar { bottom: 0; } }

.inv-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.inv-nums > div { display: flex; flex-direction: column; }
.inv-nums b { font-family: var(--font-head); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 700; padding: 6px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.card:has(> .tbl), .card:has(> table) { overflow-x: auto; }
.billing-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.legend { display: flex; gap: 12px; font-size: .8rem; color: var(--ink-2); margin-bottom: 6px; }
.key::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.key.billed::before { background: var(--series-1); }
.key.collected::before { background: var(--series-2); }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 150px; align-items: end; margin: 8px 0 14px; border-bottom: 1px solid var(--line); }
.bar-col { display: flex; flex-direction: column; height: 100%; justify-content: flex-end; align-items: center; }
.bar-pair { display: flex; gap: 2px; align-items: flex-end; height: calc(100% - 18px); width: 100%; justify-content: center; }
.bar { width: 40%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 0; }
.bar.billed { background: var(--series-1); }
.bar.collected { background: var(--series-2); }
.bar-label { font-size: .66rem; color: var(--muted); height: 18px; line-height: 18px; }
.month-tbl td.red { color: var(--red); }

.report-grid { display: grid; gap: 14px; }
@media (min-width: 1000px) { .report-grid { grid-template-columns: 1fr 1fr; } }
.report .card, .report { margin: 0; }
.hbar { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; align-items: center; gap: 8px; padding: 5px 0; font-size: .86rem; }
.hbar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; display: block; }
.hbar-fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar-val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; white-space: nowrap; }
.foot-note { margin-top: 8px; }
.rate { display: flex; align-items: center; gap: 6px; min-width: 110px; }
.rate-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: block; }
.rate-fill { display: block; height: 100%; background: var(--series-1); }
.stage-time { border-bottom: 1px solid var(--line); padding: 2px 0 6px; }
.st-sub { padding-left: 2px; }
.fc-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: .86rem; }
.fc-bars { display: flex; flex-direction: column; gap: 2px; }
.fc-bars .hbar-fill { height: 8px; }
.hbar-fill.collected { background: var(--series-2); }

.outbox { display: grid; gap: 14px; }
@media (min-width: 1000px) { .outbox.has-sel { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.mail-row.failed { background: var(--red-soft); }
.mail-ic { color: var(--muted); }
.mail-head { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .88rem; margin: 0 0 10px; }
.mail-head dt { color: var(--muted); }
.mail-head dd { margin: 0; word-break: break-word; }
.mail-body { white-space: pre-wrap; font: inherit; background: var(--surface-2); padding: 12px; border-radius: 9px; }
.attach { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tabs.scroll { margin-bottom: 14px; }
.stage-row input:first-child { flex: 1; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 10px; }
.check-ok .chk-ic, .chk.check-ok svg { color: var(--green); }
.check-warn .chk-ic, .chk.check-warn svg { color: var(--amber); }
.check-fail .chk-ic, .chk.check-fail svg { color: var(--red); }
.check-fail { background: var(--red-soft); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; }
.kv dd { margin: 0; min-width: 0; }
.deliveries td { min-width: 70px; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--surface); border: 1.5px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 22px 18px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0 0 12px; }
.auth-lang { margin-top: 14px; }
.demo-accounts { margin-top: 18px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.demo-accounts h2 { font-size: 1rem; margin: 0 0 4px; }
.demo-account { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; margin-top: 8px; padding: 8px 12px; text-align: left; background: var(--surface); color: inherit; border: 1.5px solid var(--line); border-radius: 4px; cursor: pointer; font: inherit; }
.demo-account:hover, .demo-account:focus-visible { border-color: var(--accent); }
.checks { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 14px; font-size: .82rem; }
.chk { display: flex; gap: 6px; align-items: flex-start; }
.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
