/* Wellzyne Core — navy & white, mobile first. Look agreed with the Owner 20-Nov-2026 (Style 1 + colour columns). */
@font-face { font-family: Inter; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/inter-Regular.woff) format('woff'); }
@font-face { font-family: Inter; font-weight: 500; font-style: normal; font-display: swap; src: url(/fonts/inter-Medium.woff) format('woff'); }
@font-face { font-family: Inter; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/inter-SemiBold.woff) format('woff'); }
@font-face { font-family: Inter; font-weight: 700 800; font-style: normal; font-display: swap; src: url(/fonts/inter-Bold.woff) format('woff'); }
:root {
  --navy: #1B2E5A; --navy-2: #24407A; --navy-soft: #E8EDF7;
  --bg: #F5F7FA; --card: #FFFFFF; --line: #E3E8EF; --line-2: #EEF1F5;
  --text: #14213D; --muted: #5A6478;
  --good: #146C3A; --good-bg: #E3F4EA; --warn: #7A5B00; --warn-bg: #FEF6D8; --bad: #A1271C; --bad-bg: #FDE8E6;
  --good-solid: #1E8E3E; --warn-solid: #E0A800; --bad-solid: #D93025;
  --wa: #1A8754; --wa-dark: #0B6B57; --wa-soft: #D9FDD3;
  --radius: 10px; --nav-h: 64px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
a { color: var(--navy-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); } .small { font-size: 13px; } .strong { font-weight: 600; }
.center { text-align: center; } .mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.row { display: flex; align-items: center; } .wrap { flex-wrap: wrap; } .end { justify-content: flex-end; }
.gap { gap: 10px; } .gap-sm { gap: 6px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 720px; }
.pad { padding: 14px 16px 0; }

/* Shell */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  height: 56px; padding: 0 12px 0 16px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--navy);
  align-items: center; justify-content: center; font-weight: 800; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 14px; font-size: 26px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
main { padding: 16px 16px calc(var(--nav-h) + 24px); outline: none; }
.env-banner { background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-align: center; padding: 6px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: #fff; border-top: 1px solid var(--line); }
.bottom-nav .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); text-decoration: none; min-width: 0; }
.bottom-nav .nav-item.active { color: var(--navy); font-weight: 700; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  /* The menu scrolls inside its own navy bar when it is taller than the screen. */
  .sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; height: 100dvh;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
    padding: 20px 14px; background: var(--navy); color: #fff; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1 0 auto; }
  .sidebar .brand, .sidebar .user-box { flex: none; }
  .side-nav .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: #C9D6EA; text-decoration: none; font-weight: 500; }
  .side-nav .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
  .side-nav .nav-item.active { background: #fff; color: var(--navy); font-weight: 700; }
  .user-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.08); }
  .user-box .muted { color: #C9D6EA; }
  .user-box .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
  .topbar, .bottom-nav { display: none; }
  main { padding: 28px 32px 48px; max-width: 1100px; }
}

