/* Kibitec: job desk preview. Tokens are documented in DESIGN.md. */
@font-face { font-family: 'Geist'; src: url('/fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F1F0ED;
  --surface: #FFFFFF;
  --surface-2: #F7F6F3;
  --ink: #17171A;
  --ink-2: #47474D;
  --ink-3: #626268;
  --line: rgba(23, 23, 26, 0.10);
  --line-strong: rgba(23, 23, 26, 0.19);
  --night: #141416;
  --night-2: #1E1E21;
  --brand: #F47B20;
  --brand-hover: #FF8C36;
  --brand-ink: #A84A06;
  --brand-wash: rgba(244, 123, 32, 0.11);
  --brand-wash-2: rgba(244, 123, 32, 0.2);
  --ok: #17703F; --ok-wash: #E4F3EA;
  --warn: #8A5300; --warn-wash: #FBF0DC;
  --bad: #B42318; --bad-wash: #FCE9E7;
  --shadow: rgba(23, 23, 26, 0.18);
  --r-ctl: 10px;
  --r-card: 16px;
  --side: 248px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-tabs: 20; --z-scrim: 30; --z-drawer: 31; --z-modal: 40; --z-toast: 50; --z-intro: 70; --z-badge: 80;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Geist', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.small { font-size: 13px; }
.break { word-break: break-all; }
.pt { padding-top: 16px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons, chips, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: var(--ink); box-shadow: none; font-weight: 600; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn--ghost:hover { background: var(--brand-wash); color: var(--ink); }
.btn--danger { color: var(--bad); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn--lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn--icon { width: 40px; padding: 0; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.chip--demo { background: var(--warn-wash); color: var(--warn); box-shadow: none; }
.chip--new, .chip--visit { background: var(--brand-wash); color: var(--brand-ink); box-shadow: none; }
.chip--quoted { background: var(--warn-wash); color: var(--warn); box-shadow: none; }
.chip--scheduled, .chip--progress, .chip--snagging { background: var(--night); color: #fff; box-shadow: none; }
.chip--paid, .chip--done { background: var(--ok-wash); color: var(--ok); box-shadow: none; }
.chip--lost { background: var(--surface-2); color: var(--ink-3); }
.chip--overdue { background: var(--bad-wash); color: var(--bad); box-shadow: none; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 0; border-radius: var(--r-ctl);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--brand-ink); }
.textarea--sm { min-height: 84px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand-ink); }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); opacity: 1; }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bad); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--ink-3); width: 18px; height: 18px; }
.search .input { padding-left: 38px; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 500; white-space: nowrap; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--night); color: #fff; }
.seg button .n { font-size: 12px; opacity: 0.75; }

