/* BossBoard Mobile — "BossBoard Twin" design system, phone-first.
   Same tokens as BossBoard Cloud / BossCrew: Inter, canvas #f2f4f5, white
   cards (12px radius, border #dde3e7), deep navy #12262e, green #12805c. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --canvas: #f2f4f5;
  --card: #ffffff;
  --border: #dde3e7;
  --navy: #12262e;
  --green: #12805c;
  --green-dark: #0d6a4b;
  --ink: #1b2a33;
  --muted: #64748b;
  --red: #c93a3a;
  --amber-bg: #fff7e6;
  --amber-border: #f0c26b;
  --amber-ink: #8a5a00;
  --radius: 12px;
  --tabbar-h: 62px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
a { color: var(--green); }

/* ---------------------------------------------------------- auth views */
.auth-wrap {
  min-height: 100dvh;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.auth-logo { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.5px; }
.auth-sub { margin: 0; color: var(--muted); font-size: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy); }
.auth-card input {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: #fbfcfc; font-weight: 400;
}
.error { color: var(--red); font-size: 13px; margin: 0; font-weight: 600; }

/* ------------------------------------------------------------- buttons */
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 14px;
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-dark); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.35); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn.big { padding: 14px 16px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-checkin, .btn-checkout {
  width: 100%; border: none; border-radius: 14px; color: #fff;
  font-size: 21px; font-weight: 800; letter-spacing: .4px; padding: 20px 16px;
}
.btn-checkin { background: var(--green); box-shadow: 0 8px 22px rgba(18,128,92,.35); }
.btn-checkin:active { background: var(--green-dark); }
.btn-checkout { background: var(--navy); box-shadow: 0 8px 22px rgba(18,38,46,.3); }
.btn-checkin[disabled], .btn-checkout[disabled] { background: #b9c4c9; box-shadow: none; color: #eef2f3; }

/* --------------------------------------------------------------- shell */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
#topbar {
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px) * 0);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  position: sticky; top: 0; z-index: 20;
}
#topbar .brand { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.whoami { font-size: 13px; color: #c8d4d9; font-weight: 600; }
#content {
  flex: 1; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 16px 14px calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
/* App-shell layout (v5): once signed in, the page itself stops scrolling —
   the header and the tab bar are fixed frame rows and only #content
   scrolls between them. iOS webviews can detach position:fixed bars from
   the visual viewport while the document scrolls; a flex frame with an
   internal scroller cannot — the tabs stay on screen at all times. */
body.in-app { overflow: hidden; overscroll-behavior: none; }
body.in-app .shell { height: 100dvh; min-height: 0; }
body.in-app #topbar { flex: none; }
body.in-app #content {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
}
body.in-app #tabbar { position: relative; flex: none; }
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
#tabbar .tab {
  background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 6px 0 4px;
}
#tabbar .tab svg { width: 23px; height: 23px; }
#tabbar .tab.active { color: var(--green); }

/* --------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.card h2, .card h3 { margin: 0 0 6px; color: var(--navy); }
.card h2 { font-size: 18px; }
.card h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.greeting { font-size: 24px; font-weight: 800; color: var(--navy); margin: 2px 0 0; }
.subline { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.job-name { font-size: 20px; font-weight: 800; color: var(--navy); margin: 0; }
.job-meta { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.addr { font-size: 14px; margin: 6px 0 0; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; background: #e8f4ef; color: var(--green-dark);
  border: 1px solid #bfe3d4; vertical-align: middle;
}
.pill.prod { background: #e7f0f7; color: #0369a1; border-color: #bfd9ec; }
.pill.grey { background: #eef1f3; color: var(--muted); border-color: var(--border); }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat .lbl { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }
.live-line { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--green-dark); font-size: 14px; margin-top: 10px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18,128,92,.45); } 70% { box-shadow: 0 0 0 9px rgba(18,128,92,0); } 100% { box-shadow: 0 0 0 0 rgba(18,128,92,0); } }
select.job-pick, input.field, textarea.field {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; background: #fbfcfc; margin: 8px 0 12px;
}
textarea.field { resize: vertical; min-height: 64px; }
.onsite-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #eef1f3; }
.onsite-row:first-of-type { border-top: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.onsite-row .who { font-weight: 700; font-size: 14px; }
.onsite-row .where { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ job list */
.job-card { text-align: left; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: block; }
.job-card:active { border-color: var(--green); }
.job-card .job-name { font-size: 17px; }
.crew-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 600; background: #e8f4ef; color: var(--green-dark); border-radius: 999px; padding: 3px 9px; }