/* Cards, lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.link-card { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2);
  text-decoration: none; color: inherit; min-height: 60px; }
.card > .list-item:first-child, .list > .list-item:first-child { border-top: 0; }
.card:not(.flush) .list-item { padding-left: 0; padding-right: 0; }
a.list-item:hover { background: #F9FAFC; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-title { font-weight: 600; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 500; min-height: 44px; }
.detail-head { display: flex; flex-direction: column; gap: 6px; }

.hero { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.hero p { color: #C9D6EA; } .hero .hero-date { font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-bad .stat-num { color: var(--bad); } .stat-good .stat-num { color: var(--good); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #EEF0F4; color: #374151; }
.stage-interested, .stage-converted, .status-active { background: var(--good-bg); color: var(--good); }
.stage-negotiation { background: var(--navy-soft); color: var(--navy-2); }
.stage-follow_up, .status-prospect, .status-lead { background: var(--warn-bg); color: var(--warn); }
.stage-lost, .status-blocked { background: var(--bad-bg); color: var(--bad); }
.badge-house { background: var(--navy-soft); color: var(--navy-2); }
.due { font-size: 13px; font-weight: 600; } .due.overdue { color: var(--bad); } .due.today { color: var(--warn); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; white-space: nowrap; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--text); min-width: 0; height: 100%; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: #374151; }
.field-hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #CDD3DD;
  border-radius: 10px; background: #fff; }
.field textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-error { color: var(--bad); font-weight: 500; min-height: 0; }
.form-error:empty { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; } .btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-ghost { background: #fff; color: var(--navy); border-color: #CDD3DD; }
.btn-success { background: var(--good); color: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: #fff; color: var(--bad); border-color: #F1B8B2; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 14px; } .kv dd { margin: 0; font-weight: 600; }
.kv.big dd { font-size: 18px; }
.private-note { display: flex; align-items: center; gap: 8px; background: var(--navy-soft); color: var(--navy-2);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 12px; }
.call-panel { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.bar-row { display: grid; grid-template-columns: 100px 1fr 40px; align-items: center; gap: 10px; font-size: 14px; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--navy); border-radius: 999px; }
.bar-num { text-align: right; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 16px; border-top: 1px solid var(--line-2); white-space: nowrap; }
.table thead th { color: var(--muted); font-size: 12px; font-weight: 600; background: #F7F8FB; }
.table td.bad { color: var(--bad); font-weight: 700; }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty-title { color: var(--text); font-weight: 600; }
.loading { padding: 24px; text-align: center; color: var(--muted); }
.error-box { border-color: #F1B8B2; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }

.dialog { border: 0; border-radius: 14px; padding: 20px; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; }
.dialog:not([open]) { display: none; }
.dialog::backdrop { background: rgba(11, 37, 69, .45); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px); z-index: 50;
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast-error { background: var(--bad); }
.toast-warn { background: var(--warn); }

/* Login */
.login { min-height: 100vh; background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.login-inner { flex: 1; width: 100%; max-width: 400px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; justify-content: center; gap: 32px; }
.login-brand { display: flex; flex-direction: column; gap: 8px; }
.login-brand h1 { font-size: 28px; } .login-brand p { color: #C9D6EA; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .field-label { color: #C9D6EA; }
.login-form input { background: var(--navy-2); border-color: #2E4A72; color: #fff; font-size: 17px; }
.login-form input::placeholder { color: #8FA3C0; }
.login-form .btn-primary { background: #fff; color: var(--navy); }
.login-form .btn-primary:hover:not(:disabled) { background: #E8EEF7; }
.login-form .form-error { color: #FFC9C2; }
.login-note { color: #C9D6EA; font-size: 13px; text-align: center; }

/* Products & exclusivity */
.right-pending { background: var(--warn-bg); color: var(--warn); }
.right-active { background: var(--good-bg); color: var(--good); }
.right-rejected, .right-released { background: #EEF0F4; color: #4B5563; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker-results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.picker-results:empty { display: none; }
.picker-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0;
  border-top: 1px solid var(--line-2); background: #fff; text-align: left; cursor: pointer; min-height: 44px; }
.picker-item:first-child { border-top: 0; }
.picker-item:hover { background: #F9FAFC; }
.picker-results p { padding: 10px 12px; }
.picker-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--navy); border-radius: 10px; background: var(--navy-soft); }
.tag-form { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 12px; }
.tag-form h3 { margin: 0; font-size: 14px; }
.attention-link { padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); }
.pad-b { padding-bottom: 16px; }
details.card summary { cursor: pointer; font-weight: 600; min-height: 28px; }
details.card[open] summary { margin-bottom: 10px; }
.list-button { width: 100%; border: 0; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.upload-box { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 10px; }
.upload-box summary { cursor: pointer; font-weight: 600; color: var(--navy-2); min-height: 32px; }
.upload-box[open] summary { margin-bottom: 8px; }
.field input[type=file] { padding: 10px; }
.import-card { border-color: var(--navy); background: var(--navy-soft); }
.list-item.list-customer { border-left: 4px solid var(--good); }
.list-item.list-team { border-left: 4px solid var(--warn); }
.list-item.list-team .list-main > .small:nth-child(2) { color: var(--warn); font-weight: 600; }
.team-only { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; }

/* ---- WhatsApp ---- */
.btn-whatsapp { background: #1F8F4E; color: #fff; margin-top: 8px; }
.btn-whatsapp:hover { background: #18773F; }
.btn-link { background: none; border: none; color: var(--muted); text-decoration: underline; padding: 4px 0; min-height: 32px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; min-height: 36px; font: inherit; cursor: pointer; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.list-item.unread .list-title { font-weight: 700; }
.chat-preview { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.unread-dot { background: var(--bad); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.chat-card { padding: 0; overflow: hidden; }
.chat-log { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: #EFEAE2; max-height: 60vh; min-height: 220px; overflow-y: auto; }
.bubble { max-width: 82%; padding: 8px 10px 6px; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 2px; margin: 0; }
.bubble.in { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.bubble.out { align-self: flex-end; background: #D9FDD3; border-top-right-radius: 2px; }
.bubble.failed { background: var(--bad-bg); }
.bubble.preview { max-width: 100%; align-self: stretch; white-space: pre-wrap; }
.bubble-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: 11px; color: var(--muted); align-self: flex-end; }
.bubble-error { font-size: 12px; color: var(--bad); }
.composer { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.composer-form { display: flex; gap: 8px; align-items: flex-end; }
.composer-form textarea { flex: 1; min-width: 0; resize: vertical; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 14px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--good-bg); color: var(--good); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row.between { justify-content: space-between; align-items: center; }
.wrap-any { overflow-wrap: anywhere; }
.keys li.ok { color: var(--good); }
.keys li.missing { color: var(--bad); }
.small.block, .block { display: block; }

/* ---- Priority sections ---- */
.badge.prio { background: #FFF6DA; color: #7A5600; }
.badge.prio-very_important { background: #FDE7C4; color: #8A4B00; font-weight: 700; }
.prio-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.prio-chip.active.prio-very_important { background: #B45309; border-color: #B45309; }
.prio-chip.active.prio-important { background: #D97706; border-color: #D97706; }
.prio-chip.active.prio-moderate { background: #CA8A04; border-color: #CA8A04; }
.list-section { padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--navy-2); background: var(--navy-soft); border-bottom: 1px solid var(--line-2); }

/* ---- Targets / KPIs ---- */
.kpi-list { display: flex; flex-direction: column; gap: 12px; }
.kpi-row { display: flex; flex-direction: column; gap: 4px; }
.kpi-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kpi-label { font-weight: 600; flex: 1 1 auto; min-width: 140px; }
.kpi-value { font-variant-numeric: tabular-nums; }
.kpi-pct { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.kpi-pct.good { color: var(--good); } .kpi-pct.mid { color: var(--warn); } .kpi-pct.low { color: var(--bad); }
.kpi-bar { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.kpi-fill { display: block; height: 100%; border-radius: 999px; background: var(--navy); }
.kpi-fill.good { background: var(--good); } .kpi-fill.mid { background: #D97706; } .kpi-fill.low { background: var(--bad); }
.bad-text { color: var(--bad); font-weight: 700; }

/* ---- Import ---- */
.import-list { max-height: 50vh; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.import-row { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.import-row input { width: 20px; height: 20px; flex: none; }
.grow { flex: 1; min-width: 0; }

/* 2-step login */
.code-input { font-size: 24px !important; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.login-alt { background: transparent; color: #C9D6EA; border-color: rgba(255,255,255,.3); }
.twostep-on { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--good); margin: 0 0 8px; }
.twostep-setup .steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 16px; }
.twostep-setup .steps li { line-height: 1.5; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: fit-content; margin: 10px 0 6px; }
.qr-box img { display: block; width: 200px; height: 200px; }
.setup-key { font-size: 18px; letter-spacing: 1px; background: var(--bg); border-radius: 8px; padding: 10px 12px; margin: 8px 0; word-break: break-all; user-select: all; }
.badge-on { background: var(--good-bg); color: var(--good); }

/* Commission */
.commission-box { border-top: 1px solid var(--line-2); margin-top: 8px; padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.commission-box.earned .kpi-value { font-size: 18px; }
.commission-steps { margin: 4px 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.good-text { color: var(--good); }
.new-customers summary { cursor: pointer; margin-top: 4px; }
.new-customers ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }

/* Broadcast */
.tpl-body { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 0; }
.tpl-body:empty { display: none; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
progress { width: 100%; height: 10px; }

/* WhatsApp connection alerts */
.wa-alert { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; text-decoration: none; }
.wa-alert.bad { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); }
.wa-alert.good { background: var(--good-bg); color: var(--good); }
.wa-alert .link { text-decoration: underline; font-weight: 700; }
.wa-state { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; }
.wa-state.good { color: var(--good); } .wa-state.bad { color: var(--bad); }
.wa-events li.bad .strong { color: var(--bad); } .wa-events li.good .strong { color: var(--good); }
.plain-ol { margin: 0; padding-left: 20px; } .plain-ol li { margin: 2px 0; }
.block { display: block; }
.stack-sm > * + * { margin-top: 6px; }

/* Notifications */
.notif-count, .chats-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; margin-left: auto; }
/* count / dot sit on the menu icon (phone bar and sidebar) */
.nav-icon { position: relative; display: inline-flex; }
.nav-icon .notif-count, .nav-icon .chats-count { position: absolute; top: -6px; right: -10px; margin: 0; border: 2px solid #fff; height: 20px; line-height: 16px; }
.side-nav .nav-icon .notif-count, .side-nav .nav-icon .chats-count { border-color: var(--navy); }
.nav-dot { position: absolute; top: -2px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
.side-nav .nav-dot { border-color: var(--navy); }
.bottom-nav .nav-item span:last-child { font-size: 11px; white-space: nowrap; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li + li { border-top: 1px solid var(--line, #E5E7EB); }
.notif-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0;
  padding: 12px 14px; font: inherit; color: inherit; cursor: pointer; }
.notif-item:hover, .notif-item:focus-visible { background: #F6F7FA; }
.notif-item.unread { background: #F3F6FD; }
.notif-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #EEF0F4; color: #374151; }
.notif-item.bad .notif-icon { background: var(--bad-bg); color: var(--bad); }
.notif-item.good .notif-icon { background: var(--good-bg); color: var(--good); }
.notif-item.warn .notif-icon { background: var(--warn-bg); color: var(--warn); }
.notif-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-text .badge { margin-left: 6px; }
.notif-item .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); margin-top: 6px; }

/* Pop-ups for new notifications */
.popups { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px;
  width: min(420px, calc(100vw - 24px)); }
.popup { display: flex; align-items: flex-start; gap: 10px; background: #fff; border-radius: 12px; padding: 10px 10px 10px 12px;
  box-shadow: 0 8px 28px rgba(11, 37, 69, .22); border-left: 4px solid var(--navy); animation: popin .2s ease-out; }
.popup.bad { border-left-color: var(--bad); } .popup.good { border-left-color: var(--good); } .popup.warn { border-left-color: var(--warn); }
.popup.bad .notif-icon { background: var(--bad-bg); color: var(--bad); } .popup.good .notif-icon { background: var(--good-bg); color: var(--good); }
.popup.warn .notif-icon { background: var(--warn-bg); color: var(--warn); }
.popup-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.popup-x { flex: none; background: none; border: 0; font-size: 22px; line-height: 1; color: #6B7280; cursor: pointer; padding: 0 4px; }
@keyframes popin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) { .popups { left: auto; right: 16px; transform: none; } }
@media (prefers-reduced-motion: reduce) { .popup { animation: none; } }

/* Chat sections by company number */
.tabs.sections .tab { position: relative; }
.tab-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-left: 6px; vertical-align: middle; }
.section-badge { background: var(--navy-soft); color: var(--navy-2); align-self: flex-start; }
.number-row { border-top: 1px solid var(--line); padding-top: 8px; }
.number-row input[type=text] { flex: 1 1 140px; min-width: 120px; }
.number-row select { flex: 1 1 160px; }
.key-state { margin: 4px 0 0; } .key-state.ok { color: var(--good); } .key-state.warn { color: var(--warn); }
.number-row input[type=password] { flex: 1 1 200px; min-width: 160px; }

/* Salesmen pages */
.salesman-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.salesman-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.salesman-card:hover { box-shadow: 0 4px 16px rgba(11, 37, 69, .12); }
.salesman-card h2 { margin: 0; font-size: 17px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: #374151; }
.bad-text { color: var(--bad); } .good-text { color: var(--good); }
.bar-fill.good { background: var(--good); }

/* Media in chats */
.media-box { margin: 2px 0 4px; }
.media-img { display: block; max-width: min(260px, 100%); max-height: 320px; border-radius: 8px; }
.media-audio { width: min(260px, 100%); }
.media-video { max-width: min(280px, 100%); border-radius: 8px; }
.wa-number + .wa-number { border-top: 1px solid var(--line); padding-top: 8px; }
.wa-state.muted { color: var(--muted, #6B7280); }
/* Daily WhatsApp summary (My Day, Owner) */
.summary-number { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.summary-number h3 { margin: 0 0 4px; font-size: 16px; }
.summary-note { margin: 0 0 6px; line-height: 1.5; }
.summary-convs summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--navy); }
.summary-convs[open] summary { margin-bottom: 6px; }
.input-sm { min-height: 36px; padding: 4px 8px; font-size: 14px; }
.chats-counts { margin: -6px 0 0; font-size: 15px; }
.older-btn { margin: 4px auto 8px; }
/* Summary page (Owner): flowchart + messages by hour */
.summary-headline { font-size: 16px; line-height: 1.6; margin: 0; }
.summary-person h2 { margin-bottom: 4px; }
.flow { --flow-line: #9AA6B8; margin: 8px 0 4px; }
.flow-top { display: flex; justify-content: center; }
.flow-box { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; border-radius: 10px;
  padding: 10px 12px; border: 1.5px solid var(--line); background: #fff; min-width: 0; }
.flow-start { border-color: var(--navy); background: var(--navy-soft); min-width: 200px; }
.flow-num { font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--text); }
.flow-label { font-size: 13px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
.flow-sub { font-size: 12px; color: var(--muted); }
.flow-split { height: 14px; margin: 14px 12.5% 0; border: 2px solid var(--flow-line); border-bottom: 0; border-radius: 8px 8px 0 0;
  position: relative; }
.flow-split::before { content: ''; position: absolute; left: 50%; top: -14px; height: 12px; border-left: 2px solid var(--flow-line); }
.flow-branches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.flow-branch { display: flex; flex-direction: column; align-items: stretch; }
.flow-arrow { align-self: center; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--flow-line); margin-bottom: 4px; }
.flow-good { border-color: var(--good); background: var(--good-bg); } .flow-good .flow-label { color: var(--good); }
.flow-warn { border-color: #C2700A; background: var(--warn-bg); } .flow-warn .flow-label { color: var(--warn); }
.flow-bad { border-color: var(--bad); background: var(--bad-bg); } .flow-bad .flow-label { color: var(--bad); }
.flow-wait { border-style: dashed; }
@media (max-width: 600px) {
  .flow-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-split { margin: 14px 25% 0; }
}
.hours { --series-1: #2a78d6; --series-2: #eb6834; margin-top: 10px; }
.hours-legend { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 6px; }
.hours-legend .key { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.key-in { background: var(--series-1); } .key-out { background: var(--series-2); }
.hours-plot { display: flex; align-items: stretch; gap: 2px; height: 160px; overflow-x: auto; padding-top: 4px; }
.hour { flex: 1 0 22px; max-width: 56px; display: flex; flex-direction: column; align-items: center; height: 100%; outline-offset: 2px; }
.hour:hover, .hour:focus { background: var(--line-2); border-radius: 4px; }
.hour-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.hour .bar { width: 7px; min-height: 0; border-radius: 3px 3px 0 0; }
.bar-in { background: var(--series-1); } .bar-out { background: var(--series-2); }
.hour-label { font-size: 10px; color: var(--muted); height: 16px; line-height: 16px; white-space: nowrap; }
.summary-table { grid-template-columns: minmax(0, 1fr) max-content; background: var(--line-2); border-radius: 10px; padding: 10px 12px; gap: 6px 16px; }
.summary-table dt { color: var(--text); font-size: 15px; }
.summary-table dt.sub { padding-left: 18px; color: var(--muted); }
.summary-table dt.sub::before { content: '– '; }
.summary-table dd { text-align: right; font-size: 15px; }
.tone-good { color: var(--good); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); }
.summary-note { font-size: 15px; }
.report-head { margin: 16px 0 2px; font-size: 16px; }
.report-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.report-item { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; }
.report-item p { margin: 3px 0 0; line-height: 1.45; }
.report-item .list-title { color: var(--navy); text-decoration: none; }
.answer-quick { border-left-color: var(--good); } .answer-late { border-left-color: #C2700A; }
.answer-none { border-left-color: var(--bad); } .answer-wait { border-left-color: #9AA6B8; }
/* Log a call */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--text);
  font: inherit; font-size: 15px; cursor: pointer; }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.dialog.log-call { width: min(520px, calc(100vw - 32px)); }
.dialog.log-call textarea { width: 100%; }
/* Summary: team table and calls */
.team-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.team-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.team-table th, .team-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.team-table th:first-child, .team-table td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
.team-table thead th { font-size: 12px; color: var(--muted); font-weight: 600; vertical-align: bottom; white-space: normal; }
.team-table tbody tr:hover td { background: var(--line-2); }
/* Labels on chats */
.label-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; line-height: 18px; }
.lc-navy { background: #E3E9F5; color: #1B2F5B; } .lc-green { background: #DFF3E6; color: #17663A; } .lc-orange { background: #FDEBD8; color: #8A4A0B; }
.lc-red { background: #FBE2E0; color: #9B1C14; } .lc-purple { background: #EDE4F8; color: #5B2D8F; } .lc-teal { background: #DCF2F1; color: #0F5F5B; }
.lc-pink { background: #FBE3EF; color: #8E1F57; } .lc-gray { background: #ECEEF1; color: #3E4652; }
.chip.lc-navy.on, .chip.lc-green.on, .chip.lc-orange.on, .chip.lc-red.on, .chip.lc-purple.on, .chip.lc-teal.on, .chip.lc-pink.on, .chip.lc-gray.on { outline: 3px solid var(--navy); outline-offset: 1px; }
.chip.swatch { width: 34px; min-height: 34px; padding: 0; }
.dialog.label-dialog { width: min(560px, calc(100vw - 32px)); }
.dialog.label-dialog input[name=new_label] { width: 100%; }
/* Select many chats */
.list .list-item input.pick { display: none; width: 20px; height: 20px; margin-right: 10px; flex: none; align-self: center; }
.list.selecting .list-item input.pick { display: block; }
.list.selecting .list-item.picked { background: var(--navy-soft); }
.select-bar { position: sticky; bottom: 72px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(16, 24, 40, .12); }
@media (min-width: 900px) { .select-bar { bottom: 16px; } }
.upload-names { margin-top: 4px; }

/* Ad leads, customer documents, sale orders (migration 0041) */
.ad-tag { display: flex; align-items: center; gap: 4px; color: var(--good); font-weight: 600; margin: 2px 0; }
.bubble .ad-tag { font-size: 12px; }
.key-state.bad { color: var(--bad); font-weight: 600; }
.doc-form { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 12px; }
.doc-form h3 { margin: 0; font-size: 14px; }
.doc-img { max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid var(--line); }
.doc-dialog { width: min(720px, calc(100vw - 32px)); }
.badge.order-good { background: var(--good-bg); color: var(--good); }
.badge.order-warn { background: var(--warn-bg); color: var(--warn); }
.badge.order-bad { background: var(--bad-bg); color: var(--bad); }
.badge.order-muted { background: var(--line-2); color: var(--muted); }
.order-lines { display: flex; flex-direction: column; gap: 10px; }
.order-line { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.order-line .field { flex: 1 1 140px; min-width: 120px; margin: 0; }
.order-line input { width: 100%; }
.order-line .chips { flex-wrap: wrap; overflow: visible; }
.order-line .chip { height: 30px; font-size: 13px; padding: 0 10px; }
.order-total { font-size: 17px; text-align: right; }
.order-table td, .order-table th { white-space: normal; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .popups, .env-banner, #toasts, .toast, .wa-alert, .draft-note { display: none !important; }
  .shell { display: block; } body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* Quality KPIs (migration 0042) */
.kpi-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.kpi-group { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.kpi-group-title { font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; }

/* Order steps (migration 0043) */
.order-steps { list-style: none; margin: 0; padding: 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.order-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; position: relative; min-width: 0; }
.order-steps li:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line); }
.order-steps li.done:not(:last-child)::after { background: var(--good); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--line-2); color: var(--muted); border: 2px solid var(--line); z-index: 1; }
.order-steps li.done .step-dot { background: var(--good); border-color: var(--good); color: #fff; }
.order-steps li.current .step-dot { background: var(--navy); border-color: var(--navy); color: #fff; }
.order-steps.cancelled { opacity: .55; }
.step-title { font-size: 13px; font-weight: 600; }
.step-sub { font-size: 11px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .step-sub { display: none; } .order-steps { padding: 10px 6px; } }
.action-card { border: 2px solid var(--navy); }
.bank-card p { margin: 2px 0; }
.big { font-size: 18px; }
.print-only { display: none; }
.print-head { justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 8px; }
.sign-row { justify-content: space-between; margin-top: 48px; }
.order-settings summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.order-settings form { margin-top: 12px; }
@media print {
  .print-only { display: block; }
  .print-head, .sign-row { display: flex; }
  .order-page .detail-head .badge { display: none; }
}

/* Staff and company papers (migration 0044) */
.staff-papers { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.staff-papers.ok { color: var(--good); } .staff-papers.warn { color: var(--warn); }
.paper-row { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.paper-row input[type=file] { max-width: 100%; }
.paper-row input:not([type=file]) { max-width: 220px; }

/* My Day: What to do today */
.todo-group { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; border-top: 1px solid var(--line-2); }
.todo-item { border-left: 4px solid transparent; }
.todo-item.todo-bad { border-left-color: var(--bad); }
.todo-item.todo-warn { border-left-color: var(--warn); }
.todo-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); flex: none; }
.todo-bad .todo-icon { background: var(--bad-bg); color: var(--bad); }
.todo-warn .todo-icon { background: var(--warn-bg); color: var(--warn); }

/* Sale order like Tablet's + ledger (migration 0046) */
.order-page.narrow, .so-wrap { max-width: 1000px; }
.so-sheet { display: flex; flex-direction: column; gap: 12px; }
.so-title { text-align: center; border-bottom: 2px solid var(--navy); padding-bottom: 6px; }
.so-title p { font-weight: 700; color: var(--navy); letter-spacing: .04em; }
.so-title .so-co { font-size: 18px; }
.so-head { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.so-head .so-field:nth-of-type(n+2) { grid-column: 1; }
.so-meta { grid-row: 1 / span 3; grid-column: 2; align-self: start; text-align: right; color: var(--muted); }
.so-field { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 8px; }
.so-field > span { font-weight: 600; font-size: 14px; }
.so-field input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.so-field input[readonly] { background: var(--line-2); }
.so-newcust { border: 1px dashed var(--navy); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.so-newcust-row { display: flex; flex-wrap: wrap; gap: 6px; }
.so-newcust-row input { flex: 1 1 160px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; }
.suggest { position: relative; flex: 1 1 auto; min-width: 0; }
.suggest input { width: 100%; }
.suggest-list { position: fixed; z-index: 1000; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(11, 37, 69, .14); max-height: 300px; overflow-y: auto; min-width: 240px; }
.suggest-list li { padding: 7px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.suggest-list li.active, .suggest-list li:hover { background: var(--navy-soft); }
.so-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.so-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.so-table th { background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; padding: 7px 6px; white-space: nowrap; }
.so-table td { padding: 5px 6px; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.so-table td input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; background: #fff; text-align: right; }
.so-table td.so-prod { min-width: 240px; }
.so-table td.so-prod input { text-align: left; }
.so-table td input:disabled { background: var(--line-2); }
.so-table tr.so-bad td input { border-color: var(--bad); }
.so-warn { color: var(--bad); }
.so-table input[type=number] { -moz-appearance: textfield; }
.so-table input::-webkit-outer-spin-button, .so-table input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.so-view td { white-space: normal; }
.so-bottom { display: grid; grid-template-columns: 1fr minmax(240px, 320px); gap: 12px; padding-bottom: 12px; }
.so-totals { display: flex; flex-direction: column; gap: 2px; }
.so-tot-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.so-tot-row.strong { border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 6px; font-size: 17px; font-weight: 700; color: var(--navy); }
.so-remarks { font-size: 14px; }
.so-sign { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 4px; font-size: 13px; color: var(--muted); }
@media (max-width: 560px) {
  .so-head { grid-template-columns: 1fr; }
  .so-meta { grid-row: auto; grid-column: 1; text-align: left; display: flex; gap: 12px; }
  .so-field { grid-template-columns: 64px 1fr; }
  .so-bottom { grid-template-columns: 1fr; }
}
.ledger-balance { margin: 2px 0; }
.ledger-mini li { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.ledger-table { width: 100%; min-width: 560px; }
.ledger-table th { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sub-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.sub-card h3 { margin: 0; font-size: 14px; }
@media print {
  .so-table { min-width: 0; font-size: 11px; }
  .so-table th { background: #fff !important; color: #000; border-bottom: 1px solid #000; }
  .so-sign { color: #000; margin-top: 40px; }
  .order-page.narrow { max-width: none; }
}
/* Phone: each product line of the sale order becomes a small card */
@media (max-width: 640px) {
  .so-sheet .so-table { min-width: 0; }
  .so-sheet .so-table thead, .so-sheet .so-table tr.so-line td.c-no { display: none; }
  .so-sheet .so-table tbody, .so-sheet .so-table tr.so-line { display: block; }
  .so-sheet .so-table tr.so-line { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .so-sheet .so-table tr.so-line td { display: block; padding: 0; border: 0; min-width: 0; }
  .so-sheet .so-table td.so-prod { grid-column: 1 / -1; padding-right: 44px; min-width: 0; }
  .so-sheet .so-table tr.so-empty td:not(.so-prod) { display: none; }
  .so-sheet .so-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-align: left; }
  .so-sheet .so-table td.c-gross, .so-sheet .so-table td.c-gst, .so-sheet .so-table td.c-adv, .so-sheet .so-table td.c-total { text-align: left; font-size: 14px; }
  .so-sheet .so-table td.c-x { position: absolute; top: 10px; right: 0; }
}
/* Area report (migration 0048) */
.area-report h3 { margin: 6px 0 0; font-size: 14px; }
.area-total { font-size: 16px; color: var(--navy); }
.area-products { width: 100%; min-width: 520px; }
.area-customers .list-item, .area-top .list-item { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line-2); font: inherit; cursor: pointer; }
.area-top summary { cursor: pointer; font-weight: 600; color: var(--navy); }
/* Logo (14-Nov-2026) */
.brand-logo { width: 30px; height: 30px; flex: none; }
.login-logo { display: block; width: min(300px, 80vw); height: auto; }
.print-logo { display: block; height: 40px; width: auto; margin-bottom: 4px; }
/* Menu sections (14-Nov-2026) */
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 6px; }
.nav-group-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px 12px 4px; background: none; border: 0;
  color: #8FA6C8; font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.nav-group-head:hover { color: #fff; }
.nav-group-head > svg { transform: rotate(90deg); transition: transform .15s; }
.nav-group.closed .nav-group-head > svg { transform: rotate(0deg); }
.nav-group-label { display: inline-flex; align-items: center; gap: 7px; }
.nav-group-label svg { opacity: .9; }
.more-head { display: flex; align-items: center; gap: 8px; }
.nav-group.closed .nav-group-items { display: none; }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; }
.side-nav { gap: 0; }
.more-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 4px 4px 0; }
/* Permissions page */
.perm-group > summary { cursor: pointer; padding: 2px 0; }
.perm-list { display: flex; flex-direction: column; margin-top: 8px; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.perm-row input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--navy); }
.perm-row.on .perm-label { font-weight: 600; }
.perm-row.locked { color: var(--muted); }
.perm-label { flex: 1 1 220px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.perm-code { font-weight: 400; }
.perm-sens { align-self: flex-start; margin-top: 2px; font-size: 10px; }
.perm-scope { width: auto; min-width: 120px; height: 34px; }
.perm-menu p { margin: 2px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.seg-btn { border: 0; background: #fff; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--navy); color: #fff; }
.so-table tr.so-bad .so-warn { color: var(--warn); }
.so-table tr.so-bad td input[name^=rate_], .so-table tr.so-bad td input[name^=disc_] { border-color: var(--warn); background: var(--warn-bg); }
.rate-card { border-left: 4px solid var(--warn); }
/* Payment form & sharing (14-Nov-2026) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--navy); }
.proof-list li { padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.proof-list:empty { display: none; }
.share-bar .btn { flex: 1 1 200px; justify-content: center; }
.so-table td input.locked { background: var(--line-2); color: var(--navy); font-weight: 600; }
.role-editor { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 6px; }
.so-table tr.so-note .so-warn { color: var(--muted); font-style: italic; }

/* ---- Stock received & rates (Update 42) ---- */
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 700px) { .rate-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rate-stats .stat-num { font-size: 22px; }
.table td.bad, .table td .bad { color: var(--bad); }
.table td.warn { color: var(--warn); }
.table tr.muted td { color: var(--muted); }
.table tr.selected td { background: var(--navy-soft); }
.rates-table td, .rates-table th { white-space: nowrap; }
.band-dot { display: inline-flex; align-items: center; gap: 8px; }
.band-dot::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.band-dot.band-bad::before { background: var(--bad); } .band-dot.band-warn::before { background: var(--warn); } .band-dot.band-good::before { background: var(--good); }
.receipt-line .suggest { width: 100%; }

/* ---- Taking out & the incharge's check (Update 44) ---- */
.pick-line.done { border-left: 4px solid var(--good); padding-left: 10px; }
.pick-check-row { display: flex; align-items: center; gap: 10px; }
.pick-check-row .list-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.pick-check-row .check-cell { display: flex; align-items: center; padding: 4px; }
.pick-check-row .check-cell input { width: 22px; height: 22px; }
.missing-box summary { cursor: pointer; }

/* ---- Stock on the sale order (Update 45) ---- */
.so-stock { color: var(--muted); }
.so-stock.over { color: var(--warn); font-weight: 600; }

/* ---- Demand ask on the sale order; demand list (Update 46) ---- */
.demand-ask { border: 1px solid var(--warn); background: var(--warn-soft, #fff7e6); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.demand-co { display: flex; flex-direction: column; gap: 8px; }
.demand-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.demand-row:first-of-type { border-top: 0; }
.demand-row input { width: 96px; text-align: right; }
.demand-who { grid-column: 1 / -1; }

/* ---- Register check (Update 47) ---- */
.code-box { width: 100%; font-size: 12px; line-height: 1.4; white-space: pre; }
.steps-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-num.small-num { font-size: 15px; }

/* Register check: names matched by a similar spelling (migration 0062) */
.reg-similar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: 13px; }
.chip.chip-xs { min-height: 30px; height: auto; padding: 3px 10px; font-size: 13px; white-space: normal; text-align: left; }
.stat-warn .stat-num { color: var(--warn); }

/* Purchases: rates checked by the store incharge (migration 0063) */
.rate-input { width: 110px; min-height: 38px; text-align: right; }
.btn-link.inline-link { margin-left: 10px; }

/* The customer's print code on the DC (migration 0067) */
.print-code { font-weight: 600; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.print-code span { font-size: 1.25em; letter-spacing: .04em; margin-left: 4px; }
.print-code-head { font-size: 1.1em; }
.print-code-input { max-width: 220px; text-transform: uppercase; }

/* One colour rule (Owner 19-Nov-2026): yellow = in process, green = completed, red = deleted. */
:root { --process: var(--warn); --process-bg: var(--warn-bg); }
.badge.order-warn { background: var(--process-bg); color: var(--process); }
.badge.order-good { background: var(--good-bg); color: var(--good); }
.badge.order-bad { background: var(--bad-bg); color: var(--bad); }
.list-item.is-deleted { background: #FFF7F6; border-left: 4px solid var(--bad); }
.list-item.is-deleted .list-title { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
tr.is-deleted td { background: #FFF7F6; color: var(--bad); }
tr.is-deleted td a { color: var(--bad); }
.is-deleted-line { color: var(--bad); }
.deleted-banner { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid #F1B8B2;
  background: var(--bad-bg); color: var(--bad); }
.deleted-banner strong { font-size: 16px; text-transform: none; }
.state-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 8px; }
.st-dot:first-child { margin-left: 0; }
.st-dot.st-process { background: var(--warn-solid); } .st-dot.st-done { background: var(--good); } .st-dot.st-deleted { background: var(--bad); }
@media print { .deleted-banner { border: 2px solid #000; color: #000; background: none; } }

/* Folding groups (Owner 19-Nov-2026): tap the title to hide / show a group */
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary h2::before { content: '▾'; display: inline-block; width: 1.1em; color: var(--muted); transition: transform .15s; }
details.fold:not([open]) > summary h2::before { transform: rotate(-90deg); }
.packers-line { margin: 0; }
@media print { form, .action-card, details.fold:not([open]) { display: none !important; } details.fold > summary .fold-hint { display: none; } }

/* ===========================================================================
   New look (Owner 20-Nov-2026): Style 1 (navy menu, clean cards) + colour columns from Style 2.
   Yellow = in process, green = completed, red = deleted. WhatsApp looks like WhatsApp.
   =========================================================================== */
h1 { letter-spacing: -.01em; }
.card { border-radius: var(--radius); }
.btn { border-radius: 8px; }
.hero { background: var(--navy); border-radius: 12px; padding: 18px 20px; }
.stat { border-radius: var(--radius); padding: 14px 16px; gap: 2px; }
.stat-num { font-size: 24px; letter-spacing: -.01em; }

/* Menu */
@media (min-width: 900px) {
  .sidebar { padding: 20px 12px; }
  .side-nav .nav-item { color: rgba(255,255,255,.78); padding: 9px 10px; border-radius: 8px; font-size: 14px; }
  .side-nav .nav-item.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
  .side-nav .nav-item.nav-chats { background: var(--wa); color: #fff; font-weight: 700; margin: 2px 0; }
  .side-nav .nav-item.nav-chats:hover { background: #157347; }
  .side-nav .nav-item.nav-chats.active { box-shadow: inset 0 0 0 2px #fff; }
  .side-nav .nav-chats .nav-icon .chats-count { border-color: var(--wa); }
}
.bottom-nav { align-items: stretch; }
.bottom-nav .nav-item { gap: 3px; font-weight: 600; }
.bottom-nav .nav-item .nav-icon { height: 34px; align-items: center; justify-content: center; }
.bottom-nav .nav-item.nav-new .nav-icon { width: 46px; border-radius: 12px; background: var(--navy); color: #fff; }
.bottom-nav .nav-item.nav-new { color: var(--navy); font-weight: 700; }
.bottom-nav .nav-item.nav-chats .nav-icon { width: 34px; border-radius: 17px; background: var(--wa); color: #fff; }
.bottom-nav .nav-item.nav-chats { color: var(--good); font-weight: 700; }
.bottom-nav .nav-item.nav-chats .nav-icon .chats-count { top: -4px; right: -8px; }
.topbar .top-bell { position: relative; color: #fff; }
.topbar .top-bell .nav-icon .notif-count { border-color: var(--navy); }
.topbar .top-bell.active { background: rgba(255,255,255,.16); }

/* Small coloured status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-wip { background: var(--warn-bg); color: var(--warn); } .pill-wip .pill-dot { background: var(--warn-solid); }
.pill-done { background: var(--good-bg); color: var(--good); } .pill-done .pill-dot { background: var(--good-solid); }
.pill-del { background: var(--bad-bg); color: var(--bad); } .pill-del .pill-dot { background: var(--bad-solid); }

/* Home */
.day-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .day-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.day-grid > :only-child { grid-column: 1 / -1; }
.recent-orders .list-item { min-height: 0; padding: 12px 16px; }
.recent-orders .list-main { gap: 4px; }

/* Colour columns: three big boxes on a phone choose the column; on a laptop the three stand side by side */
.colour-wrap { display: flex; flex-direction: column; gap: 12px; }
.colour-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.colour-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 62px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); text-decoration: none; }
.colour-box .cb-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.colour-box .cb-label { font-size: 12px; font-weight: 600; }
.colour-box.cb-wip { color: var(--warn); border-color: #F2D46B; }
.colour-box.cb-done { color: var(--good); border-color: #A9DDB9; }
.colour-box.cb-del { color: var(--bad); border-color: #F3B3AD; }
.colour-box.active { border-width: 2px; }
.colour-box.cb-wip.active { background: #FFFBEB; border-color: var(--warn-solid); }
.colour-box.cb-done.active { background: #F1FAF4; border-color: var(--good-solid); }
.colour-box.cb-del.active { background: #FEF3F2; border-color: var(--bad-solid); }
.colour-board { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.colour-col { display: none; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.colour-col.chosen { display: flex; flex-direction: column; }
.colour-col.cc-wip { background: #FFFBEB; border-color: #F2D46B; }
.colour-col.cc-done { background: #F1FAF4; border-color: #A9DDB9; }
.colour-col.cc-del { background: #FEF3F2; border-color: #F3B3AD; }
.cc-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid; border-color: inherit; }
.cc-head h2 { margin: 0; flex: 1; font-size: 15px; font-weight: 700; }
.cc-count { font-weight: 700; }
.cc-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cc-wip .cc-head { color: var(--warn); } .cc-wip .cc-icon { background: var(--warn-solid); color: #3D2D00; }
.cc-done .cc-head { color: var(--good); } .cc-done .cc-icon { background: var(--good-solid); color: #fff; }
.cc-del .cc-head { color: var(--bad); } .cc-del .cc-icon { background: var(--bad-solid); color: #fff; }
.cc-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.cc-sub { margin: 4px 2px 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cc-sub:first-child { margin-top: 0; }
.cc-empty { padding: 6px 2px; }
.colour-card { display: flex; flex-direction: column; gap: 5px; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; text-decoration: none; color: inherit; }
a.colour-card:hover { border-color: #C5CEDB; box-shadow: 0 1px 3px rgba(20,33,61,.06); }
.colour-card .list-title { font-size: 15px; }
.colour-card.is-deleted .list-title { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.cc-step { font-size: 13px; font-weight: 600; }
.cs-wip { color: var(--warn); } .cs-done { color: var(--good); } .cs-del { color: var(--bad); }
/* Laptop: the three columns side by side from 900 px — also on a zoomed-in or smaller laptop screen */
@media (min-width: 900px) {
  .colour-boxes { display: none; }
  .colour-board { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .colour-col { display: flex; flex-direction: column; }
}
@media (min-width: 900px) { main:has(.colour-board) { max-width: 1400px; } }

/* Fold groups: a clear Show / Hide button instead of a small arrow */
details.fold > summary { align-items: center; }
details.fold > summary h2::before { content: none; }
details.fold > summary h2 { display: flex; align-items: center; gap: 8px; }
.fold-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--navy-soft); color: var(--navy); font-size: 12px; font-weight: 700; }
.fold-btn { flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid #CDD5E1;
  background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; }
details.fold > summary:hover .fold-btn { background: var(--navy-soft); }
details.fold[open] .fold-show, details.fold:not([open]) .fold-hide { display: none; }
details.fold:not([open]) > summary { border-bottom: 0; }
details.fold:not([open]) .fold-btn { background: var(--navy); border-color: var(--navy); color: #fff; }

/* WhatsApp: looks and works like WhatsApp */
.wa-page > .page-header { background: var(--wa-dark); color: #fff; border-radius: 12px; padding: 16px 18px; align-items: center; }
.wa-page > .page-header p.muted { color: rgba(255,255,255,.82); }
.wa-page > .page-header .btn-primary { background: #fff; color: var(--wa-dark); }
.wa-page > .page-header .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.wa-page .tabs .tab { border: 0; background: #F0F2F5; color: #54656F; font-weight: 600; }
.wa-page .tabs .tab.active { background: var(--wa-soft); color: #0A3D2A; }
.wa-page .chats-counts { color: #54656F; }
.wa-page .card.flush .list-item { border-top-color: #E9EDEF; gap: 12px; }
.wa-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #DFE5E7; color: #54656F; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.wa-page .unread-dot { background: var(--wa); }
.wa-page .list-item.unread .chat-meta .muted { color: var(--wa); font-weight: 700; }
.wa-chat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--wa-dark); color: #fff; border-radius: 12px; padding: 10px 12px; }
.wa-chat-head h1 { font-size: 17px; margin: 0; }
.wa-chat-head p { color: rgba(255,255,255,.82); margin: 0; }
.wa-chat-head .wa-avatar { width: 42px; height: 42px; }
.wa-back { color: #fff; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.wa-back:hover { background: rgba(255,255,255,.12); }
.wa-chat-who { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.wa-chat-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-btn { background: var(--wa); color: #fff; border-color: var(--wa); }
.wa-btn-light { background: #fff; color: var(--wa-dark); border-color: #fff; }
.chat-screen .chat-card { border-color: #E9EDEF; }
.chat-screen .composer { background: #F0F2F5; border-top: 0; }
.chat-screen .composer .btn-primary { background: var(--wa); }
@media (min-width: 900px) { main:has(.chat-screen) { max-width: 1000px; } .chat-screen.narrow { max-width: none; } }
@media print { .colour-boxes { display: none !important; } .colour-col { display: flex !important; } }
a.tab, a.seg-btn { text-decoration: none; }
.colour-card > .row.between > .list-title { flex: 1; min-width: 0; }
.colour-card > .row.between > .strong { flex: none; white-space: nowrap; }
.colour-boxes.always { display: grid !important; }
.colour-boxes.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.colour-box { cursor: pointer; font: inherit; }
.colour-box.cb-all { color: var(--navy); border-color: #CDD5E1; }
.colour-box.cb-all.active { background: var(--navy-soft); border-color: var(--navy); }
.cc-icon.round-done { background: var(--good-solid); color: #fff; } .cc-icon.round-wip { background: var(--warn-solid); color: #3D2D00; }
.cc-icon.round-del { background: var(--bad-solid); color: #fff; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar .search { flex: 1 1 240px; }
.filter-bar select { min-height: 46px; border-radius: 10px; flex: 0 1 220px; }
@media (min-width: 1100px) { .colour-boxes.always { display: grid; max-width: 720px; } }
.filter-bar select { background: #fff; border: 1px solid var(--line); padding: 0 12px; color: var(--text); }
.seg { width: fit-content; max-width: 100%; }
/* Phone: pop-ups sit under the top bar so the bell stays tappable */
@media (max-width: 899px) { .popups { top: 64px; } }

/* Each colour column scrolls by itself, with a visible scroll bar and "More below" */
.cc-list { overflow-y: auto; min-height: 0; max-height: max(320px, calc(100dvh - 210px)); overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(20,33,61,.35) transparent; }
.cc-list::-webkit-scrollbar { width: 8px; }
.cc-list::-webkit-scrollbar-thumb { background: rgba(20,33,61,.3); border-radius: 4px; }
.cc-list::-webkit-scrollbar-track { background: transparent; }
.cc-list:focus-visible { outline-offset: -3px; }
.cc-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; border: 0; border-top: 1px solid;
  border-color: inherit; background: rgba(255,255,255,.7); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cc-more[hidden] { display: none; }
.cc-more svg { transform: rotate(90deg); }
.cc-wip .cc-more { color: var(--warn); } .cc-done .cc-more { color: var(--good); } .cc-del .cc-more { color: var(--bad); }
@media print { .cc-list { max-height: none; overflow: visible; } }
@media (max-width: 899px) { .cc-list { max-height: max(300px, calc(100dvh - 300px)); } }
@media (min-width: 900px) and (max-width: 1199px) {
  main:has(.colour-board) { padding-left: 18px; padding-right: 18px; }
  .colour-board { gap: 10px; }
  .cc-list { padding: 10px; }
  .colour-card { padding: 10px 11px; }
  .colour-card > .row.between { flex-wrap: wrap; }
}
.sq-answer input[type=number] { width: 110px; }
.sq-answer input:not([type]) { flex: 1 1 200px; min-width: 0; }
/* The software's stock answer */
.stock-answer { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; border: 1px solid; }
.stock-answer.sa-done { background: #F1FAF4; border-color: #A9DDB9; } .stock-answer.sa-wip { background: #FFFBEB; border-color: #F2D46B; }
.stock-answer.sa-del { background: #FEF3F2; border-color: #F3B3AD; }
.sa-main { display: flex; align-items: baseline; gap: 8px; font-weight: 600; }
.sa-num { font-size: 28px; font-weight: 700; line-height: 1; }
.sa-done .sa-num { color: var(--good); } .sa-wip .sa-num { color: var(--warn); } .sa-del .sa-num { color: var(--bad); }
.sa-rest { display: flex; flex-wrap: wrap; gap: 4px 14px; }
/* A customer's own MRP on nutra products (Owner 20-Nov-2026) */
.so-mrp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.dc-mrp { font-weight: 700; font-size: 1.05em; margin-top: 2px; }
.dc-mrp.own { color: var(--navy); }
.nutra-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; max-height: 320px; overflow-y: auto; }
@media print { .dc-mrp { font-size: 1.1em; } }
/* Physical stock audit (Owner 20-Nov-2026) */
.audit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audit-row .strong { min-width: 90px; }
.audit-add summary { cursor: pointer; color: var(--navy-2); }
.audit-print h1 { font-size: 16pt; margin: 0 0 4px; }
.audit-print-table td, .audit-print-table th { padding: 4px 8px; font-size: 10pt; border: 1px solid #999; white-space: normal; }
.audit-box { min-width: 90px; }
.audit-extra td { height: 22px; }
@media print { .audit-print-table { border-collapse: collapse; width: 100%; } .audit-print-table tr { break-inside: avoid; } }
td.warn { color: var(--warn); }

/* Books from Tablet (21-Nov-2026) */
.bk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.bk-card { padding: 12px 14px; }
.bk-big { font-size: 20px; font-weight: 700; margin: 2px 0; font-variant-numeric: tabular-nums; }
.bk-big.bad { color: var(--bad); } .bk-big.good { color: var(--good, #1a7f4b); }
.bk-table td.num, .bk-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bk-table td, .bk-table th { padding: 8px 12px; }
.bk-table td.wrap { white-space: normal; min-width: 220px; }
.bk-table td.strong { font-weight: 700; }
.bk-table tr.bk-sub td { background: #F3F5FA; font-weight: 700; }
.bk-table tr.bk-total td { font-weight: 800; border-top: 2px solid var(--navy); }
.bk-table tr.click-row { cursor: pointer; }
.bk-table tr.click-row:hover td, .bk-table tr.click-row:focus td { background: var(--navy-soft, #EEF2FA); }
.bk-pill { margin-left: 6px; }
.bk-period input[type=date] { height: 36px; }
.bk-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.bk-bars div { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bk-bars i { display: block; width: 100%; max-width: 24px; background: var(--navy); border-radius: 4px 4px 0 0; }
.bk-bars i.loss { background: var(--bad); }
.bk-bars span { font-size: 9px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.bk-check { border-left: 4px solid var(--warn); } .bk-check.bad { border-left-color: var(--bad); } .bk-check.good { border-left-color: #1a7f4b; }
.owner-month .bk-days { height: 90px; }
.owner-month .bk-days i { max-width: 14px; }
.owner-month-owed strong { margin-left: 4px; }
.owner-month-owed .bad { color: var(--bad); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--text); }
a.chip.active { color: #fff; }
@media (max-width: 600px) { .bk-cards { grid-template-columns: 1fr 1fr; } .bk-big { font-size: 17px; } }

/* Sales & Stock Report — company closing for any dates (21-Nov-2026), the Owner's layout */
.ssr-head { text-align: center; margin-bottom: 10px; line-height: 1.35; }
.ssr-co { font-weight: 800; letter-spacing: .03em; }
.ssr-title { font-weight: 700; }
.ssr-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ssr-table th, .ssr-table td { border: 1px solid #9AA4B8; padding: 4px 7px; white-space: nowrap; }
.ssr-table thead th { background: #1B2E5A; color: #fff; font-weight: 700; text-align: center; }
.ssr-table td.num, .ssr-table th.num { text-align: right; }
.ssr-table tr.ssr-group td { background: #DCE3F0; font-weight: 800; }
.ssr-table tfoot td { background: #DCE3F0; font-weight: 700; }
.ssr-table tfoot tr.ssr-grand td { border-top: 2px solid #1B2E5A; }
@media print {
  .ssr .table-wrap { overflow: visible; }
  .ssr-table { font-size: 9px; }
  .ssr-table th, .ssr-table td { white-space: normal; padding: 3px 4px; }
  .ssr-table td.num { white-space: nowrap; }
  .ssr-table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ssr-table tr.ssr-group td, .ssr-table tfoot td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ssr-table tr { break-inside: avoid; }
}

/* New version on the server */
.update-bar { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; background: var(--navy); color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 14px; max-width: calc(100% - 32px); }
.update-bar .btn { background: #fff; color: var(--navy); border-color: #fff; }
@media (min-width: 900px) { .update-bar { bottom: 24px; } }
@media print { .update-bar { display: none; } }

/* Expenses (23-Nov-2026): tiles by nature, steps, where the money went */
.tone-direct { --tone: #8A4B08; --tone-bg: #FDF1E3; }
.tone-admin { --tone: #24407A; --tone-bg: #E8EDF7; }
.tone-selling { --tone: #0F6E66; --tone-bg: #E2F4F1; }
.tone-finance { --tone: #475467; --tone-bg: #EEF1F5; }
.tone-ceo { --tone: #7A5B00; --tone-bg: #FEF6D8; }
.tone-charity { --tone: #A0244F; --tone-bg: #FCE8EF; }
.tone-advance { --tone: #5B3BA8; --tone-bg: #EFEAFB; }
.tone-other { --tone: #5A6478; --tone-bg: #F1F3F6; }
.exp-form { gap: 18px; }
.exp-step { display: flex; gap: 12px; align-items: flex-start; }
.exp-step-no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.exp-groups { display: flex; flex-direction: column; gap: 14px; }
.exp-group-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tone); margin-bottom: 6px; }
.exp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.exp-tile { display: flex; align-items: flex-start; gap: 10px; text-align: left; padding: 10px 12px; min-height: 58px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--text); cursor: pointer; position: relative; transition: border-color .12s, box-shadow .12s; }
.exp-tile:hover { border-color: var(--tone); }
.exp-tile.on { border-color: var(--tone); background: var(--tone-bg); box-shadow: 0 0 0 2px var(--tone) inset; }
.exp-tile.on::after { content: '✓'; position: absolute; top: 6px; right: 9px; font-weight: 700; color: var(--tone); }
.exp-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tone-bg); color: var(--tone); }
.exp-tile.on .exp-ico { background: var(--tone); color: #fff; }
.exp-tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 10px; }
.exp-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.exp-hint { font-size: 12px; color: var(--muted); line-height: 1.3; }
.exp-spent { position: absolute; bottom: 6px; right: 10px; font-size: 11px; color: var(--tone); font-weight: 600; }
.exp-tile:has(.exp-spent) { padding-bottom: 22px; }
.exp-chosen { background: var(--navy-soft); color: var(--navy); padding: 8px 10px; border-radius: 8px; }
.exp-amount { display: flex; align-items: center; border: 1px solid #CDD3DD; border-radius: 8px; background: #fff; padding-left: 12px; }
.exp-amount > span { font-weight: 700; color: var(--muted); }
.field .exp-amount input.exp-amount-in { border: 0; min-height: 52px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; background: transparent; }
.exp-amount:focus-within { outline: 3px solid #5B8DEF; outline-offset: 1px; }
.field .exp-amount input.exp-amount-in:focus-visible { outline: none; }
.exp-srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.exp-src { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff;
  color: var(--text); text-align: left; cursor: pointer; }
.exp-src.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; background: var(--navy-soft); }
.exp-src-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.exp-src-bal { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-src-bal.bad { color: var(--bad); }
.exp-break { display: flex; flex-direction: column; gap: 12px; }
.exp-break-row { display: flex; flex-direction: column; gap: 5px; }
.exp-break-row .strong.row { color: var(--tone); }
.exp-bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.exp-bar i { display: block; height: 100%; background: var(--tone); border-radius: 99px; }
.exp-type-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.exp-type-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-top: 1px solid var(--line-2); background: #fff; }
.exp-type-row:first-child { border-top: 0; }
.exp-type-row.editing { display: flex; flex-direction: column; align-items: stretch; background: var(--bg); }
.exp-nature { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--tone-bg); color: var(--tone); }
.sheet-key { display: inline-block; padding: 8px 10px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--line); font-size: 13px; word-break: break-all; }
.sheet-steps { padding-left: 20px; margin: 0; }
@media (max-width: 560px) {
  .exp-tiles { grid-template-columns: 1fr 1fr; }
  .exp-hint { display: none; }
  .exp-step { gap: 8px; }
  .exp-step-no { display: none; }
}
.exp-src-bank select { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 40px; font-weight: 600; }
.exp-src-bank select:focus-visible { outline: none; }
.exp-src-bank:focus-within { outline: 3px solid #5B8DEF; outline-offset: 1px; }
@media (max-width: 560px) {
  .exp-tile { flex-direction: column; gap: 6px; padding: 10px; }
  .exp-ico { width: 30px; height: 30px; }
  .exp-tile-text { padding-right: 0; }
  .exp-name { font-size: 13px; }
  .exp-spent { position: static; }
  .exp-tile:has(.exp-spent) { padding-bottom: 10px; }
  .exp-srcs { grid-template-columns: 1fr; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.exp-src, .exp-tile { white-space: normal; min-width: 0; }
.exp-step > .grow { min-width: 0; }
@media (max-width: 560px) { .exp-srcs { grid-template-columns: minmax(0, 1fr); } .exp-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* Petty cash section (23-Nov-2026) */
.list-pick { width: 100%; text-align: left; background: #fff; border: 0; border-top: 1px solid var(--line-2); padding: 10px 12px; cursor: pointer; color: var(--text); font: inherit; }
.list-pick:hover { background: var(--navy-soft); }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.pc-bal { display: flex; flex-direction: column; gap: 2px; }
.pc-bal-num { font-size: 34px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pc-bal-num.bad { color: var(--bad); }
.pc-wait { color: #8A5A00; background: #FFF4D6; padding: 3px 8px; border-radius: 6px; align-self: flex-start; }
.pc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pc-btn { display: flex; align-items: center; gap: 10px; min-width: 150px; min-height: 60px; padding: 10px 18px; border-radius: 14px; border: 2px solid; cursor: pointer; font: inherit; text-align: left; }
.pc-btn span { display: flex; flex-direction: column; }
.pc-btn b { font-size: 16px; }
.pc-btn small { font-size: 12px; opacity: .8; }
.pc-out { border-color: #C2410C; color: #C2410C; background: #FFF4EE; }
.pc-in { border-color: #0F7A4A; color: #0F7A4A; background: #EAF7F0; }
.pc-out.on { background: #C2410C; color: #fff; }
.pc-in.on { background: #0F7A4A; color: #fff; }
.pc-wrap { overflow-x: auto; }
.pc-table { width: 100%; }
.pc-table td, .pc-table th { vertical-align: top; }
.pc-table .pc-open td { background: var(--bg); }
.pc-table tr.pc-pending td { background: #FFF9E6; }
.pc-table tr.is-deleted td { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.pc-table tr.is-deleted td:last-child { text-decoration: none; }
.pc-table td { white-space: normal; }
.pc-table td.num { white-space: nowrap; }
.pc-sub { display: block; }
.pc-rem { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 120px; }
.pc-table .pc-in-amt { color: #0F7A4A; font-weight: 600; }
.pc-table tfoot td { border-top: 2px solid var(--line); }
@media (max-width: 720px) {
  .pc-actions { width: 100%; }
  .pc-btn { flex: 1; min-width: 0; }
  .pc-table thead { display: none; }
  .pc-table, .pc-table tbody, .pc-table tfoot { display: block; }
  .pc-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 12px; border-top: 1px solid var(--line-2); }
  .pc-table td { border: 0; padding: 0; }
  .pc-table td:empty { display: none; }
  .pc-table td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
  .pc-table td[data-l=""]::before, .pc-table td[data-l="Nature"]::before { display: none; }
  .pc-table td[data-l="Remarks"] { grid-column: 1 / -1; }
  .pc-table td[data-l="Nature"] { grid-column: 1 / -1; order: -1; font-weight: 600; }
  .pc-table td.num { text-align: left; }
}
@media print {
  .pc-table tr.pc-pending td { background: none; }
}

/* Returns (24-Nov-2026) */
.sr-qty input { width: 84px; text-align: right; }
.sign-row { display: flex; justify-content: space-between; gap: 24px; margin-top: 40px; }

/* Bin icon instead of the word Delete (24-Nov-2026) */
.bin-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 6px 10px;
  color: var(--bad); background: #fff; border: 1px solid #F3C4C4; border-radius: 10px; cursor: pointer; text-decoration: none; }
.bin-btn:hover { background: #FDECEC; border-color: var(--bad); }
.bin-btn:focus-visible { outline: 3px solid #5B8DEF; outline-offset: 1px; }
.btn-link.bin-btn, .btn-sm.bin-btn { min-width: 34px; min-height: 34px; padding: 4px 8px; }
.bin-tag { display: inline-flex; align-items: center; gap: 4px; }
@media print { .bin-btn { display: none !important; } }

/* Areas (one product, one customer per area) */
.stat-warn .stat-num { color: var(--warn); }
.list-item.area-sub { padding-left: 28px; }
.area-claimant { align-items: flex-start; }
.area-claimant input { margin-top: 3px; flex: none; }
.area-choose .list-main { min-width: 0; }
.area-choose input[name=area_note] { flex: 1 1 220px; min-width: 0; }
.area-table td { vertical-align: top; }
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }

/* Approvals: approve everything at once (25-Nov-2026) */
.approve-all { align-items: center; justify-content: space-between; }