/* ---------- intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: var(--z-intro);
  display: grid; grid-template-columns: minmax(0, 1fr);
  background: var(--night); color: #fff; overflow-y: auto;
}
.intro__copy { display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 40px 20px 24px; }
.intro__logo { width: 210px; height: auto; margin-bottom: 18px; }
.intro__title { font-size: clamp(2.2rem, 5vw, 4.2rem); font-weight: 650; letter-spacing: -0.035em; line-height: 1.02; max-width: 14ch; text-wrap: balance; }
.intro__title em { font-style: normal; color: var(--brand); }
.intro__sub { max-width: 46ch; color: rgba(255, 255, 255, 0.74); font-size: 1.08rem; }
.intro__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 6px; }
.intro__note { color: rgba(255, 255, 255, 0.6); font-size: 14px; }
.intro__facts { display: flex; flex-wrap: wrap; gap: 8px; }
.intro__facts span { padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); font-size: 13px; color: rgba(255, 255, 255, 0.82); }
.intro__media { position: relative; min-height: 300px; margin: 0 20px 90px; }
.intro__img { position: absolute; border-radius: var(--r-card); object-fit: cover; box-shadow: 0 30px 60px -30px var(--shadow); }
.intro__img--a { inset: 0 18% 14% 0; width: 82%; height: 86%; }
.intro__img--b { right: 0; bottom: 0; width: 50%; height: 56%; outline: 6px solid var(--night); }
.intro__stripe { position: absolute; left: 0; top: -22px; width: 28%; height: 8px; background: var(--brand); border-radius: 999px; }
@media (min-width: 960px) {
  .intro { grid-template-columns: 5fr 6fr; }
  .intro__copy { padding: 64px 40px 64px max(48px, 6vw); }
  .intro__media { margin: 48px 48px 48px 0; min-height: 0; }
}

/* ---------- app shell ---------- */
.app { min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; padding-bottom: 96px; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 10px 16px;
  background: rgba(243, 244, 248, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.top__emblem { width: 34px; height: 34px; border-radius: 8px; background: #000; }
.top__title { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; margin-right: auto; }
.top__new span { display: none; }
.top__new { width: 40px; padding: 0; }
.view { padding: 18px 16px 24px; outline: none; }
.foot { padding: 0 16px 24px; color: var(--ink-3); font-size: 12.5px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabs);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: var(--r-ctl); color: var(--ink-3); font-size: 11px; font-weight: 500; text-decoration: none; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-wash); }
.dot-count:empty { display: none; }
.dot-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: var(--ink); font-weight: 600; font-style: normal; font-size: 11px; line-height: 18px; text-align: center; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column; gap: 28px;
    padding: 22px 14px 64px; background: var(--night); color: #fff;
  }
  .side__brand img { width: 176px; height: auto; margin: 6px 8px 0; }
  .side__nav { display: grid; gap: 2px; }
  .side__nav a {
    display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px;
    border-radius: var(--r-ctl); color: rgba(255, 255, 255, 0.7); font-weight: 500; text-decoration: none;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
  }
  .side__nav a:hover { background: var(--night-2); color: #fff; }
  .side__nav a[aria-current="page"] { background: var(--night-2); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
  .side__nav a[aria-current="page"] svg { color: var(--brand); }
  .side__nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 22px; text-align: center; }
  .side__nav .count:empty { display: none; }
  .side__shop { margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; color: rgba(255, 255, 255, 0.6); }
  .side__shop-name { color: #fff; font-weight: 600; margin-bottom: 2px; }
  .main { padding-bottom: 0; }
  .top { padding: 14px 32px; min-height: 72px; }
  .top__emblem { display: none; }
  .top__title { font-size: 22px; }
  .top__new { width: auto; padding: 0 16px; }
  .top__new span { display: inline; }
  .view { padding: 28px 32px 32px; }
  .foot { padding: 0 32px 28px; }
  .tabs { display: none; }
}

/* ---------- shared blocks ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); }
.card__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.card__head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin-right: auto; }
.card__body { padding: 0 18px 18px; }
.muted { color: var(--ink-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 240px; }
.toolbar .seg { flex: 0 1 auto; max-width: 100%; }

.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty svg { width: 32px; height: 32px; color: var(--brand-ink); opacity: 0.8; }
.empty strong { color: var(--ink); font-weight: 600; }

/* rows: lists of quotes, customers, follow-ups */
.rows { display: grid; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 14px;
  width: 100%; padding: 14px 18px; border: 0; background: transparent; text-align: left; cursor: pointer;
  border-top: 1px solid var(--line);
  transition: background 0.15s var(--ease);
}
.rows > .row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row__main { min-width: 0; }
.row__title { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { display: block; color: var(--ink-3); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__side { display: grid; justify-items: end; gap: 4px; }
.row__amount { font-weight: 600; }

/* ---------- dashboard ---------- */
.hello { margin-bottom: 18px; }
.hello h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 650; letter-spacing: -0.03em; }
.hello p { color: var(--ink-2); margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  display: grid; gap: 6px; padding: 16px; border: 0; text-align: left; cursor: pointer;
  border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 14px 30px -20px var(--shadow); }
.kpi__label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.kpi__label svg { width: 18px; height: 18px; color: var(--brand-ink); }
.kpi__value { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.kpi__hint { color: var(--ink-3); font-size: 13px; }
.kpi--brand { background: var(--night); box-shadow: none; color: #fff; }
.kpi--brand .kpi__label, .kpi--brand .kpi__hint { color: rgba(255, 255, 255, 0.74); }
.kpi--brand .kpi__label svg { color: var(--brand); }
.dash { display: grid; gap: 16px; }
@media (min-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .dash__col { display: grid; gap: 16px; }
}
.dash__col { display: grid; gap: 16px; }

.pipe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .pipe { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.pipe button {
  display: grid; gap: 2px; padding: 12px; border: 0; border-radius: 12px; text-align: left; cursor: pointer;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.pipe button:hover { box-shadow: inset 0 0 0 1px var(--brand-ink); }
.pipe strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.pipe span { font-size: 12.5px; color: var(--ink-3); }
.pipe em { font-style: normal; font-size: 12.5px; color: var(--ink-2); }

.today { display: grid; gap: 10px; }
.today__item { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; padding: 6px; border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer; }
.today__item:hover { background: var(--surface-2); }
.today__item b { display: block; font-weight: 600; }
.today__item .muted { display: block; font-size: 13.5px; }
.today__slot { display: grid; place-items: center; height: 44px; border-radius: 12px; background: var(--brand-wash); color: var(--brand-ink); font-weight: 600; font-size: 13px; }
.today__slot--dark { background: var(--night); color: var(--brand); font-size: 17px; }

.ranges-card { margin-top: 16px; }
.ranges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range { border: 0; padding: 0; cursor: pointer; }
.range { position: relative; overflow: hidden; border-radius: 12px; aspect-ratio: 4 / 3; background: var(--surface-2); }
.range img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.range:hover img { transform: scale(1.04); }
.range span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; color: #fff; font-size: 13px; font-weight: 600; background: linear-gradient(transparent, rgba(10, 10, 12, 0.78)); }
@media (min-width: 640px) { .ranges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- quote editor (drawer) ---------- */
.scrim { position: fixed; inset: 0; z-index: var(--z-scrim); background: rgba(20, 20, 22, 0.4); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  display: flex; flex-direction: column;
  width: min(100%, 640px); background: var(--bg);
  box-shadow: -30px 0 60px -30px var(--shadow);
}
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; margin-right: auto; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.drawer__foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.drawer__foot .spacer { margin-right: auto; }
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.steps span { display: grid; gap: 6px; font-size: 11px; line-height: 1.2; color: var(--ink-3); font-weight: 500; }
.steps span::before { content: ''; height: 4px; border-radius: 999px; background: var(--line-strong); }
.steps span.is-on { color: var(--ink); }
.steps span.is-on::before { background: var(--brand); }
.steps__now { margin-top: -4px; font-size: 13px; color: var(--ink-2); }
.steps__now b { color: var(--ink); font-weight: 600; }
@media (min-width: 560px) { .steps__now { display: none; } }
@media (max-width: 559px) { .steps span { font-size: 0; gap: 0; } }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.lines { display: grid; }
.line { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.line__name { font-weight: 600; font-size: 14.5px; }
.line__brand { color: var(--ink-3); font-size: 13px; }
.line__ctrl { display: flex; align-items: flex-end; gap: 6px 8px; margin-top: 8px; flex-wrap: wrap; }
.line__ctrl .input { width: 64px; min-height: 36px; padding: 5px 8px; }
.line__ctrl .price { width: 96px; }
.mini { display: grid; gap: 2px; font-size: 12px; color: var(--ink-3); }
.line__total { margin-left: auto; padding-bottom: 7px; font-weight: 600; text-align: right; }
.totals { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-strong); }
.totals div { display: flex; justify-content: space-between; color: var(--ink-2); }
.totals .grand { color: var(--ink); font-size: 18px; font-weight: 650; }

/* ---------- product picker ---------- */
.picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.prod {
  display: grid; gap: 6px; padding: 8px 8px 12px; border: 0; border-radius: 14px; text-align: left; cursor: pointer;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}
.prod:hover { box-shadow: inset 0 0 0 2px var(--brand-ink); }
.prod:active { transform: scale(0.98); }
.prod img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.prod b { font-size: 13.5px; font-weight: 600; line-height: 1.3; padding: 0 4px; }
.prod span { font-size: 12.5px; color: var(--ink-3); padding: 0 4px; }
.prod.is-added { box-shadow: inset 0 0 0 2px var(--ok); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: end center; padding: 0; background: rgba(20, 20, 22, 0.42); }
.modal__box {
  width: 100%; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -20px 60px -20px var(--shadow);
}
@media (min-width: 720px) {
  .modal { place-items: center; padding: 24px; }
  .modal__box { width: min(100%, 620px); border-radius: 20px; }
  .modal__box.is-wide { width: min(100%, 860px); }
}
.modal__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; margin-right: auto; }
.modal__body { display: grid; gap: 14px; padding: 16px; }
.modal__foot--form { margin: 0 -16px -16px; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); position: sticky; bottom: 0; }

.bubble { justify-self: end; max-width: 92%; padding: 12px 14px; border-radius: 14px 14px 4px 14px; background: #DCF3D6; color: #0F2A12; white-space: pre-wrap; font-size: 14.5px; box-shadow: 0 6px 16px -10px var(--shadow); }
.bubble-wrap { display: grid; padding: 18px 14px; border-radius: var(--r-card); background: #EFEAE2; }
.note { padding: 10px 12px; border-radius: var(--r-ctl); background: var(--warn-wash); color: var(--warn); font-size: 13.5px; }
.note--brand { background: var(--brand-wash); color: var(--ink); }

/* invoice sheet */
.sheet { padding: 22px; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 18px; }
.sheet__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.sheet__logo { align-self: start; padding: 12px 14px; border-radius: 10px; background: #000; }
.sheet__top img { width: 160px; height: auto; }
.sheet__from { font-size: 13px; color: var(--ink-2); text-align: right; }
.sheet__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.sheet__meta div { display: grid; gap: 2px; font-size: 13px; color: var(--ink-3); }
.sheet__meta b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 500; padding: 0 0 8px; }
.sheet td { padding: 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.sheet td:last-child, .sheet th:last-child { text-align: right; }
.sheet td.q { width: 56px; color: var(--ink-2); }

/* ---------- customers ---------- */
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--night); color: var(--brand); font-weight: 650; font-size: 14px; }
.who { display: flex; gap: 12px; align-items: center; }
.row--person { grid-template-columns: 40px minmax(0, 1fr) auto; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.facts--job { margin-top: 12px; }
.facts--job div { background: var(--surface-2); }
.facts div { padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.facts span { display: block; font-size: 12.5px; color: var(--ink-3); }
.facts b { font-weight: 600; }
.timeline { display: grid; gap: 0; padding: 0; }
.timeline li { list-style: none; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.timeline li:first-child { border-top: 0; }
.timeline svg { width: 18px; height: 18px; color: var(--brand-ink); margin-top: 2px; }
.timeline p { font-size: 14px; }
.timeline small { color: var(--ink-3); font-size: 12.5px; }

/* ---------- jobs board ---------- */
.board-hint { color: var(--ink-2); margin-bottom: 14px; font-size: 14px; }
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 82vw); gap: 12px;
  margin: 0 -16px; padding: 0 16px 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; overscroll-behavior-x: contain;
}
.col { scroll-snap-align: start; display: grid; gap: 10px; align-content: start; padding: 12px; border-radius: var(--r-card); background: rgba(23, 23, 26, 0.05); min-height: 220px; }
.col__head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col__head b { font-weight: 650; }
.col__head span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--night); color: #fff; font-size: 12px; font-weight: 600; }
.col__head em { margin-left: auto; font-style: normal; font-size: 13px; color: var(--ink-3); }
.col__empty { padding: 18px 4px; color: var(--ink-3); font-size: 13px; text-align: center; border-radius: 12px; border: 1px dashed var(--line-strong); }
.kcard { display: grid; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px -16px var(--shadow); overflow: hidden; }
.kcard__open { display: grid; gap: 3px; padding: 12px 14px 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.kcard__open:hover { background: var(--surface-2); }
.kcard__no { font-size: 12px; font-weight: 600; color: var(--brand-ink); letter-spacing: 0.02em; }
.kcard__open b { font-weight: 600; line-height: 1.3; }
.kcard__open .muted { font-size: 13px; }
.kcard__meta { font-size: 13px; color: var(--ink-2); }
.kcard__amt { font-weight: 600; margin-top: 2px; }
.kcard__move { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.kcard__next { flex: 1; justify-content: space-between; }
@media (min-width: 900px) {
  .board { margin: 0 -32px; padding: 0 32px 16px; scroll-padding-inline: 32px; grid-auto-columns: minmax(250px, 1fr); }
}
@media (min-width: 1600px) {
  .board { grid-auto-flow: row; grid-template-columns: repeat(6, minmax(0, 1fr)); overflow: visible; }
}

/* ---------- follow-ups ---------- */
.fu-group h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); margin: 18px 4px 8px; }
.fu-group:first-child h3 { margin-top: 0; }
.fu { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.fu:first-child { border-top: 0; }
.fu__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-wash); color: var(--brand-ink); }
.fu__icon.is-bad { background: var(--bad-wash); color: var(--bad); }
.fu__text b { display: block; font-weight: 600; }
.fu__text p { color: var(--ink-2); font-size: 14px; }
.fu__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- toasts, badge ---------- */
.toasts { position: fixed; left: 50%; top: 14px; z-index: var(--z-toast); translate: -50% 0; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 16px 30px -14px var(--shadow); animation: toast-in 0.35s var(--ease); }
.toast svg { width: 18px; height: 18px; color: var(--brand); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

.badge {
  position: fixed; left: 16px; bottom: 16px; z-index: var(--z-badge);
  display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 14px 30px -14px var(--shadow);
  color: var(--ink-2); font-size: 12.5px;
}
.badge a { text-decoration: none; }
.badge strong { color: var(--ink); font-weight: 600; }
.badge__close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 999px; background: var(--brand-wash); cursor: pointer; }
.badge__close svg { width: 14px; height: 14px; }
.badge.is-hidden { display: none; }
/* on phones the app's tab bar owns the bottom edge */
@media (max-width: 899px) {
  .app:not([hidden]) ~ .badge { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .has-layer .badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
