@font-face { font-family: 'Kantumruy Pro'; font-weight: 400; font-display: swap; src: url(/fonts/kantumruy-pro-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 500; font-display: swap; src: url(/fonts/kantumruy-pro-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 600; font-display: swap; src: url(/fonts/kantumruy-pro-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 700; font-display: swap; src: url(/fonts/kantumruy-pro-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 400; font-display: swap; src: url(/fonts/kantumruy-pro-khmer-400-normal.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 500; font-display: swap; src: url(/fonts/kantumruy-pro-khmer-500-normal.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 600; font-display: swap; src: url(/fonts/kantumruy-pro-khmer-600-normal.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Kantumruy Pro'; font-weight: 700; font-display: swap; src: url(/fonts/kantumruy-pro-khmer-700-normal.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; }

:root {
  --blue: #0741AD; --blue-deep: #05307F; --blue-soft: #E7EEFB; --navy: #0A1733; --navy-2: #13254C;
  --bg: #F2F4F8; --surface: #FFFFFF; --line: #DDE3EC; --line-strong: #C5CEDC;
  --text: #15203A; --muted: #5A6581; --faint: #8A93A8;
  --red: #C23A2E; --red-soft: #FBEAE8; --amber: #9A5B00; --amber-soft: #FDF1DC; --green: #1D7A4C; --green-soft: #E4F4EB;
  --r-sm: 6px; --r: 10px; --shadow: 0 1px 2px rgba(10, 23, 51, .06), 0 4px 16px rgba(10, 23, 51, .06);
  --font: 'Kantumruy Pro', 'Noto Sans Khmer', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
:lang(km) body, body.km { line-height: 1.7; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #C9D3E8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; color: #fff; font-weight: 600; letter-spacing: .02em; }
.side-brand img { width: 30px; height: 30px; border-radius: 50%; }
.modswitch { margin: 4px 12px 10px; display: grid; gap: 2px; }
.modswitch a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: #C9D3E8; font-weight: 500; }
.modswitch a:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.modswitch a.on { background: var(--blue); color: #fff; }
.subnav { border-top: 1px solid rgba(255,255,255,.08); padding: 10px 12px; display: grid; gap: 1px; }
.subnav .label { font-size: 12px; color: #7F8BA8; padding: 6px 10px 4px; }
.subnav a { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: var(--r-sm); color: #AEB9D2; }
.subnav a:hover { color: #fff; background: var(--navy-2); text-decoration: none; }
.subnav a.on { color: #fff; background: rgba(255,255,255,.09); box-shadow: inset 3px 0 0 #6E9BF0; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); color: #fff; }
.side-user:hover { background: var(--navy-2); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #2B4A8C; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.lang { display: inline-flex; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.lang button { background: none; border: 0; padding: 3px 10px; color: #AEB9D2; cursor: pointer; font-size: 12.5px; }
.lang button.on { background: #fff; color: var(--navy); }
.lang.light { border-color: var(--line); }
.lang.light button { color: var(--muted); }
.lang.light button.on { background: var(--blue); color: #fff; }
.pill { min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; background: #2B4A8C; color: #fff; }
.pill.red { background: var(--red); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 22px 28px 60px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); color: #fff; }
.btn.danger { color: var(--red); border-color: #E6B7B2; }
.btn.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; color: var(--muted); }
.iconbtn:hover { background: var(--blue-soft); color: var(--blue); }
.iconbtn svg { width: 18px; height: 18px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel > .ph { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h2, .panel > .ph h3 { display: flex; align-items: center; gap: 8px; }
.panel > .pb { padding: 14px 16px; }
.panel + .panel { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.kpi { background: var(--surface); padding: 12px 16px; }
.kpi .v { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.alert .v { color: var(--red); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFD; }
.t td { padding: 9px 12px; border-bottom: 1px solid #EDF0F5; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #F6F8FC; }
.t tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.t input, .t select { height: 32px; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; background: #EEF1F6; color: var(--muted); white-space: nowrap; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.dark { background: var(--navy); color: #fff; }

.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--faint); }
.input, .field input, .field select, .field textarea, select.input {
  height: 38px; width: 100%; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; min-width: 0; }
.field textarea, textarea.input { height: auto; min-height: 74px; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7, 65, 173, .14); }
.field input[type=checkbox] { width: 18px; height: 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; }
.form { display: grid; gap: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--blue); color: #fff; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: #F7F9FC; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.quick button:hover { border-color: var(--blue); color: var(--blue); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 150px; height: 36px; }
.toolbar .search { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }

.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 500; margin-bottom: 4px; }
.loading { padding: 40px; text-align: center; color: var(--faint); }
.error-box { background: var(--red-soft); color: var(--red); border-radius: var(--r-sm); padding: 10px 12px; }
.note-box { background: var(--amber-soft); color: #6B4200; border-radius: var(--r-sm); padding: 10px 12px; }
.info-box { background: var(--blue-soft); color: var(--blue-deep); border-radius: var(--r-sm); padding: 10px 12px; }

.list { display: grid; }
.li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid #EDF0F5; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .title { font-weight: 500; }
.li.click { cursor: pointer; }
.li.click:hover { background: #F6F8FC; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; margin-top: 7px; }
.dot.red { background: var(--red); } .dot.amber { background: #E59A1B; } .dot.blue { background: var(--blue); } .dot.green { background: var(--green); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bar { height: 8px; background: #E8ECF3; border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.bar.good > i { background: var(--green); }
.timeline { display: grid; }
.tl { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 8px 0; }
.tl .dot { margin-top: 6px; }
.tl + .tl { border-top: 1px dashed #E3E8F0; }

/* modal & drawer */
.overlay { position: fixed; inset: 0; background: rgba(10, 23, 51, .42); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: var(--r); width: 100%; max-width: 560px; box-shadow: 0 20px 60px rgba(10,23,51,.3); }
.modal.wide { max-width: 860px; }
.modal .mh { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .mb { padding: 16px 18px; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(10,23,51,.32); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: var(--bg); z-index: 41; overflow-y: auto; box-shadow: -10px 0 40px rgba(10,23,51,.18); animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer .dh { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.drawer .db { padding: 16px 18px; display: grid; gap: 16px; }

.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow); max-width: 90vw; }
.toast.error { background: var(--red); }

/* pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #E9EDF4; border-radius: var(--r); padding: 8px; min-height: 200px; }
.col h3 { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 6px 8px; color: var(--muted); }
.card { background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid transparent; box-shadow: 0 1px 2px rgba(10,23,51,.08); cursor: pointer; }
.card:hover { border-color: var(--blue); }
.card .name { font-weight: 500; }
.card .meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card.overdue { box-shadow: inset 3px 0 0 var(--red), 0 1px 2px rgba(10,23,51,.08); }
.stages { display: flex; gap: 3px; flex-wrap: wrap; }
.stages button { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.stages button.done { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.stages button.cur { background: var(--blue); color: #fff; border-color: var(--blue); }
.stages button.lost.cur { background: var(--red); border-color: var(--red); }

/* product picker */
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; margin-top: 2px; }
.picker-list button { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; }
.picker-list button:hover, .picker-list button.active { background: var(--blue-soft); }
.upsell { border: 1px dashed #9DB6E8; background: #F5F8FE; border-radius: var(--r); padding: 12px 14px; }
.upsell h3 { font-size: 14px; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 8px 6px 10px; font-size: 13px; }

/* launcher + login (the one bold moment) */
.hero { background: var(--blue); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -80px; top: -60px; width: 420px; height: 420px; background: url(/logo-white.png) no-repeat center / contain; opacity: .07; pointer-events: none; }
.hero-in { max-width: 1360px; padding: 26px 28px 70px; }
.hero h1 { font-size: 28px; font-weight: 600; }
.hero .sub { color: #C6D6F5; margin-top: 4px; }
.launch { max-width: 1360px; padding: 0 28px 60px; margin-top: -48px; position: relative; display: grid; gap: 16px; }
.hero .sub .dot { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; vertical-align: middle; margin: 0 10px; }
/* home: one tile per module. Lines are links; red = needs someone, plain = coming up, chevron = shortcut */
.mtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.mtile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.mt-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; color: var(--text); border-bottom: 1px solid var(--line); }
.mt-head:hover { text-decoration: none; background: #FAFBFD; }
.mt-head .ic { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.mt-head .ic svg { width: 20px; height: 20px; }
.mt-name { flex: 1; min-width: 0; display: grid; }
.mt-name b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.mt-name span { font-size: 12.5px; color: var(--muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-head > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.mt-head:hover > svg { color: var(--blue); }
.mt-lines { display: flex; flex-direction: column; padding: 6px 0; flex: 1; }
.mt-line { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 7px 16px; color: var(--text); font-size: 13.5px; line-height: 1.4; }
.mt-line + .mt-line { border-top: 1px solid #EEF1F6; }
a.mt-line:hover { background: #F6F8FB; text-decoration: none; }
.mt-line .lbl { flex: 1; min-width: 0; }
.mt-line .lbl::first-letter { text-transform: uppercase; }
.mt-line .cnt { flex: none; min-width: 30px; padding: 1px 8px; border-radius: 999px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--bg); color: var(--text); }
.mt-line.red .cnt { background: var(--red-soft); color: var(--red); }
.mt-line.red .lbl { font-weight: 500; }
.mt-line > svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.mt-line.link { color: var(--blue); }
.mt-line.link:hover > svg { color: var(--blue); }
.mt-line.clear { color: var(--green); font-weight: 500; }
.mt-line.clear > svg { color: var(--green); }
.checkin { background: #fff; border-radius: var(--r); padding: 18px 20px; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.checkin .clock { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.checkin.compact { padding: 14px 18px; gap: 6px 18px; }
.checkin.compact .clock { font-size: 26px; }
.checkin.compact .muted { font-size: 13px; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: var(--blue); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; position: relative; overflow: hidden; }
.login-brand img { width: min(300px, 60%); }
.login-brand .claim { font-size: 30px; font-weight: 600; line-height: 1.25; max-width: 440px; }
.login-brand .mods { color: #C6D6F5; margin-top: 10px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: #fff; }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login-form h1 { font-size: 24px; }

/* documents / print */
.doc { background: #fff; max-width: 820px; margin: 20px auto; padding: 36px 40px; border: 1px solid var(--line); border-radius: var(--r); }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 2px solid var(--blue); padding-bottom: 14px; margin-bottom: 18px; }
.doc-head img { height: 64px; }
.doc h1 { font-size: 22px; color: var(--blue); }
.doc .t th { background: #F2F5FB; }
.doc-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; }
.doc-foot div { border-top: 1px solid var(--text); padding-top: 6px; text-align: center; color: var(--muted); font-size: 12.5px; }
.print-bar { display: flex; justify-content: center; gap: 8px; padding: 12px; position: sticky; top: 0; background: var(--bg); z-index: 3; }
.page-break { break-after: page; }
@media print {
  body { background: #fff; }
  .print-bar, .no-print { display: none !important; }
  .doc { border: 0; margin: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 14mm; }
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 60; transform: translateX(-100%); transition: transform .18s; }
  .app.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10,23,51,.45); }
  .topbar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 10px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar .iconbtn { color: #fff; }
  .topbar .t { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page { padding: 16px 14px 60px; }
  .g2, .g3, .g4, .g-main { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 26px 22px; min-height: 0; gap: 18px; }
  .login-brand img { width: 150px; }
  .login-brand .claim { font-size: 22px; }
  .hero-in { padding: 20px 16px 64px; }
  .hero h1 { font-size: 24px; }
  .hero .sub .dot { display: none; }
  .hero .sub .sum { display: block; }
  .launch { padding: 0 14px 40px; }
  .mtiles { gap: 12px; }
  .checkin.compact { display: grid; grid-template-columns: 1fr auto; }
  .checkin.compact > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: 13.5px; color: var(--muted); }
  .checkin.compact .actions { grid-column: 2; grid-row: 1; }
  .mt-line { min-height: 46px; font-size: 14px; }
  .approve-banner .go svg { width: 20px; height: 20px; }
  .kv { grid-template-columns: 110px 1fr; }
  .doc { padding: 20px 16px; margin: 0; border-radius: 0; }
  .hide-sm { display: none !important; }
  .modal { max-width: none; }
  .overlay { padding: 0; align-items: stretch; }
  .overlay .modal { border-radius: 0; min-height: 100%; }
}
@media (min-width: 901px) { .show-sm { display: none !important; } }

/* expenses: approval steps and receipt thumbnails */
.steps { display: flex; gap: 6px; margin: 2px 0 14px; flex-wrap: wrap; }
.steps.off { opacity: .55; }
.step { flex: 1; min-width: 104px; padding: 8px 2px 0; border-top: 3px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.35; }
.step b { display: block; font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.step.done { border-color: var(--green); color: var(--text); }
.step.done b { color: var(--green); }
.step.cur { border-color: var(--blue); color: var(--text); }
.step.cur b { color: var(--blue); font-weight: 600; }
.step.bad { border-color: var(--red); }
.step.bad b { color: var(--red); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; gap: 4px;
  align-items: center; justify-content: center; overflow: hidden; padding: 0; cursor: pointer; color: var(--muted); font: inherit; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.add { border-style: dashed; }
.thumb.add:hover { border-color: var(--blue); color: var(--blue); }
.thumb-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(10, 23, 51, .7); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* quotes and invoices, carried over from the earlier CRM design */
.modal.xl { max-width: 1020px; }
.internal-mark { display: inline-block; margin-top: 6px; padding: 2px 8px; border: 1.5px solid var(--red); color: var(--red); border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.builder { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; }
.catalog { border: 1px solid var(--line); border-radius: 8px; max-height: 190px; overflow: auto; margin-top: 6px; }
.catalog button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--bg); background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.catalog button:hover { background: var(--blue-soft); }
.catalog .plus { color: var(--blue); font-size: 18px; line-height: 1; }
.lines-empty { padding: 18px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.qty { display: flex; align-items: center; gap: 3px; }
.qty button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 15px; color: var(--text); }
.qty span { width: 24px; text-align: center; }
.addons { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 14px; overflow: hidden; }
.addons .head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.addons .item { padding: 10px 14px; border-bottom: 1px solid var(--bg); }
.addons .item:last-child { border-bottom: 0; }
.slip { background: #FFF6E3; border: 1px solid #EBD9B0; border-radius: 10px; overflow: hidden; }
.slip-perf { height: 8px; background: repeating-linear-gradient(90deg, #EBD9B0 0 5px, transparent 5px 10px); }
.slip-body { padding: 14px 16px; }
.slip-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.slip-row .lbl { color: #5A4A2A; }
.slip-rule { border-top: 1px dashed #D9C08A; margin: 8px 0; }
.slip-total { display: flex; justify-content: space-between; align-items: baseline; }
.slip-total .v { font-size: 22px; font-weight: 700; color: #8A5A00; }
.gold { color: #8A5A00; }
.progress { height: 8px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; background: var(--blue); border-radius: 5px; transition: width .5s; }
.win-head { background: var(--blue); color: #fff; padding: 26px 24px 22px; text-align: center; position: relative; }
.win-head img { width: 44px; height: 44px; }
.win-head .big { font-size: 21px; font-weight: 700; margin-top: 10px; }
.paper-wrap { background: var(--bg); border-radius: var(--r); padding: 14px; max-height: 62vh; overflow: auto; }
.paper-wrap .doc { margin: 0 auto; box-shadow: var(--shadow); }
.msg-preview { margin: 0; padding: 14px; background: var(--bg); border-radius: 8px; font-size: 12.5px; white-space: pre-wrap; line-height: 1.6; max-height: 280px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; }
.store-card { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--r); padding: 14px; background: #fff; }
.store-card.open { border-left-color: var(--green); }
.store-card.closed { border-left-color: var(--faint); }
.report-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .builder { grid-template-columns: 1fr; } }
.over input { border-color: var(--red); background: var(--red-soft); }
.report-tools .input, .report-tools select { width: auto; min-width: 150px; }

/* ---------- getting around: search, + New, approvals, phone tab bar ---------- */
.side-actions { display: flex; gap: 6px; padding: 0 12px 10px; }
.side-search { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: #AEB9D2; cursor: pointer; font: inherit; font-size: 13px; }
.side-search:hover { background: rgba(255,255,255,.1); color: #fff; }
.side-search span { flex: 1; text-align: left; }
.side-search kbd { font: inherit; font-size: 10.5px; opacity: .7; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 0 4px; }
.side-new { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 8px; border: 0; background: var(--blue); color: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.side-new:hover { background: #1657C8; }
.search-ov { align-items: flex-start; padding-top: 10vh; }
.search-box { background: #fff; width: min(620px, calc(100% - 24px)); border-radius: 12px; box-shadow: 0 24px 70px rgba(10,23,51,.35); overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-in input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 17px; color: var(--text); min-width: 0; background: transparent; }
.search-res { max-height: 60vh; overflow: auto; padding-bottom: 8px; }
.search-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.search-row:disabled { cursor: default; }
.search-row:not(:disabled):hover, .search-row.sel { background: var(--blue-soft); }
.search-row .st { display: block; font-weight: 500; }
.search-row .small { display: block; }
.sheet-ov { align-items: center; justify-content: center; }
.sheet { background: #fff; width: min(440px, calc(100% - 24px)); border-radius: 14px; box-shadow: 0 24px 70px rgba(10,23,51,.35); overflow: hidden; }
.sheet-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-list { padding: 6px; max-height: 70vh; overflow: auto; }
.sheet-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.sheet-list button:hover { background: var(--blue-soft); }
.sheet-list .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.sheet-list b { display: block; font-weight: 500; }
.sheet-list .small { display: block; }
.approve-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.approve-banner .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; flex: none; }
.approve-banner b { display: block; }
.approve-banner .small { display: block; color: var(--muted); }
.approve-banner .go { display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: 600; color: var(--blue); }
.approve-banner .go svg { width: 16px; height: 16px; }
.approve-banner:hover { border-color: var(--line-strong); }
.approve-banner .grow { flex: 1; min-width: 0; }
.appr .appr-amt { font-weight: 600; margin: 0 8px; white-space: nowrap; }
.tabbar { display: none; }
.filters { display: contents; }
@media (max-width: 900px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 16px rgba(10,23,51,.06); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; color: var(--muted); font-size: 10.5px; text-decoration: none; min-width: 0; }
  .tabbar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.on { color: var(--blue); font-weight: 600; }
  .tb-ic { position: relative; display: flex; }
  .tb-badge { position: absolute; top: -5px; right: -10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 600; }
  .tb-new { justify-self: center; align-self: center; width: 50px; height: 50px; margin-top: -18px; border-radius: 50%; border: 4px solid #fff; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(7,65,173,.35); cursor: pointer; }
  .main { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .sheet-ov { align-items: flex-end; }
  .sheet { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .search-ov { padding-top: 0; }
  .search-box { width: 100%; border-radius: 0 0 12px 12px; }
  .side-actions { display: none; }
  /* number boxes become one swipeable strip so the work list is on the first screen */
  .kpis { display: flex !important; overflow-x: auto; gap: 8px; scroll-snap-type: x mandatory; padding: 0 0 4px; margin-bottom: 12px; background: transparent; border: 0; border-radius: 0; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpis > .kpi { flex: 0 0 auto; min-width: 132px; max-width: 70vw; scroll-snap-align: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
  .kpis > .kpi .v { font-size: 17px; }
  .kpis > .kpi .l { font-size: 11.5px; }
  .filters { display: none; }
  .filters.open { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .filters.open > * { flex: 1 1 140px; }
}
@media print { .tabbar, .side-actions { display: none !important; } }
a.approve-banner, a.approve-banner * { text-decoration: none !important; }

/* ---------- sales flow: tap-first lead and sale screens ---------- */
.q-label { font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.chipset button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chipset button:hover { border-color: var(--blue); }
.chipset button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chipset.big button { padding: 9px 14px; font-size: 14px; }
.more-toggle, .linkbtn { background: none; border: 0; padding: 4px 0; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.lead-progress { display: flex; margin: 2px 0 14px; }
.lead-progress .lp { flex: 1; text-align: center; font-size: 10.5px; color: var(--faint); position: relative; padding-top: 16px; }
.lead-progress .lp span { position: absolute; top: 4px; left: 0; right: 0; height: 4px; background: var(--line); }
.lead-progress .lp:first-child span { border-radius: 4px 0 0 4px; } .lead-progress .lp:last-child span { border-radius: 0 4px 4px 0; }
.lead-progress .lp.done { color: var(--muted); } .lead-progress .lp.done span { background: var(--green); }
.lead-progress .lp.cur { color: var(--blue); font-weight: 600; } .lead-progress .lp.cur span { background: var(--blue); }
.lead-next { display: flex; gap: 12px; padding: 12px 14px; background: var(--blue-soft); border-radius: var(--r); margin-bottom: 12px; }
.sell-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sell-btn { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px solid var(--blue); border-radius: 12px; background: #fff; color: var(--blue); cursor: pointer; font: inherit; text-align: left; }
.sell-btn b { display: block; font-size: 15px; } .sell-btn span span { display: block; font-size: 12px; opacity: .8; }
.sell-btn.primary { background: var(--blue); color: #fff; }
.sell-btn:hover { box-shadow: 0 4px 14px rgba(7,65,173,.2); }
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.outcomes button { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--text); text-align: left; }
.outcomes button:hover { border-color: var(--blue); }
.outcomes button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; box-shadow: inset 0 0 0 1px var(--blue); }
.outcomes button.bad { color: var(--red); }
.outcomes button.bad.on { border-color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.outcome-form { margin-top: 12px; padding: 12px; background: var(--bg); border-radius: 10px; display: grid; gap: 10px; }
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary .small { visibility: hidden; }
/* 3-step sale window */
.wz-steps { display: flex; gap: 6px; margin: -4px 0 16px; }
.wz-steps button { flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.wz-steps .n { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.wz-steps button.on { border-color: var(--blue); color: var(--blue); font-weight: 600; } .wz-steps button.on .n { background: var(--blue); color: #fff; }
.wz-steps button.done { color: var(--green); } .wz-steps button.done .n { background: var(--green-soft); color: var(--green); }
.wz { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wz-main { display: grid; gap: 16px; min-width: 0; }
.wz-side { position: sticky; top: 0; }
.wz-summary { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: #fff; }
.wz-block { display: grid; gap: 8px; }
.pick-row { display: grid; grid-template-columns: 1fr 1fr 2fr auto auto; gap: 8px; align-items: center; }
.line-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.line-card b { font-weight: 500; }
.big-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-choice button { display: grid; gap: 2px; justify-items: start; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.big-choice button span { font-size: 12px; color: var(--muted); }
.big-choice button.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.big-choice button.on svg, .big-choice button.on b { color: var(--blue); }
.pay-choice { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pay-choice button { display: grid; gap: 2px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.pay-choice button .num { color: var(--muted); }
.pay-choice button.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); } .pay-choice button.on b { color: var(--blue); }
.review { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.review > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--bg); }
.review > div:last-child { border-bottom: 0; }
.review span { color: var(--muted); } .review b { font-weight: 500; text-align: right; }
.modal.xl .mf { position: sticky; bottom: 0; background: #fff; z-index: 2; }
@media (max-width: 900px) {
  .wz { grid-template-columns: 1fr; }
  .wz-side { position: static; }
  .pick-row { grid-template-columns: 1fr 1fr; }
  .pick-row > :nth-child(3) { grid-column: 1 / -1; }
  .pay-choice { grid-template-columns: 1fr 1fr; }
  .wz-steps button { font-size: 12px; padding: 8px 6px; gap: 5px; }
  .sell-btn span span { display: none; }
}

/* ---------- operations: delivery steps, board cards, reviews, stock count ---------- */
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.pipe-step { position: relative; display: grid; gap: 2px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--r); color: var(--text); text-decoration: none; }
.pipe-step b { font-size: 24px; font-weight: 600; } .pipe-step span { font-size: 12.5px; color: var(--muted); }
.pipe-step.red { border-top-color: var(--red); } .pipe-step.amber { border-top-color: #D08A1E; } .pipe-step.green { border-top-color: var(--green); }
.pipe-step.zero b { color: var(--faint); }
.pipe-step i { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-style: normal; font-size: 18px; z-index: 1; }
.dtrack { display: flex; margin: 4px 0 14px; }
.dt { flex: 1; display: grid; justify-items: center; text-align: center; gap: 2px; position: relative; font-size: 12px; color: var(--muted); }
.dt::before { content: ''; position: absolute; top: 13px; left: -50%; right: 50%; height: 3px; background: var(--line); z-index: 0; }
.dt:first-child::before { display: none; }
.dt .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.dt.done .dot { background: var(--green); border-color: var(--green); color: #fff; } .dt.done::before { background: var(--green); }
.dt.cur .dot { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); } .dt.cur b { color: var(--blue); }
.dt b { font-weight: 500; color: var(--text); font-size: 12.5px; }
.next-step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; margin-bottom: 10px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; cursor: pointer; font: inherit; text-align: left; box-shadow: 0 6px 18px rgba(7,65,173,.25); }
.next-step .ic { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: none; }
.next-step b { display: block; font-size: 16px; } .next-step .grow span { display: block; font-size: 12.5px; opacity: .85; } .next-step .go { font-size: 24px; }
.next-step.review { background: #8A5A00; box-shadow: 0 6px 18px rgba(138,90,0,.25); }
.thumb.big { width: 96px; height: 96px; }
.thumb.camera { border: 2px dashed var(--blue); color: var(--blue); background: var(--blue-soft); }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.dcard:hover { border-color: var(--blue); } .dcard.late { border-left: 4px solid var(--red); }
.dcard .dh { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.dmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.stars-text { color: #F5A524; letter-spacing: 1px; white-space: nowrap; }
.stars-text.red { color: var(--red); }
.review-form { display: grid; gap: 6px; margin-top: 12px; }
.review-form .rq { font-weight: 600; margin-top: 8px; }
.review-form .stars { display: flex; gap: 6px; }
.review-form .stars button { flex: 1; font-size: 28px; line-height: 1; padding: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #C5CEDC; cursor: pointer; }
.review-form .stars button.on { color: #F5A524; border-color: #F5A524; background: #FFF8E6; }
.collect { padding: 12px; background: var(--amber-soft); border-radius: 10px; display: grid; gap: 8px; }
.count-top { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; position: sticky; top: 0; z-index: 5; }
.count-row { gap: 10px; }
.qty.big button { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
.qty.big input { width: 64px; height: 40px; text-align: center; font-size: 18px; font-weight: 600; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; }
.qty.big input:not(:placeholder-shown) { border-color: var(--green); background: var(--green-soft); }
.check-line { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--bg); cursor: pointer; }
.check-line input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
@media (max-width: 900px) {
  .pipe { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; }
  .count-top { top: 52px; }
  .dt b { font-size: 11px; } .dt .small { display: none; }
}
@media (max-width: 900px) {
  .wz-steps.five button { flex: 0 0 auto; } .wz-steps.five button.on { flex: 1 1 auto; }
  .wz-steps.five button:not(.on) .lbl { display: none; }
  .page { overflow-x: hidden; }
}


/* ---------- expenses ---------- */
.exp-steps { display: flex; gap: 4px; margin: -2px 0 18px; }
.exp-steps span { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.exp-steps i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: none; }
.exp-steps span.on { color: var(--text); font-weight: 600; border-color: var(--blue); } .exp-steps span.on i { border-color: var(--blue); background: var(--blue); color: #fff; }
.exp-steps span.done { border-color: var(--blue); } .exp-steps span.done i { border-color: var(--blue); color: var(--blue); }
.cat-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cat-ic.lg { width: 40px; height: 40px; color: var(--blue); background: var(--blue-soft); }
.opt-list { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.opt-list button { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.opt-list button:last-child { border-bottom: 0; }
.opt-list button:hover { background: var(--bg); }
.opt-list button.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.opt-list b { display: block; font-weight: 600; } .opt-list .grow span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.opt-list > button > svg:last-child { color: var(--faint); }
.flabel { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cat-grid button { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); text-align: left; line-height: 1.25; }
.cat-grid button svg { color: var(--muted); flex: none; }
.cat-grid button:hover { border-color: #B8C4D8; }
.cat-grid button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 500; } .cat-grid button.on svg { color: var(--blue); }
.cat-grid button.more { color: var(--muted); border-style: dashed; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.suggest button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.suggest button:hover { border-color: var(--blue); color: var(--blue); } .suggest button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.amt { display: grid; gap: 6px; }
.amt-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.amt-in { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--muted); font-size: 18px; font-weight: 600; }
.amt-in:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.amt-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 22px; font-weight: 600; color: var(--text); padding: 8px 0; text-align: right; }
.amt-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick-amts { display: flex; gap: 4px; flex-wrap: wrap; }
.quick-amts button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; font-variant-numeric: tabular-nums; }
.quick-amts button:hover { color: var(--text); border-color: #B8C4D8; } .quick-amts button.on { border-color: var(--blue); color: var(--blue); }
.date-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .date-row .input { width: auto; }
.rcpt { display: grid; gap: 8px; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1.5px dashed #B8C4D8; border-radius: 10px; background: var(--bg); color: var(--muted); cursor: pointer; }
.dropzone:hover { border-color: var(--blue); color: var(--blue); }
.dropzone b { display: block; color: var(--text); font-weight: 600; } .dropzone .small { display: block; }
.dropzone.compact { padding: 9px 12px; } .dropzone.compact b { font-weight: 500; font-size: 13px; }
.no-rcpt { margin-top: 8px; }
.review-t td:first-child { color: var(--muted); width: 36%; } .review-t td { vertical-align: top; }
.review-t svg { vertical-align: -3px; color: var(--muted); }
.route { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.route span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; } .route svg { color: var(--faint); }
.exp-status-box { display: flex; gap: 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; background: #fff; margin-bottom: 12px; font-size: 13.5px; }
.exp-status-box .amt-big { font-size: 20px; font-weight: 700; white-space: nowrap; }
.exp-status-box.manager, .exp-status-box.owner { border-left-color: #D08A1E; } .exp-status-box.paid { border-left-color: var(--green); }
.exp-status-box.rejected { border-left-color: var(--red); } .exp-status-box.cancelled { border-left-color: var(--faint); }
.btn.block { width: 100%; justify-content: center; margin-bottom: 12px; }
.exp-section { margin-bottom: 16px; }
.exp-section .ph h2.red { color: var(--red); }
.exp-rows > .exp-row { border-bottom: 1px solid var(--line); } .exp-rows > .exp-row:last-child { border-bottom: 0; }
.exp-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; background: #fff; cursor: pointer; }
.exp-row:hover { background: #FAFBFD; }
.exp-row .pick { width: 17px; height: 17px; margin-top: 8px; flex: none; }
.exp-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.exp-top .ttl { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .exp-top .amt { font-weight: 600; white-space: nowrap; }
.exp-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 1px; }
.exp-status { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 8px; }
.exp-row .thumb { width: 52px; height: 52px; }
.thumb.none { cursor: default; border-style: dashed; color: var(--faint); background: var(--bg); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg); flex-wrap: wrap; position: sticky; top: 0; z-index: 3; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.icon-pick button.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
@media (max-width: 900px) {
  .exp-steps em { display: none; } .exp-steps span.on em { display: inline; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .exp-row { padding: 12px; } .exp-row .thumb { width: 44px; height: 44px; }
  .bulk-bar { top: 52px; }
  .exp-status-box { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- finance ---------- */
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .period .input, .period select { width: auto; }
.acct-strip { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.acct-strip button { flex: none; display: grid; gap: 2px; text-align: left; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: var(--text); min-width: 130px; }
.acct-strip button span { font-size: 12px; color: var(--muted); } .acct-strip button b { font-variant-numeric: tabular-nums; }
.acct-strip button.on { border-color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.fin-amt { font-size: 15px; } .fin-amt b { font-size: 20px; }
.steps-help { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.recon-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: 14px; position: sticky; top: 0; z-index: 3; }
.recon-bar > div { background: #fff; padding: 12px 16px; display: grid; gap: 2px; } .recon-bar span { font-size: 12.5px; color: var(--muted); } .recon-bar b { font-size: 20px; font-variant-numeric: tabular-nums; }
.recon-bar .ok { background: var(--green-soft); } .recon-bar .ok b { color: var(--green); } .recon-bar .bad b { color: var(--red); }
.fin-t tr.sec td { background: var(--bg); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 10px; }
.fin-t tr.b td { font-weight: 600; border-top: 1px solid var(--line); }
.fin-t tr.strong td { font-size: 16px; border-top: 2px solid var(--text); background: #FAFBFD; }
.fin-notes { display: grid; gap: 4px; margin-top: 10px; }
.bars { display: flex; gap: 10px; align-items: flex-end; }
.bar-g { flex: 1; display: grid; justify-items: center; gap: 3px; text-align: center; }
.bar-pair { height: 120px; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.bar-pair span { width: 40%; max-width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-pair .in, .key.in { background: var(--blue); } .bar-pair .out, .key.out { background: #B8C4D8; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; vertical-align: -1px; }
@media (max-width: 900px) { .recon-bar { top: 52px; } .recon-bar b { font-size: 16px; } }

/* ---------- budget ---------- */
.bud-wrap { overflow-x: auto; }
.bud-t { min-width: 1180px; } .bud-t th, .bud-t td { padding: 5px 6px; white-space: nowrap; }
.bud-t .bud-label { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 200px; max-width: 240px; white-space: normal; }
.bud-t tr.bud-sec td, .bva-t tr.bud-sec td { background: var(--bg); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bud-t tr.bud-sec .bud-label { background: var(--bg); }
.bud-t tr.bud-sum td, .bva-t tr.bud-sum td { font-weight: 600; border-top: 1px solid var(--line); background: #FAFBFD; }
.bud-t tr.bud-sum .bud-label { background: #FAFBFD; }
.bud-t tr.strong td, .bva-t tr.strong td { border-top: 2px solid var(--text); font-size: 14.5px; }
.bud-in { width: 72px; text-align: right; border: 1px solid transparent; border-radius: 5px; padding: 4px 5px; font: inherit; font-variant-numeric: tabular-nums; background: transparent; }
.bud-in:hover { border-color: var(--line); } .bud-in:focus { border-color: var(--blue); outline: 0; background: #fff; box-shadow: 0 0 0 2px var(--blue-soft); }
.bud-in.b { font-weight: 600; width: 86px; }
.bud-year { background: #F7F9FC; }
.bud-fill { margin-left: 6px; visibility: hidden; } tr:hover .bud-fill { visibility: visible; }
.bud-tools { align-items: center; gap: 8px; }
.bva-bar { position: relative; height: 6px; background: var(--bg); border-radius: 3px; min-width: 90px; margin-bottom: 2px; }
.bva-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.bva-bar span.ok { background: var(--green); } .bva-bar span.warn { background: #D08A1E; } .bva-bar span.bad { background: var(--red); }
.bva-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; }
.bar-pair .budget, .key.budget { background: #D8E0EC; } .bar-pair .under, .key.under { background: #D08A1E; } .bar-pair .neg { background: var(--red); }
.budget-note { margin-top: 4px; }
.bud-in::placeholder { color: #C5CEDC; }

/* ---------- KHQR ---------- */
.khqr-box { width: 240px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; flex: none; }
.khqr-box.small { width: 150px; border-radius: 10px; }
.khqr-bar { background: #E1232E; color: #fff; font-weight: 700; letter-spacing: .1em; text-align: center; padding: 6px; font-size: 13px; }
.khqr-body { padding: 10px; } .khqr-body svg { width: 100%; height: auto; display: block; }
.pay-qr { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; } .pay-qr-side { flex: 1; min-width: 200px; display: grid; gap: 10px; align-content: start; }
.pay-amt { font-size: 28px; font-weight: 700; }
.pay-wait { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-done { display: grid; justify-items: center; gap: 6px; padding: 20px; color: var(--green); text-align: center; } .pay-done b { font-size: 20px; color: var(--text); }
.doc-khqr { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 10px; border: 1px solid #DDE3EC; border-radius: 10px; break-inside: avoid; }

/* ---------- customer care ---------- */
.care-row { align-items: flex-start; }
.care-msg { margin-top: 8px; padding: 10px 12px; background: var(--bg); border-radius: 8px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.5; }

/* ---------- reports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.rep-bar { gap: 8px; } .rep-bar select, .rep-bar .input { width: auto; }
.rkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rk { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; color: var(--text); text-decoration: none; }
.rk.link:hover { border-color: #B8C4D8; } .rk.alert { border-left: 3px solid var(--red); }
.rk-l { font-size: 12.5px; color: var(--muted); } .rk-v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; } .rk-c { font-size: 12px; }
.rk-c.up { color: var(--green); } .rk-c.down { color: var(--red); }
.rep-panel { margin-bottom: 14px; } .rep-panel .ph h2 { font-size: 15px; }
.rep-group { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.rep-card { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--text); text-decoration: none; }
.rep-card:hover { border-color: var(--blue); } .rep-card b { display: block; font-weight: 600; } .rep-card .grow span { display: block; font-size: 12.5px; color: var(--muted); } .rep-card > svg:last-child { color: var(--faint); }
.rep-budget { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; }
.hbars { display: grid; gap: 7px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hb-t { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; } .hb-t span { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tchart { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 6px; }
.tc-col { flex: 1; min-width: 0; display: grid; grid-template-rows: 1fr auto; height: 100%; }
.tc-bars { display: flex; align-items: flex-end; justify-content: center; gap: 1px; height: 100%; }
.tc-bars span { flex: 1; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; }
.tc-x { font-size: 10.5px; color: var(--muted); text-align: center; white-space: nowrap; overflow: visible; height: 16px; }
.tc-bars .in, .key.in { background: var(--blue); } .tc-bars .good, .key.good { background: var(--green); } .tc-bars .mid, .key.mid { background: #8FB0E8; }
.legend { display: flex; gap: 14px; margin-top: 6px; } .legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.funnel { display: grid; gap: 8px; } .fn-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.fn-t { height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; } .fn-t span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #3F74D6); border-radius: 4px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 11px; width: 100%; } .heat th { font-weight: 500; color: var(--muted); padding: 2px 4px; }
.heat td { text-align: center; background: var(--bg); border-radius: 3px; height: 24px; min-width: 22px; font-variant-numeric: tabular-nums; }
.month-t td, .month-t th { white-space: nowrap; }
@media (max-width: 900px) { .hbar { grid-template-columns: minmax(80px, 42%) 1fr auto; } .fn-row { grid-template-columns: 95px 1fr auto; } .rk-v { font-size: 18px; } }
@media print {
  nav.side, .side, .topbar, .tabbar, .rep-bar button, .page-head .actions, .fab { display: none !important; }
  .main, main { margin: 0 !important; padding: 0 !important; }
  .panel, .rk { break-inside: avoid; box-shadow: none; }
}

/* ---------- accounting ---------- */
.statement .t td, .statement .t th { padding: 6px 8px; }
optgroup { font-weight: 600; color: var(--muted); } option { color: var(--text); }

/* ---------- lead workflow ---------- */
.temp-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.temp-pick button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--text); border-right: 1px solid var(--line); }
.temp-pick button:last-child { border-right: 0; }
.temp-pick i, .tdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.temp-pick .hot i, .tdot.hot { background: #E5484D; } .temp-pick .warm i, .tdot.warm { background: #E5A00D; } .temp-pick .cold i, .tdot.cold { background: #5B8DEF; }
.temp-pick .hot.on { background: #FDECEC; color: #B4232A; font-weight: 600; } .temp-pick .warm.on { background: #FFF5DD; color: #8A5A00; font-weight: 600; } .temp-pick .cold.on { background: #EAF1FE; color: #2759C4; font-weight: 600; }
.temp-pick.big { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.temp-pick.big button { flex-direction: column; align-items: flex-start; padding: 10px 12px; gap: 2px; }
.temp-pick.big button > span { font-size: 12px; color: var(--muted); font-weight: 400; }
.lead-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.lead-owner { display: flex; align-items: center; gap: 8px; } .lead-owner select { width: auto; min-width: 150px; }
.stage-bar { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; }
.stage-bar button { flex: 1; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.stage-bar button span { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.stage-bar button:hover { border-color: var(--blue); color: var(--blue); }
.stage-bar button.done { color: var(--text); border-color: #B9CBEA; background: #F6F9FE; } .stage-bar button.done span { border-color: var(--blue); color: var(--blue); }
.stage-bar button.cur { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; } .stage-bar button.cur span { border-color: #fff; color: #fff; }
.stage-bar button.won.done, .stage-bar button.won.cur { background: var(--green); border-color: var(--green); color: #fff; }
.stage-bar button.lost { flex: 0 0 auto; min-width: 64px; color: var(--red); border-style: dashed; justify-content: center; flex-direction: row; }
.hints { display: grid; gap: 6px; margin-bottom: 12px; }
.hint { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; }
.hint.warn { background: #FFF5DD; color: #6B4700; } .hint.tip { background: var(--blue-soft); color: #23427F; } .hint span { flex: 1; } .hint svg { flex: none; margin-top: 2px; }
.guide .ph { align-items: flex-start; }
.guide-todo { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.guide-msg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #FAFBFD; display: grid; gap: 8px; }
.gm-head { display: flex; justify-content: space-between; align-items: center; } .gm-text { font-size: 13.5px; white-space: pre-wrap; line-height: 1.55; }
.interest { display: grid; gap: 6px; } .tag { display: inline-flex; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 12.5px; background: #fff; }
.model-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.model-pick button { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); }
.model-pick button b { font-weight: 500; } .model-pick button span { color: var(--muted); white-space: nowrap; }
.model-pick button.on { border-color: var(--blue); background: var(--blue-soft); }
.reason-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.reason-list label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13.5px; background: #fff; }
.reason-list label.on { border-color: var(--red); background: #FDF2F2; }
.board .card.t-hot { border-left: 3px solid #E5484D; } .board .card.t-warm { border-left: 3px solid #E5A00D; } .board .card.t-cold { border-left: 3px solid #5B8DEF; }
.board .col.drop { background: var(--blue-soft); outline: 2px dashed var(--blue); outline-offset: -4px; }
.board .card[draggable=true] { cursor: grab; }
.bulk-assign { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--blue-soft); border-radius: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.bulk-assign select { width: auto; min-width: 160px; }

/* ---------- full-screen lead ---------- */
body.fs-open { overflow: hidden; }
.fs { position: fixed; inset: 0; z-index: 45; background: var(--bg); overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
.fs-head { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.fs-title { flex: 1; min-width: 0; } .fs-title h1 { font-size: 18px; margin: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fs-body { max-width: 1240px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.fs-body .lead-top, .fs-body .stage-bar { margin-bottom: 0; }
.facts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts > div { background: #fff; padding: 9px 12px; display: grid; gap: 1px; min-width: 0; }
.facts span { font-size: 11.5px; color: var(--muted); } .facts b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .facts em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.lead-main, .lead-side { display: grid; gap: 14px; min-width: 0; }
.models { display: grid; gap: 6px; } .model-row { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; } .model-row b { font-weight: 500; }
@media (max-width: 900px) {
  .fs-head { flex-wrap: wrap; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .fs-actions { order: 3; width: 100%; justify-content: flex-start; }
  .fs-actions .btn { flex: 1; justify-content: center; min-width: 0; }
  .fs-body { padding: 12px; gap: 12px; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-grid { grid-template-columns: 1fr; }
}

/* ---------- installments ---------- */
.calc { display: grid; gap: 14px; }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.plan-pick button { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; color: var(--text); }
.plan-pick button b { font-size: 15px; } .plan-pick button span { font-size: 12px; color: var(--muted); } .plan-pick button em { font-style: normal; font-size: 13px; color: var(--blue); font-weight: 600; }
.plan-pick button.on { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue) inset; }
.down-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .down-row .input, .down-row input { max-width: 160px; }
.calc-result { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; background: #FAFBFD; display: grid; gap: 10px; }
.cr-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; } .cr-main span { color: var(--muted); font-size: 13px; } .cr-main b { font-size: 28px; color: var(--blue); } .cr-main em { font-style: normal; color: var(--muted); }
.apply-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.apply-grid > .form:last-child { position: sticky; top: 12px; }
.doc-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.doc-slot { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1.5px dashed var(--line-strong); border-radius: 8px; cursor: pointer; font-size: 13px; background: #fff; }
.doc-slot span { display: grid; } .doc-slot em { font-style: normal; font-size: 11.5px; color: var(--red); }
.doc-slot.need { border-color: #E9A0A0; } .doc-slot.ok { border-style: solid; border-color: var(--green); background: #F1FAF4; color: #1E6B3A; }
.doc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.doc-thumb { display: grid; gap: 3px; font-size: 11.5px; } .doc-thumb img { width: 100%; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.agreement { position: relative; font-size: 13px; } .agreement h3 { font-size: 13.5px; margin: 16px 0 6px; } .agreement .km { font-family: 'Noto Sans Khmer', 'Khmer OS Battambang', sans-serif; }
.ag-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; } .ag-parties > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; } .ag-parties h3 { margin: 0 0 4px; }
.ag-terms-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.ag-terms-box > div { background: #fff; padding: 8px 10px; display: grid; gap: 2px; } .ag-terms-box span { font-size: 11.5px; color: var(--muted); } .ag-terms-box b { font-size: 14px; }
.ag-sched td { padding-top: 7px; padding-bottom: 7px; }
.ag-terms { padding-left: 20px; display: grid; gap: 8px; margin: 0; } .ag-terms li > div:first-child { margin-bottom: 2px; }
.ag-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 28px; page-break-inside: avoid; }
.ag-sign .thumb { height: 70px; border: 1px dashed var(--line-strong); border-radius: 6px; font-size: 10.5px; color: var(--muted); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.ag-sign .line { border-bottom: 1px solid #333; height: 40px; margin-bottom: 4px; }
.watermark { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 110px; font-weight: 800; color: rgba(200, 30, 30, .09); transform: rotate(-24deg); pointer-events: none; }
@media (max-width: 900px) { .apply-grid { grid-template-columns: 1fr; } .apply-grid > .form:last-child { position: static; } .ag-terms-box { grid-template-columns: 1fr 1fr; } }

/* ---------- marketing ---------- */
.ptag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; border: 1px solid transparent; }
.ptag.meta { background: #E8F0FE; color: #1D4FD8; border-color: #C9DAFB; } .ptag.tiktok { background: #F1F1F3; color: #18181B; border-color: #DCDCE2; } .ptag.other { background: var(--bg); color: var(--muted); }
.insights { display: grid; gap: 6px; padding: 12px 14px; } .hint.good { background: var(--green-soft); color: #14532D; } .hint .linkbtn { white-space: nowrap; }
.schart { position: relative; } .sc-line { position: absolute; left: 0; right: 0; top: 6px; height: calc(100% - 22px); width: 100%; overflow: visible; pointer-events: none; }
.sc-line polyline, .pace polyline { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.sc-line .l1 { stroke: var(--navy); stroke-width: 2.2; } .sc-line .l2 { stroke: var(--green); stroke-width: 2; stroke-dasharray: 4 3; }
.tc-bars .spend, .key.spend { background: #A9C0EA; } .key.l1 { background: var(--navy); } .key.l2 { background: var(--green); } .key.plan { background: #B8C4D8; }
.budget-line { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; color: var(--text); text-decoration: none; font-size: 13px; flex-wrap: wrap; }
.budget-line:hover { border-color: #B8C4D8; } .bl-track { position: relative; flex: 1; min-width: 140px; height: 8px; background: var(--bg); border-radius: 4px; }
.bl-track span { display: block; height: 100%; background: var(--blue); border-radius: 4px; } .bl-track i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--navy); }
.mini-track { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 4px; min-width: 60px; } .mini-track span { display: block; height: 100%; background: var(--blue); border-radius: 2px; } .mini-track span.over { background: var(--red); }
.pace { position: relative; height: 180px; } .pace svg { position: absolute; inset: 0 0 18px 0; width: 100%; height: calc(100% - 18px); overflow: visible; }
.pace .actual { stroke: var(--blue); stroke-width: 2.5; } .pace .plan { stroke: #9AA7BD; stroke-width: 1.5; stroke-dasharray: 5 4; }
.pace-x { position: absolute; left: 0; right: 0; bottom: 0; display: flex; font-size: 10.5px; color: var(--muted); } .pace-x span { flex: 1; text-align: center; }
.sync-line { display: inline-flex; align-items: center; gap: 8px; }
.ad-body { color: var(--muted); max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcal { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mcal-h, .mcal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); } .mcal-h div { padding: 6px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
.mcal-d { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; display: grid; align-content: start; gap: 3px; min-width: 0; }
.mcal-d:nth-child(7n) { border-right: 0; } .mcal-d.out { background: #FAFBFD; } .mcal-d.out .mcal-n { color: var(--faint); } .mcal-d.today .mcal-n { background: var(--blue); color: #fff; border-radius: 50%; width: 22px; text-align: center; }
.mcal-n { font-size: 12px; font-weight: 600; height: 22px; line-height: 22px; }
.citem { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--text); font: inherit; font-size: 11.5px; padding: 2px 5px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem.cont { opacity: .65; }
.citem.s-idea, .key.s-idea, .cdot.s-idea { border-color: #B8C4D8; background: #F2F4F8; } .citem.s-in_progress, .key.s-in_progress, .cdot.s-in_progress { border-color: #D08A1E; background: var(--amber-soft); }
.citem.s-ready, .key.s-ready, .cdot.s-ready { border-color: #6B8FD6; background: #EEF3FC; } .citem.s-scheduled, .key.s-scheduled, .cdot.s-scheduled { border-color: var(--blue); background: var(--blue-soft); }
.citem.s-published, .key.s-published, .cdot.s-published { border-color: var(--green); background: var(--green-soft); } .citem.s-cancelled, .key.s-cancelled, .cdot.s-cancelled { border-color: #C9CED8; background: #F7F8FA; text-decoration: line-through; color: var(--muted); }
.key.s-idea, .key.s-in_progress, .key.s-ready, .key.s-scheduled, .key.s-published, .key.s-cancelled { border-left: 3px solid; }
.cdot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid; flex: none; }
.seg-card { align-items: flex-start; } .seg-card .actions { flex-direction: column; gap: 6px; }
.how { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.acct .actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .mcal-d { min-height: 64px; } .citem { font-size: 10.5px; } .seg-card .actions { flex-direction: row; } .acct { flex-wrap: wrap; } }
.lead-main .ad-body, .rep-panel .ad-body { max-width: 340px; }

/* ---------- chats: one inbox for Messenger, Instagram and Telegram ---------- */
.page.flush { padding: 0; max-width: none; }
.ptag.messenger { background: #E8F0FE; color: #1D4FD8; border-color: #C9DAFB; }
.ptag.instagram { background: #FCEBF3; color: #A21857; border-color: #F5CBDD; }
.ptag.telegram, .ptag.telegram_business { background: #E6F4FB; color: #0E6A99; border-color: #C3E3F3; }
.ptag.tiktok { background: #F1F1F3; color: #18181B; border-color: #DCDCE2; }
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); height: 100vh; background: var(--surface); }
.ib-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.ib-lhead { padding: 14px 14px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.ib-title { display: flex; justify-content: space-between; align-items: center; }
.ib-title h1 { font-size: 19px; }
.ib-waitline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--amber); background: var(--amber-soft); border-radius: var(--r-sm); padding: 5px 8px; }
.ib-waitline.late { color: var(--red); background: var(--red-soft); }
.ib-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--bg); border-radius: 8px; padding: 3px; }
.ib-tabs button { border: 0; background: none; padding: 5px 2px; border-radius: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.ib-tabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(10,23,51,.1); }
.ib-tabs .n { font-size: 11px; color: var(--muted); font-weight: 600; }
.ib-tabs .n.red { color: var(--red); }
.ib-filters { display: flex; gap: 6px; }
.ib-filters .input { min-width: 0; }
.ib-filters select { max-width: 120px; }
.ib-rows { flex: 1; overflow-y: auto; min-height: 0; }
.ib-row { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #EEF1F6; color: var(--text); align-items: flex-start; position: relative; }
.ib-row:hover { background: #F6F8FC; text-decoration: none; }
.ib-row.on { background: var(--blue-soft); }
.ib-row.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.ib-av { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: #E3E8F1; color: var(--navy-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.ib-av .ptag { position: absolute; right: -6px; bottom: -4px; padding: 0 4px; font-size: 9.5px; line-height: 15px; border-width: 1.5px; border-color: #fff; }
.ib-av.lg { width: 40px; height: 40px; }
.ib-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ib-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ib-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-row.unread .ib-top b { font-weight: 700; }
.ib-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.ib-last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-row.unread .ib-last { color: var(--text); }
.ib-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; min-height: 0; }
.ib-tags:empty { display: none; }
.ib-wait { display: inline-flex; align-items: center; gap: 3px; color: var(--amber); font-weight: 600; }
.ib-wait.late { color: var(--red); }
.ib-stage { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.ib-stage .tdot { width: 7px; height: 7px; }
.ib-who { color: var(--faint); }
.ib-unread { flex: none; align-self: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.ib-none { padding: 30px 18px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; font-size: 13px; }
.ib-none b { color: var(--text); font-weight: 500; }
.ib-lfoot { padding: 8px 14px; border-top: 1px solid var(--line); }
.ib-blank { display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--faint); padding: 40px; background: var(--bg); }
.ib-blank b { color: var(--text); font-weight: 500; font-size: 15px; }
.ib-blank .small { max-width: 380px; }
.ib-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.ib-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 62px; }
.ib-hname { flex: 1; min-width: 0; }
.ib-name { display: flex; align-items: center; gap: 2px; font-weight: 600; font-size: 15px; }
.ib-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.iconbtn.sm { width: 26px; height: 26px; }
.iconbtn.sm svg { width: 14px; height: 14px; }
.ib-hactions { display: flex; gap: 8px; align-items: center; }
.ib-assign select { height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; max-width: 170px; }
.ib-owner { display: inline-flex; align-items: center; gap: 4px; }
.ib-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.ib-center { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-msgs { flex: 1; overflow-y: auto; padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 4px; }
.ib-more { text-align: center; margin-bottom: 6px; }
.ib-day { text-align: center; margin: 10px 0 6px; }
.ib-day span { display: inline-block; font-size: 11.5px; color: var(--muted); background: #E6EAF1; border-radius: 10px; padding: 1px 10px; }
.ib-event { align-self: center; text-align: center; font-size: 11.5px; color: var(--faint); margin: 4px 0; display: inline-flex; align-items: center; gap: 4px; }
.ib-msg { display: flex; flex-direction: column; max-width: min(72%, 560px); margin-top: 2px; }
.ib-msg.in { align-self: flex-start; align-items: flex-start; }
.ib-msg.out { align-self: flex-end; align-items: flex-end; }
.ib-msg .bubble { padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.ib-msg.in .bubble { border-bottom-left-radius: 4px; }
.ib-msg.out .bubble { background: var(--blue-soft); border-color: #CFDDF6; border-bottom-right-radius: 4px; }
.ib-msg.out.failed .bubble { background: var(--red-soft); border-color: #F1C4BF; }
.ib-msg.out.sending .bubble { opacity: .65; }
.ib-meta { font-size: 11px; color: var(--faint); margin: 2px 4px 4px; }
.ib-img { display: block; max-width: 240px; max-height: 260px; border-radius: 10px; cursor: zoom-in; object-fit: cover; }
.ib-img.big { max-width: min(520px, 100%); max-height: 70vh; cursor: zoom-out; }
.ib-media { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.ib-note { align-self: stretch; margin: 6px 40px; background: var(--amber-soft); border: 1px dashed #E8C88E; border-radius: 10px; padding: 7px 12px; font-size: 13px; }
.ib-note-h { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--amber); font-weight: 600; margin-bottom: 2px; }
.ib-text-body { white-space: pre-wrap; }
.ib-compose { border-top: 1px solid var(--line); background: var(--surface); padding: 8px 14px 10px; display: grid; gap: 7px; }
.ib-compose.note { background: #FFFBF2; }
.ib-banner { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; border-radius: var(--r-sm); padding: 7px 10px; }
.ib-banner.red { background: var(--red-soft); color: var(--red); }
.ib-banner.amber { background: var(--amber-soft); color: var(--amber); }
.ib-banner svg { flex: none; margin-top: 2px; }
.ib-modes .seg { font-size: 12.5px; }
.ib-input { resize: none; min-height: 44px; max-height: 200px; line-height: 1.45; }
.ib-compose.note .ib-input { background: #FFFDF7; border-color: #EBD3A6; }
.ib-tools { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.ib-tools .btn.primary { margin-left: auto; }
.ib-tool { display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; background: none; color: var(--muted); padding: 5px 8px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.ib-tool:hover { background: var(--bg); color: var(--blue); border-color: var(--line); }
.ib-attach { position: relative; width: max-content; }
.ib-attach img { max-height: 90px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.ib-attach .iconbtn { position: absolute; top: -8px; right: -8px; background: #fff; border: 1px solid var(--line); border-radius: 50%; }
.ib-pick { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 9px 12px; cursor: pointer; font: inherit; color: inherit; }
.ib-pick:hover { border-color: var(--blue); background: #F8FAFE; }
.ib-pick b { font-weight: 500; }
.ib-pick span { font-size: 12.5px; color: var(--muted); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ib-side { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; min-height: 0; }
.ib-side-in section { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.drawer .ib-side-in section { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.drawer .ib-side-in { display: grid; gap: 12px; }
.ib-side-in h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.ib-side-in .kv { grid-template-columns: 96px 1fr; margin: 0; }
.ib-cname { font-weight: 600; font-size: 15px; }
.ib-phone { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; background: var(--green-soft); border-radius: var(--r-sm); padding: 6px 8px; }
.ib-phone-add { display: flex; gap: 6px; }
.ib-phone-add .input { min-width: 0; }
.ib-leadline { display: flex; align-items: center; gap: 10px; }
.ib-other { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ib-side-btn { display: none; }
.actions.wrap { flex-wrap: wrap; }
.ch-grid > .panel + .panel { margin-top: 0; }
.pad { padding: 12px 16px; }
.copyline { display: flex; gap: 8px; align-items: center; }
.copyline code { flex: 1; min-width: 0; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12.5px; }
.copyline .input { flex: 1; min-width: 0; }
.ib-owner-pick { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ib-owner-pick > span { white-space: nowrap; }
.ib-owner-pick select { height: 30px; padding-top: 0; padding-bottom: 0; font-size: 12.5px; max-width: 240px; }
@media (max-width: 1240px) {
  .ib-body { grid-template-columns: minmax(0, 1fr); }
  .ib-side { display: none; }
  .ib-side-btn { display: inline-flex; }
}
@media (max-width: 1060px) { .inbox { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .inbox { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 52px - 66px - env(safe-area-inset-bottom, 0px)); }
  .inbox.has-thread .ib-list { display: none; }
  .inbox:not(.has-thread) .ib-conv { display: none; }
  .ib-list { border-right: 0; }
  .ib-head { padding: 8px 10px; gap: 8px; min-height: 0; }
  .ib-head .ib-av { display: none; }
  .ib-head .ib-chname, .ib-owner, .ib-hactions .lbl { display: none; }
  .ib-hactions .btn { gap: 0; }
  .ib-name { font-size: 14.5px; }
  .ib-hactions { gap: 4px; }
  .ib-hactions .btn { padding-left: 8px; padding-right: 8px; }
  .ib-assign select { max-width: 120px; }
  .ib-msgs { padding: 10px 10px 6px; }
  .ib-msg { max-width: 86%; }
  .ib-note { margin: 6px 8px; }
  .ib-tool span { display: none; }
  .ib-tool { padding: 7px 9px; }
  .ib-compose { padding: 6px 8px 8px; }
}

/* ---------- warranty claims ---------- */
.wc-results { display: grid; gap: 10px; }
.wc-order { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #FAFBFD; }
.wc-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.wc-item:hover { border-color: var(--blue); }
.wc-item .grow { flex: 1; min-width: 180px; }
.wc-pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--green); background: #F1FAF4; border-radius: 8px; }
.wc-pick > svg { color: var(--green); flex: none; margin-top: 2px; }
.wc-pick .grow { flex: 1; min-width: 0; }
.doc-slots .doc-slot:nth-child(3):last-child { grid-column: 1 / -1; }
.doc-thumb > svg { width: 100%; height: 72px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--bg); }
.wc-steps button:disabled { cursor: default; }
.wc-steps button:disabled:hover { border-color: var(--line); color: var(--muted); }
.wc-steps button.cur:disabled:hover, .wc-steps button.done:disabled:hover { color: inherit; }
.wc-steps button.cur:disabled:hover { color: #fff; border-color: var(--blue); }
.wc-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.wc-media:empty { display: none; }
.wc-thumb { position: relative; height: 96px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); cursor: zoom-in; display: flex; align-items: center; justify-content: center; color: var(--muted); font: inherit; }
.wc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wc-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; background: rgba(15, 23, 42, .62); color: #fff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-thumb.video { flex-direction: column; gap: 4px; cursor: pointer; }
.wc-thumb.video span { position: static; background: none; color: var(--muted); text-align: center; }
.wc-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wc-add label.btn { cursor: pointer; }
.wc-note { display: flex; gap: 8px; margin-bottom: 12px; }
.wc-note .input { flex: 1; }
.wc-events { display: grid; }
.wc-ev { padding: 8px 0; border-top: 1px solid var(--bg); display: grid; gap: 2px; font-size: 13.5px; }
.wc-ev:first-child { border-top: 0; }
.wc-brand-note { margin: 0; }
.wc-facts { margin-bottom: 14px; }
.wc-grid .lead-main > .panel, .wc-grid .lead-side > .panel { margin: 0; }
.wc-grid .kv { margin: 0; }
.guide.closed .ph { border-bottom: 0; }
.wc-sheet-photos { margin-top: 14px; page-break-inside: avoid; }
.wc-sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.wc-sheet-grid img { width: 100%; height: 130px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.wc-receipt h3 { margin: 12px 0 4px; }
@media (max-width: 700px) { .doc-slots .doc-slot:nth-child(3):last-child { grid-column: auto; } .wc-sheet-grid { grid-template-columns: repeat(2, 1fr); } }
.wc-cards { display: none; }
.wc-card { display: grid; gap: 3px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; }
.wc-card:first-child { border-top: 0; }
.wc-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.wc-money { grid-template-columns: minmax(0, 1fr) auto; max-width: 560px; }
.wc-sheet .t { font-size: 13px; } .wc-sheet .t td:nth-child(2), .wc-sheet .t td:nth-child(4), .wc-sheet .t td:nth-child(6), .wc-sheet .t td:nth-child(7) { white-space: nowrap; }
.wc-sheet .wc-sheet-claim tr:first-child td { border-bottom: 0; padding-bottom: 2px; }
.wc-sheet .wc-sheet-problem td { white-space: normal !important; padding-top: 0; }
.wc-sheet-claim { page-break-inside: avoid; }
.wc-card:hover { text-decoration: none; background: #F6F9FE; }
@media (max-width: 700px) { .wc-cards { display: block; } .wc-table { display: none; } .wc-steps button { min-width: 0; font-size: 11px; } }