/* -------------------------------------------------------------- job view */
.back-btn { align-self: flex-start; }
.feed-post { border-top: 1px solid #eef1f3; padding: 12px 0 4px; }
.feed-post:first-of-type { border-top: none; }
.feed-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.feed-head .author { font-weight: 700; font-size: 14px; }
.feed-head .when { color: var(--muted); font-size: 12px; }
.feed-body { font-size: 14px; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-word; }
.feed-post.need { background: var(--amber-bg); border: 1px solid var(--amber-border); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.need-badge { font-size: 10px; font-weight: 800; letter-spacing: .8px; color: var(--amber-ink); background: #ffe1a1; border-radius: 6px; padding: 2px 6px; text-transform: uppercase; }
.feed-photo { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 4px 0 8px; display: block; }
.composer { display: flex; flex-direction: column; gap: 8px; }
.composer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-actions { display: flex; gap: 8px; }
.composer-actions .btn { flex: 1; padding: 12px 10px; }
.btn-need { background: #d97706; border-color: #b45309; color: #fff; font-weight: 800; }
.btn-need:active { background: #b45309; }
.toggle-need { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }
.toggle-need input { width: 18px; height: 18px; accent-color: #d97706; }
.thumb-preview { max-width: 140px; border-radius: 8px; border: 1px solid var(--border); }
.receipt-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid #eef1f3; align-items: center; }
.receipt-row:first-of-type { border-top: none; }
.receipt-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.receipt-row .amt { font-weight: 800; color: var(--navy); }
.form-grid { display: flex; flex-direction: column; gap: 10px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--navy); }
.form-grid input, .form-grid select { border: 1px solid var(--border); border-radius: 10px; padding: 11px; background: #fbfcfc; font-weight: 400; }
.checkin-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 6px 0; border-top: 1px solid #eef1f3; }
.checkin-line:first-of-type { border-top: none; }
.tag-in { color: var(--green-dark); font-weight: 800; }
.tag-out { color: var(--muted); font-weight: 800; }
.noloc { color: var(--red); font-weight: 600; font-size: 12px; }

/* ---------------------------------------------------------------- map */
#map { height: 46dvh; min-height: 280px; border-radius: var(--radius); border: 1px solid var(--border); z-index: 1; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.pin-fresh { background: var(--green); }
.pin-stale { background: #9aa7ad; }
.pin-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid #eef1f3; }
.pin-row:first-of-type { border-top: none; }
.pin-row .fresh { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.pin-row .fresh b { display: block; font-size: 13px; color: var(--navy); }
.pin-row.stale .fresh b { color: var(--muted); }

/* --------------------------------------------------------------- hours */
.day-head { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 14px 0 4px; }
.day-head:first-child { margin-top: 0; }
.shift-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid #eef1f3; font-size: 14px; }
.shift-row:first-of-type { border-top: none; }
.shift-row .dur { font-weight: 800; color: var(--navy); white-space: nowrap; }
.team-hours-row { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; border-top: 1px solid #eef1f3; padding: 12px 0; font-size: 15px; text-align: left; }
.team-hours-row:first-of-type { border-top: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button { border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px; font-weight: 700; color: var(--muted); }
.seg button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { color: var(--muted); text-align: center; padding: 22px 10px; font-size: 14px; }
.hint-card { border-style: dashed; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-width: 92vw; text-align: center;
}
@media (min-width: 760px) {
  #content { padding-top: 22px; }
  #map { height: 54dvh; }
}

/* ------------------------------------------------ crew activity (notifications) */
.notif-badge { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 2px 8px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.notif-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 10px 0; color: var(--ink); font: inherit; }
.notif-row:last-child { border-bottom: 0; }
button.notif-row { cursor: pointer; }
button.notif-row:active { background: var(--canvas); }
.notif-ic { font-size: 16px; line-height: 1.35; flex: none; }
.notif-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-sum { font-size: 14px; }
.notif-meta { font-size: 12px; color: var(--muted); }
.notif-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--green); flex: none; margin-top: 6px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notif-head h3 { margin: 0; }

/* ------------------------------------------------- v4: two role shells */
/* The tab bar is built by app.js from the shell's tab set. */
#tabbar.cols-3 { grid-template-columns: repeat(3, 1fr); }
#lang-btn { font-weight: 700; }

/* Worker shell: same BossBoard Twin tokens, just roomier — bigger base
   type and touch targets for gloves and glare in the field. */
body.shell-worker { font-size: 17px; }
body.shell-worker #content { gap: 16px; }
body.shell-worker .card { padding: 19px 17px; }
body.shell-worker .card h3 { font-size: 17px; }
body.shell-worker .greeting { font-size: 27px; }
body.shell-worker .subline { font-size: 15px; }
body.shell-worker #tabbar .tab { font-size: 12.5px; gap: 4px; }
body.shell-worker #tabbar .tab svg { width: 26px; height: 26px; }
body.shell-worker .btn { padding: 13px 18px; font-size: 15.5px; border-radius: 12px; }
body.shell-worker .btn.small { padding: 9px 13px; font-size: 14px; }
body.shell-worker .btn-checkin, body.shell-worker .btn-checkout {
  font-size: 25px; padding: 27px 16px; border-radius: 16px; letter-spacing: .6px;
}
body.shell-worker select.job-pick, body.shell-worker textarea.field { padding: 15px; font-size: 17px; }
body.shell-worker .stat .num { font-size: 30px; }
body.shell-worker .stat .lbl { font-size: 12.5px; }
body.shell-worker .feed-body, body.shell-worker .addr, body.shell-worker .job-meta { font-size: 15.5px; }
body.shell-worker .job-card { padding: 19px 17px; }
body.shell-worker .form-grid input, body.shell-worker .form-grid select { padding: 14px; font-size: 17px; }
body.shell-worker .shift-row, body.shell-worker .checkin-line { font-size: 15px; padding: 10px 0; }

/* On-the-clock status pill (worker home). */
.status-pill {
  display: flex; align-items: center; gap: 9px;
  border-radius: 999px; padding: 11px 16px;
  font-weight: 700; font-size: 15.5px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
}
.status-pill .dot { width: 11px; height: 11px; border-radius: 50%; background: #b9c4c9; flex: none; }
.status-pill.on { background: #e8f4ef; border-color: #bfe3d4; color: var(--green-dark); }
.status-pill.on .dot { background: var(--green); animation: pulse 1.6s infinite; }

/* Big Directions button (worker shell job cards). */
.btn-directions {
  display: block; width: 100%; text-align: center; text-decoration: none;
  background: var(--navy); color: #fff; font-weight: 800; font-size: 17px;
  border-radius: 12px; padding: 15px 16px; margin-top: 12px;
}
.btn-directions:active { background: #0b1a20; }

/* v4: auth-card alternate actions (Create account / Sign in / language) */
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.dotted-link { background: none; border: none; padding: 0; font: inherit; color: var(--green); font-weight: 700; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }

/* ============================================ BossBoard Mobile extras */
/* ---------------------------------------------------------- full sheet */
.sheet {
  position: fixed; inset: 0; z-index: 60; background: var(--canvas);
  display: flex; flex-direction: column;
}
.sheet-head {
  background: var(--navy); color: #fff; flex: none;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
}
.sheet-title { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  width: 100%; max-width: 640px; margin: 0 auto;
  padding: 14px 14px calc(26px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 14px;
}

/* ---------------------------------------------------------------- home */
.bignum { font-size: 42px; font-weight: 800; color: var(--navy); letter-spacing: -1px; line-height: 1.05; }
.bignum .cents { font-size: 24px; color: var(--muted); }
.stat-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.strip-stat { text-align: left; }
.strip-stat .num { font-size: 17px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.strip-stat .num.green { color: var(--green); }
.strip-stat .num.red { color: var(--red); }
.strip-stat .lbl { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; line-height: 1.25; }
.money-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.money-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.money-card .num { font-size: 18px; font-weight: 800; color: var(--navy); }
.money-card .lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
@media (max-width: 380px) { .stat-strip { grid-template-columns: repeat(3, 1fr); row-gap: 12px; } }
.follow-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; }
.follow-card .who { font-weight: 700; font-size: 15px; color: var(--navy); }
.follow-card .meta { color: var(--muted); font-size: 12.5px; }
.follow-card .amt { margin-left: auto; font-weight: 800; color: var(--green); text-decoration: underline dotted; text-underline-offset: 3px; white-space: nowrap; }
.date-pill { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; background: #eef1f3; color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.date-pill.overdue { background: #fdecec; color: var(--red); border-color: #f3c2c2; }
.date-pill.today { background: #e8f4ef; color: var(--green-dark); border-color: #bfe3d4; }
.stage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stage-tile { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-align: left; width: 100%; }
.stage-tile .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stage-tile .nm { font-weight: 700; font-size: 14px; color: var(--navy); }
.stage-tile .ct { margin-left: auto; font-size: 16px; font-weight: 800; color: var(--navy); }

/* -------------------------------------------------------------- clients */
.client-card { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.client-card:active { border-color: var(--green); }
.client-card .row1 { display: flex; align-items: baseline; gap: 10px; }
.client-card .nm { font-weight: 800; font-size: 16px; color: var(--navy); }
.client-card .amt { margin-left: auto; font-weight: 800; color: var(--green); text-decoration: underline dotted; text-underline-offset: 3px; white-space: nowrap; }
.client-card .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.client-card .row2 { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #eef1f3; border: 1px solid var(--border); color: var(--ink); }
.stage-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.filter-row { display: flex; gap: 8px; }
.filter-row input[type="search"], .filter-row select { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; padding: 11px; background: var(--card); }
.action-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.action-row .btn { text-align: center; text-decoration: none; display: block; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid #eef1f3; font-size: 14px; }
.kv:first-of-type { border-top: none; }
.kv .k { color: var(--muted); font-weight: 600; flex: none; }
.kv .v { text-align: right; font-weight: 600; color: var(--navy); word-break: break-word; }
.seg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-chips button { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg-chips button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ------------------------------------------------------------- pipeline */
.stage-head { display: flex; align-items: center; gap: 8px; margin: 4px 2px 0; }
.stage-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.stage-head .nm { font-weight: 800; font-size: 15px; color: var(--navy); }
.stage-head .ct { color: var(--muted); font-size: 13px; font-weight: 700; }
.stage-head .sum { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ documents */
.pill-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: #eef1f3; color: var(--muted); }
.pill-status.st-good { background: #e8f4ef; color: var(--green-dark); border-color: #bfe3d4; }
.pill-status.st-bad { background: #fdecec; color: var(--red); border-color: #f3c2c2; }
.pill-status.st-warn { background: #fff7e6; color: #8a5a00; border-color: #f0c26b; }
.pill-status.st-dim { background: #eef1f3; color: var(--muted); border-color: var(--border); }
.doc-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #eef1f3; font-size: 14px; }
.doc-item:first-of-type { border-top: none; }
.doc-item .d { flex: 1; min-width: 0; }
.doc-item .d .det { color: var(--muted); font-size: 12.5px; }
.doc-item .q { color: var(--muted); white-space: nowrap; }
.doc-item .t { font-weight: 700; color: var(--navy); white-space: nowrap; }
.totals .kv .v.total { font-size: 17px; font-weight: 800; }
.sig-pad { width: 100%; height: 170px; border: 1.5px dashed var(--border); border-radius: 10px; background: #fbfcfc; touch-action: none; }
.sig-img { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #fff; }

/* ------------------------------------------------------------ more menu */
.menu-list { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border); padding: 15px 2px; font-size: 16px; font-weight: 700; color: var(--navy); }
.menu-item:last-child { border-bottom: none; }
.menu-item .ic { font-size: 19px; width: 26px; text-align: center; flex: none; }
.menu-item .chev { margin-left: auto; color: var(--muted); font-weight: 400; }
.menu-item .sub { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 1px; }

/* -------------------------------------------------------------- catalog */
.swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.swatch img { width: 100%; height: 44px; object-fit: cover; display: block; }
.swatch .sw-color { height: 44px; }
.swatch .sw-name { font-size: 10.5px; font-weight: 600; color: var(--navy); padding: 5px 6px; line-height: 1.25; }
.doc-swatch { width: 74px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* -------------------------------------------------------- options bits */
.accent-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.accent-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.accent-dot.active { border-color: var(--navy); box-shadow: 0 0 0 2px #fff inset; }
.temp-pw { font-family: ui-monospace, Menlo, monospace; font-size: 17px; font-weight: 700; background: #e8f4ef; border: 1px dashed var(--green); border-radius: 10px; padding: 10px 12px; word-break: break-all; }

/* ------------------------------------------------------------- themes */
/* Dark theme (Options → Appearance): same tokens, deep-navy surfaces. */
body.theme-dark { --canvas: #0d181d; --card: #16262e; --border: #2b3f49; --ink: #e6eef1; --muted: #93a7b0; }
body.theme-dark .card h2, body.theme-dark .card h3, body.theme-dark .job-name,
body.theme-dark .greeting, body.theme-dark .bignum, body.theme-dark .strip-stat .num,
body.theme-dark .money-card .num, body.theme-dark .stage-tile .nm, body.theme-dark .stage-tile .ct,
body.theme-dark .client-card .nm, body.theme-dark .kv .v, body.theme-dark .doc-item .t,
body.theme-dark .stage-head .nm, body.theme-dark .follow-card .who, body.theme-dark .menu-item { color: #eef5f7; }
body.theme-dark .bignum .cents { color: var(--muted); }
body.theme-dark select.job-pick, body.theme-dark input.field, body.theme-dark textarea.field,
body.theme-dark .form-grid input, body.theme-dark .form-grid select,
body.theme-dark .filter-row input[type="search"], body.theme-dark .filter-row select,
body.theme-dark .auth-card input { background: #0f1e25; color: var(--ink); }
body.theme-dark .auth-card { background: var(--card); }
body.theme-dark .auth-logo, body.theme-dark .auth-card label, body.theme-dark .form-grid label { color: #eef5f7; }
body.theme-dark .sig-pad { background: #0f1e25; }
body.theme-dark .feed-post, body.theme-dark .kv, body.theme-dark .doc-item, body.theme-dark .checkin-line,
body.theme-dark .receipt-row, body.theme-dark .shift-row, body.theme-dark .onsite-row { border-top-color: #22353f; }
body.theme-dark .notif-row { border-bottom-color: #22353f; }
/* Compact density (Options → Appearance). */
body.density-compact #content { gap: 9px; padding-top: 10px; }
body.density-compact .card { padding: 11px 13px; }
body.density-compact .client-card { padding: 10px 13px; }
