:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f7f8fa; --line: #e3e6ea; --line-2: #cfd4da; --hover: #f1f3f6;
  --ink: #1d232b; --ink-2: #4a5462; --muted: #737d8a;
  --brand: #1e2733; --brand-2: #2a3542; --side-ink: #c3cad3; --side-muted: #7f8b99;
  --accent: #128a4e; --accent-soft: #e2f3e9; --accent-ink: #0c6b3b;
  --link: #2560c4;
  --good: #128a4e; --good-soft: #e2f3e9; --warn: #b26b00; --warn-soft: #fdf1dc; --bad: #c8372d; --bad-soft: #fde7e5;
  --info: #2560c4; --info-soft: #e5eefc; --violet: #6b4ea0; --violet-soft: #efe9f8;
  --radius: 8px; --shadow: 0 1px 2px rgba(20, 28, 38, .06), 0 2px 8px rgba(20, 28, 38, .04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 21px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; transition: grid-template-columns .15s; }
.sidebar { background: var(--brand); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #3a4655 transparent; }
.brand { display: flex; gap: 10px; align-items: center; padding: 14px 14px 12px; min-height: 58px; }
.brand img { width: 30px; height: 30px; flex: none; background: #fff; border-radius: 7px; padding: 3px; }
.brand b { display: block; color: #fff; font-size: 14px; letter-spacing: .02em; white-space: nowrap; }
.brand span { font-size: 11px; color: var(--side-muted); white-space: nowrap; }
.nav { padding: 4px 8px 16px; flex: 1; }
.nav-group { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; background: none; cursor: pointer; font: 600 10.5px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 14px 8px 5px; text-align: left; }
.nav-group:hover { color: var(--side-ink); }
.nav-group svg { width: 13px; height: 13px; transition: transform .15s; }
.nav-sec.shut .nav-group svg { transform: rotate(-90deg); }
.nav-sec.shut .nav-items { display: none; }
.nav-sec.shut:has(a.active) .nav-items { display: block; } .nav-sec.shut:has(a.active) .nav-items a:not(.active) { display: none; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 6px; color: var(--side-ink); font-size: 13.5px; position: relative; white-space: nowrap; }
.nav a:hover { background: var(--brand-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand-2); color: #fff; font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: #2fbf71; }
.nav a svg { width: 17px; height: 17px; opacity: .9; flex: none; }
.sidebar-foot { padding: 10px 14px; font-size: 11px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle { border: 0; background: none; color: var(--side-muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; }
.side-toggle:hover { background: var(--brand-2); color: #fff; } .side-toggle svg { width: 17px; height: 17px; }
/* collapsed: an icon rail; each item keeps its name as a tooltip */
.layout.slim { grid-template-columns: 64px 1fr; }
.layout.slim .brand div, .layout.slim .nav a span, .layout.slim .nav-group, .layout.slim .foot-t { display: none; }
.layout.slim .brand { justify-content: center; padding: 14px 0; }
.layout.slim .nav a { justify-content: center; padding: 9px 0; }
.layout.slim .nav-sec.shut .nav-items { display: block; } .layout.slim .nav-sec.shut .nav-items a { display: flex; }
.layout.slim .nav-sec + .nav-sec { border-top: 1px solid rgba(255,255,255,.06); margin-top: 4px; padding-top: 4px; }
.layout.slim .nav .nav-badge { position: absolute; top: 2px; right: 6px; padding: 0 4px; min-width: 16px; font-size: 9.5px; }
.layout.slim .sidebar-foot { justify-content: center; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 58px; }
.top-title { font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 280px; }
.topbar .search { flex: 1; max-width: 460px; position: relative; margin-left: auto; }
@media (max-width: 1100px) { .top-title { display: none; } }
.topbar .search input { width: 100%; padding: 8px 12px 8px 34px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font: 13.5px var(--font); }
.topbar .search input:focus { outline: none; border-color: var(--link); background: #fff; box-shadow: 0 0 0 3px var(--info-soft); }
.quick-add { position: relative; }
.quick-add > button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 3px rgba(18,138,78,.35); }
.quick-add > button:hover { background: var(--accent-ink); } .quick-add > button svg { width: 18px; height: 18px; stroke-width: 2.4; }
.quick-menu { position: absolute; right: 0; top: 42px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(20,28,38,.16); padding: 6px; z-index: 60; }
.quick-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--ink); font-size: 13.5px; }
.quick-menu a:hover { background: var(--hover); text-decoration: none; } .quick-menu a svg { width: 16px; height: 16px; color: var(--muted); }
.topbar .search svg { position: absolute; left: 10px; top: 9px; width: 16px; color: var(--muted); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 380px; overflow: auto; z-index: 50; }
.search-results a { display: flex; justify-content: space-between; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dfe7f3; color: #2a4a7a; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.btn.menu-btn { display: none; }
.content { padding: 20px 24px 60px; max-width: 1600px; 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: 3px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; gap: 10px; }
.card-b { padding: 4px 16px 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-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.kpi.alert .value { color: var(--bad); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 1px rgba(20,28,38,.04); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e6c3be; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #eceff3; color: var(--ink-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); } .badge.violet { background: var(--violet-soft); color: var(--violet); }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 12.5px; color: var(--ink-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--hover); }
table.t tfoot td { font-weight: 700; background: var(--surface-2); }
table.t th.num, table.t td.num { text-align: right; }
.table-wrap { overflow: auto; max-height: calc(100vh - 230px); border-radius: 0 0 var(--radius) var(--radius); }
.toolbar { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font: 13px var(--font); }
.toolbar .grow { flex: 1; min-width: 180px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.progress { height: 7px; background: #e9ecf0; border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.progress.good > span { background: var(--good); }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select, .field textarea, .cell-input { width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; font: 13.5px var(--font); background: #fff; color: var(--ink); }
.field textarea { min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .cell-input:focus { outline: 3px solid var(--info-soft); border-color: var(--link); }
.field .req { color: var(--bad); }
.cell-input { padding: 5px 7px; font-size: 13px; min-width: 60px; }
.lines td { padding: 5px 6px; }
.check { display: flex; gap: 8px; align-items: center; padding-top: 22px; } .field.check input { width: auto; flex: none; } .field.check.full { padding-top: 0; }

/* form pages: every form opens as its own page in the main area */
/* while a form page is open, only the top one shows (also hides anything the page below draws late) */
#view:has(> .form-page) > :not(.form-page), #view > .form-page:not(.top) { display: none !important; }
/* form pages use the full width: four fields to a row, fewer on smaller screens; notes and tables take a whole row */
.form-page { max-width: none; }
.form-page .form { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.form-page .form .span-2 { grid-column: span 2; }
@media (max-width: 1400px) { .form-page .form { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .form-page .form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .form-page .form { grid-template-columns: 1fr; } .form-page .form .span-2 { grid-column: auto; } }
.form-page .page-head { margin-bottom: 14px; } .form-page .crumbs a { font-weight: 600; }
.form-card .modal-b { padding: 20px; }
.form-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 12px 12px; z-index: 2; }
.form-errors { margin-bottom: 14px; padding: 12px 16px; border: 1px solid #eab9b3; background: var(--bad-soft); color: var(--bad); border-radius: 10px; font-size: 13px; }
.form-errors ul { margin: 6px 0 0; padding-left: 18px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.field .err { font-size: 12px; color: var(--bad); margin-top: 3px; font-weight: 500; } .field .err:empty { display: none; }
.field.invalid .hint { display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea, input.bad, select.bad, textarea.bad { border-color: var(--bad); background: var(--bad-soft); }
.field.invalid label { color: var(--bad); }
@media (max-width: 760px) { .form-card .modal-b { padding: 14px; } .form-actions { padding: 10px 14px; } .form-actions .btn { flex: 1 1 auto; justify-content: center; } }
/* dialogs (yes/no questions and short messages) */
.modal-bg { position: fixed; inset: 0; background: rgba(20,28,38,.45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(1100px, 100%); }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 18px 20px; overflow: auto; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #232b36; color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); max-width: 420px; animation: fade .15s; }
.toast.error { background: var(--bad); }

/* detail */
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.dl div b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 14px; }
.tabs button { background: none; border: 0; padding: 11px 12px; font: 500 13px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* stage stepper */
.stepper { display: flex; gap: 4px; margin: 6px 0 4px; }
.stepper div { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.stepper div i { display: block; height: 6px; border-radius: 99px; background: #e6e9ee; margin-bottom: 5px; }
.stepper div.done i { background: var(--accent); } .stepper div.cur i { background: var(--brand); } .stepper div.cur { color: var(--ink); font-weight: 600; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(7, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: #eef0f3; border-radius: 10px; padding: 10px; min-height: 300px; }
.kcol-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 8px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kcard:hover { border-color: var(--accent); }
.kcard .t1 { font-weight: 600; font-size: 12.5px; } .kcard .t2 { font-size: 12px; color: var(--ink-2); margin: 3px 0 6px; }
.kcard .row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); gap: 6px; }

/* charts */
.chart { width: 100%; height: auto; max-height: 280px; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--accent); } .chart .bar:hover { fill: var(--accent-ink); }
.chart .bar2 { fill: #b7c3d1; }
.chart-tip { position: fixed; pointer-events: none; background: var(--brand); color: #fff; padding: 6px 10px; border-radius: 7px; font-size: 12px; z-index: 300; box-shadow: var(--shadow); }
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.hbar .track { height: 14px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

.list-mini > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.list-mini > div:last-child { border-bottom: 0; }

/* login */
.login { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; color: #cfd8e3; padding: clamp(28px, 5vh, 56px) clamp(28px, 4.5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  background:
    radial-gradient(600px 400px at 85% 110%, rgba(18,138,78,.35), transparent 70%),
    radial-gradient(500px 360px at 0% 0%, rgba(61,90,128,.45), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    #141b24; }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand b { color: #fff; }
.login-art h1 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.02em; max-width: 520px; color: #fff; margin: 0 0 12px; }
.login-art h1 em { font-style: normal; background: linear-gradient(90deg, #4cd08b, #9be7c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-art p { color: #9fb0c3; max-width: 420px; margin: 0 0 18px; font-size: 15px; }
.art-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: 470px; counter-reset: s; }
.art-flow li { counter-increment: s; font-size: 12px; font-weight: 600; color: #dbe4ee; padding: 5px 10px 5px 6px; border-radius: 99px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 6px; }
.art-flow li::before { content: counter(s); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; background: rgba(76,208,139,.18); color: #4cd08b; }
.login-art .stats { display: flex; gap: 10px; max-width: 520px; }
.login-art .stats div { padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(6px); font-size: 12px; color: #9fb0c3; flex: 1; min-width: 0; }
.login-art .stats b { display: block; font-size: 22px; color: #4cd08b; letter-spacing: -.01em; }
.art-door { position: absolute !important; z-index: 0 !important; right: -40px; top: 50%; height: 78%; transform: translateY(-50%) rotate(-4deg); fill: none; stroke: rgba(155,231,192,.14); stroke-width: 2; }
.art-door circle { fill: rgba(76,208,139,.35); stroke: none; }
.login-form { display: grid; place-items: center; padding: clamp(16px, 4vh, 40px) 32px; overflow-y: auto; background: radial-gradient(500px 300px at 100% 0%, #eef6f1, transparent 70%), var(--surface); }
.login-form form { width: min(440px, 100%); display: grid; gap: clamp(10px, 1.8vh, 14px); }
.login-h h1 { font-size: 26px; letter-spacing: -.01em; margin: 0 0 2px; }
.in-ic { position: relative; }
.in-ic > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--muted); pointer-events: none; }
.login-form .in-ic input { padding: 10px 40px 10px 36px; border-radius: 9px; font-size: 14px; background: var(--surface-2); transition: background .15s, border-color .15s; }
.login-form .in-ic input:focus { background: #fff; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 6px; display: grid; }
.pw-eye:hover { color: var(--ink); background: var(--hover); } .pw-eye svg { width: 17px; height: 17px; }
.login-go { justify-content: center; padding: 11px; font-size: 14.5px; border-radius: 9px; box-shadow: 0 6px 16px -6px rgba(18,138,78,.6); }
.demo-users { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 12px; }
.demo-users button { background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 1px 0; font: 12px var(--font); }
.demo-login { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: clamp(10px, 1.8vh, 14px); }
.demo-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; font-size: 13px; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.demo-card { display: flex; gap: 9px; align-items: center; text-align: left; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); cursor: pointer; font: 13px var(--font); transition: border-color .15s, box-shadow .15s, transform .15s; }
.demo-card:hover, .demo-card:focus-visible { border-color: var(--dc); box-shadow: 0 4px 12px -4px rgba(0,0,0,.15); transform: translateY(-1px); outline: none; }
.demo-card:disabled { cursor: wait; opacity: .6; } .demo-card.busy { opacity: 1; border-color: var(--dc); }
.demo-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--dc); color: #fff; }
.demo-ic svg { width: 16px; height: 16px; }
.demo-tx { display: grid; gap: 0; min-width: 0; line-height: 1.25; } .demo-tx b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-tx .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.demo-note { line-height: 1.4; }
@media (max-height: 640px) { .demo-note, .login-art p { display: none; } }
.no-access { display: grid; justify-items: center; gap: 8px; padding: 48px 16px; text-align: center; }
.no-access svg { width: 36px; height: 36px; color: var(--muted); } .no-access h2 { margin: 0; }

/* print */
.print-doc { background: #fff; color: #000; max-width: 900px; margin: 0 auto; padding: 32px; font-size: 12.5px; }
.print-doc h1 { font-size: 20px; } .print-doc table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.print-doc th, .print-doc td { border: 1px solid #999; padding: 5px 7px; text-align: left; vertical-align: top; }
.print-doc th { background: #f1ece6; font-size: 11px; text-transform: uppercase; }
.print-doc .hdr { display: flex; justify-content: space-between; border-bottom: 3px solid #3b2a1e; padding-bottom: 12px; margin-bottom: 12px; gap: 20px; }
.print-doc .doc-title { text-align: right; } .print-doc .doc-title h1 { color: #3b2a1e; letter-spacing: .06em; }
.print-doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.print-doc .box { border: 1px solid #bbb; padding: 8px 10px; border-radius: 4px; }
.print-doc .tot td { font-weight: 700; }
.print-doc h3.sec { font-size: 13px; margin: 18px 0 2px; text-transform: uppercase; letter-spacing: .04em; color: #1e2733; }
.print-doc .spec-type { margin-top: 12px; break-inside: avoid; }
.print-doc .spec-h { background: #eef2f6; border: 1px solid #999; border-bottom: 0; padding: 6px 8px; } .print-doc .spec-h span { float: right; color: #444; }
.print-doc table.spec { margin-top: 0; } .print-doc table.spec th { width: 32%; background: #fafafa; text-transform: none; font-size: 12px; font-weight: 600; } .print-doc .sign { display: flex; justify-content: space-between; margin-top: 50px; }
.print-bar { position: sticky; top: 0; background: var(--brand); padding: 10px; display: flex; justify-content: center; gap: 10px; z-index: 5; }
@media print {
  .print-bar, .sidebar, .topbar { display: none !important; }
  body { background: #fff; } .print-doc { padding: 0; max-width: none; }
}

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g3 { grid-template-columns: 1fr; } .dl { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .layout, .layout.slim { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 240px; z-index: 60; transition: left .2s; }
  .layout.slim .brand div, .layout.slim .nav a span, .layout.slim .nav-group, .layout.slim .foot-t { display: revert; }
  .layout.slim .nav a { justify-content: flex-start; padding: 7px 10px; } .side-toggle { display: none; }
  .top-title { display: none; } .topbar .search { margin-left: 0; }
  .sidebar.open { left: 0; }
  .btn.menu-btn { display: inline-flex; }
  .content { padding: 16px; } .topbar { padding: 10px 16px; gap: 8px; }
  .topbar .search { min-width: 0; } .user-chip { gap: 4px; } .user-chip .avatar { display: none; }
  .g2, .g4, .form { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; height: auto; min-height: 100dvh; overflow: visible; } .login-art { display: none; }
  .user-chip span:not(.nav-badge) { display: none; }
}

.lines select.cell-input { min-width: 125px; }
.lines td:first-child select.cell-input { min-width: 240px; }

/* security */
.login.single { grid-template-columns: 1fr; }
.notice { background: #fdf4e3; border: 1px solid #f0d9a8; color: #7a4f12; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.notice.ok { background: var(--good-soft); border-color: #b9dcc5; color: var(--good); } .notice.err { background: var(--bad-soft); border-color: #eab9b3; color: var(--bad); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; } .thumbs img { width: 112px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.tf-box { width: min(420px, 100%); display: grid; gap: 14px; } .tf-form { display: grid; gap: 12px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 12px 16px; border: 1px dashed var(--line-2); border-radius: 8px; font-size: 16px; }
.scan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); grid-template-areas: "scan res" "log res"; grid-template-rows: auto 1fr; align-items: start; }
.scan-box { grid-area: scan; } .scan-res { grid-area: res; } .scan-log-card { grid-area: log; }
@media (max-width: 760px) { .scan-grid { grid-template-columns: 1fr; grid-template-areas: "scan" "res" "log"; grid-template-rows: auto; } .scan-flow { grid-template-columns: 1fr; } }
.labels { display: grid; grid-template-columns: repeat(2, 100mm); gap: 0; justify-content: center; }
.lbl { width: 100mm; height: 55mm; box-sizing: border-box; border: 1px dashed #bbb; padding: 3mm; display: flex; gap: 3mm; overflow: hidden; break-inside: avoid; page-break-inside: avoid; font-size: 10.5px; line-height: 1.3; color: #000; }
.lbl .qr { flex: 0 0 33mm; text-align: center; } .lbl .qr svg { width: 33mm; height: 33mm; display: block; }
.lbl .ser { font: 700 10px ui-monospace, Menlo, monospace; margin-top: 1mm; } .lbl .mark { font-size: 17px; font-weight: 800; letter-spacing: .02em; }
.lbl .info { flex: 1; min-width: 0; } .lbl .brand { font-size: 8.5px; letter-spacing: .12em; color: #555; } .lbl .fr { display: inline-block; background: #b4372c; color: #fff; padding: 0 4px; border-radius: 2px; font-weight: 700; }
.lbl .sm { font-size: 9px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-banner { display: flex; gap: 10px; align-items: flex-start; background: #fdecea; border-bottom: 1px solid #f2c4bf; color: #8a2a20; padding: 9px 24px; font-size: 13px; }
.sec-banner svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sec-banner a { color: inherit; font-weight: 600; }
ul.problems { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
ul.problems li { margin: 2px 0; }

@media (max-width: 440px) { .demo-grid { grid-template-columns: 1fr; } .login-form { padding: 24px 16px; } }

/* Roles & Permissions */
.perm-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 14px 4px; }
.perm-wrap { max-height: calc(100vh - 290px); overflow: auto; }
table.perm th { position: sticky; top: 0; background: var(--surface); z-index: 1; vertical-align: bottom; }
table.perm th.role-h { min-width: 120px; }
table.perm th.role-h .btn { margin-top: 6px; }
table.perm tr.group td { background: #f2f4f7; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
table.perm select { min-width: 108px; padding: 4px 6px; font-size: 12.5px; }
table.perm select.lv-none { color: var(--muted); }
table.perm select.lv-edit { color: var(--good); font-weight: 600; }
table.perm .changed select, table.perm tr.changed select { border-color: var(--accent); background: var(--accent-soft); }
table.perm .unsaved select, table.perm tr.unsaved select { box-shadow: 0 0 0 2px var(--accent); }
table.perm .std { font-size: 11px; color: var(--accent-ink); margin-top: 2px; }
.lv { font-size: 12.5px; } .lv-none.lv { color: var(--muted); } .lv-edit.lv { color: var(--good); font-weight: 600; }
.perm-warn { margin: 12px 14px 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--ink-2); font-size: 12.5px; }
.perm-warn ul { margin: 4px 0 0; padding-left: 18px; }
.perm-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.perm-actions [data-count] { margin-right: auto; }
.perm-person { display: grid; grid-template-columns: 240px 1fr; min-height: 300px; }
.perm-people { border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 230px); overflow: auto; }
.perm-people input { margin-bottom: 6px; }
.perm-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; background: none; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; cursor: pointer; font: inherit; color: inherit; }
.perm-pick:hover { background: var(--hover); } .perm-pick.active { background: var(--accent-soft); border-color: var(--accent); }
.perm-detail { min-width: 0; }
.perm-who { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; flex-wrap: wrap; }
@media (max-width: 760px) { .perm-person { grid-template-columns: 1fr; } .perm-people { border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; } }
table.perm td:first-child { min-width: 170px; }

/* ---------- team chat ---------- */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.18); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.nav-badge.hot { background: #d9534a; }
.chat-top { position: relative; } .chat-top svg { width: 16px; height: 16px; }
.chat-top .nav-badge { position: absolute; top: -5px; right: -6px; margin: 0; min-width: 17px; padding: 0 4px; font-size: 10px; line-height: 16px; background: var(--ink-2); }
.chat-top .nav-badge.hot { background: var(--bad); }
.chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - 110px); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.chat-side-h { padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.chat-side-act { display: flex; gap: 6px; } .chat-side-act .btn { flex: 1; justify-content: center; } .chat-side-act svg { width: 14px; height: 14px; }
.chat-filter { margin: 0 14px 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit; }
.modal .chat-filter { margin: 0 0 8px; width: 100%; }
.chat-list { overflow-y: auto; padding: 0 8px 14px; flex: 1; }
.chat-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 8px 4px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--ink-2); }
.chat-item:hover { background: #eef0f3; text-decoration: none; }
.chat-item.active { background: var(--accent-soft); color: var(--accent-ink); }
.chat-item.unread b { color: var(--ink); font-weight: 700; }
.chat-item.other { opacity: .75; }
.chat-item-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-item-t b { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-t span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-hash { width: 20px; text-align: center; color: var(--muted); font-weight: 600; flex: none; display: inline-flex; justify-content: center; }
.chat-hash svg { width: 14px; height: 14px; }
.chat-count { min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #e2e6eb; color: var(--ink-2); font-size: 11px; font-weight: 700; text-align: center; }
.chat-count.hot { background: var(--bad); color: #fff; }
.chat-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.chat-av.sm { width: 24px; height: 24px; font-size: 10px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.chat-empty { margin: auto; text-align: center; max-width: 360px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chat-empty svg { width: 40px; height: 40px; color: var(--accent); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.chat-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.chat-head h2 .chat-av { width: 26px; height: 26px; font-size: 10px; }
.chat-head-t { flex: 1; min-width: 0; } .chat-head-t .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-act { display: flex; gap: 6px; } .chat-head-act svg { width: 14px; height: 14px; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 8px 0 12px; outline: none; }
.chat-older { display: block; margin: 6px auto; }
.chat-first { text-align: center; padding: 40px 16px; }
.chat-day, .chat-new-line { display: flex; align-items: center; gap: 10px; margin: 12px 16px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.chat-day::before, .chat-day::after, .chat-new-line::before, .chat-new-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.chat-new-line { color: var(--bad); } .chat-new-line::before, .chat-new-line::after { border-color: #ecc4bf; }
.chat-msg { display: flex; gap: 10px; padding: 6px 16px 2px; position: relative; }
.chat-msg.grouped { padding-top: 1px; }
.chat-msg:hover { background: var(--surface-2); }
.chat-msg.to-me { background: #f1f8f4; box-shadow: inset 3px 0 0 var(--accent); }
.chat-time-side { width: 34px; flex: none; font-size: 10.5px; color: transparent; text-align: right; padding-top: 3px; }
.chat-msg:hover .chat-time-side { color: var(--muted); }
.chat-msg-b { min-width: 0; flex: 1; }
.chat-msg-h { display: flex; gap: 8px; align-items: baseline; }
.chat-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.chat-photo { display: block; max-width: min(360px, 100%); max-height: 280px; border-radius: 8px; border: 1px solid var(--line); margin: 4px 0; cursor: zoom-in; }
.mention { background: var(--info-soft); color: var(--info); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: var(--accent-soft); color: var(--accent-ink); }
.chat-rec { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2); font-size: 12.5px; }
.chat-rec svg { width: 12px; height: 12px; }
.chat-acts { position: absolute; right: 16px; top: -10px; display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.chat-msg:hover .chat-acts, .chat-acts:focus-within { display: flex; }
.chat-acts button { border: 0; background: none; padding: 3px 8px; font: 500 12px var(--font); color: var(--ink-2); cursor: pointer; }
.chat-acts button:hover { color: var(--accent-ink); }
.chat-edit { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--accent); border-radius: 7px; resize: vertical; }
.chat-edit-act { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.chat-jump { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; border: 0; background: var(--brand); color: #fff; border-radius: 99px; padding: 5px 14px; font: 600 12px var(--font); cursor: pointer; box-shadow: var(--shadow); }
.chat-blocked { padding: 14px 16px; border-top: 1px solid var(--line); text-align: center; }
.chat-compose { border-top: 1px solid var(--line); padding: 10px 16px 8px; position: relative; }
.chat-compose-row { display: flex; gap: 6px; align-items: flex-end; border: 1px solid var(--line-2); border-radius: 10px; padding: 5px; background: var(--surface); }
.chat-compose-row:focus-within { border-color: var(--accent); }
.chat-compose textarea { flex: 1; border: 0; outline: none; resize: none; font: inherit; padding: 5px 4px; max-height: 160px; background: transparent; }
.chat-tool { padding: 5px 7px; } .chat-tool svg { width: 17px; height: 17px; color: var(--ink-2); }
.chat-hint { margin-top: 4px; }
.chat-attach { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; } .chat-attach img { height: 64px; border-radius: 6px; border: 1px solid var(--line); }
.chat-pop { position: absolute; left: 16px; right: 16px; bottom: calc(100% - 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: 0 8px 24px rgba(20,28,38,.14); max-height: 300px; overflow-y: auto; z-index: 5; padding: 4px; }
.chat-pop button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; font: inherit; cursor: pointer; }
.chat-pop button.on, .chat-pop button:hover { background: var(--accent-soft); }
.chat-rec-q { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; margin-bottom: 4px; }
.chat-rec-r button { flex-direction: column; align-items: flex-start; gap: 0; }
.chat-people { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.chat-person { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
button.chat-person:hover, label.chat-person:hover { background: var(--surface-2); }
.chat-person .muted { margin-left: auto; }
[hidden] { display: none !important; } /* the hidden attribute must win over display rules such as .form { display: grid } */
.field .chat-people { border: 1px solid var(--line); border-radius: 8px; padding: 4px; max-height: 220px; }
.field label.chat-person { display: flex; font-size: 13.5px; font-weight: 400; color: var(--ink); margin: 0; }
.field .chat-person input[type=checkbox] { width: auto; padding: 0; margin: 0; flex: none; }
.field .chat-person b { font-weight: 550; }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; }
  .chat.has-conv .chat-side { display: none; }
  .chat:not(.has-conv) .chat-main { display: none; }
  .chat-back { display: inline-flex; }
  .chat-hint { display: none; }
  .chat-msg { padding-left: 10px; padding-right: 10px; }
  .chat-acts { display: flex; position: static; box-shadow: none; border: 0; background: none; margin-left: auto; align-self: flex-start; }
}

/* ---------- lead detail ---------- */
.mt-s { margin-top: 6px; }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; }
.stepper .step { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 5px 13px; font: 500 12.5px var(--font); cursor: pointer; }
.stepper .step:disabled { cursor: default; }
.stepper button.step:not(:disabled):hover { border-color: var(--accent); color: var(--accent-ink); }
.stepper .step.done { background: var(--good-soft); border-color: #b9dcc5; color: var(--good); }
.stepper .step.now { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .step.lost { background: var(--bad-soft); border-color: #eab9b3; color: var(--bad); }
.enquiry { background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; }
.log-form { display: grid; gap: 8px; }
.log-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.log-form select, .log-form textarea, .log-form input[type=date] { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; font: 13.5px var(--font); background: #fff; color: var(--ink); }
.log-form select { min-width: 140px; height: 34px; }
.log-form input[type=date] { height: 34px; }
.log-form textarea { width: 100%; min-height: 76px; resize: vertical; box-sizing: border-box; line-height: 1.45; }
.log-form select:focus, .log-form textarea:focus, .log-form input:focus { outline: 3px solid var(--info-soft); border-color: var(--link); }
.log-next { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.log-next label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.log-next .chip { border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 10px; font: 12px var(--font); cursor: pointer; height: 28px; }
.log-next .chip:hover { background: var(--hover); border-color: var(--link); }
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 5px; }
.tl-stage .tl-dot { background: var(--line-2); }
.tl-stage { color: var(--ink-2); font-size: 13px; }
.tl-notes { white-space: pre-wrap; margin-top: 2px; }
.ai-card .card-h h3::before { content: "✦ "; color: var(--accent); }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-score { display: flex; gap: 14px; align-items: center; }
.ai-num { font-size: 34px; font-weight: 700; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--info-soft); color: var(--info); }
.ai-num.Hot { background: var(--bad-soft); color: var(--bad); } .ai-num.Warm { background: var(--warn-soft); color: var(--warn); }
.ai-h { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ai-next { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.ai-next .btn { margin-right: 6px; }
.ai-list { margin: 0 0 0 18px; padding: 0; font-size: 13px; }
.ai-list.good li::marker { color: var(--good); } .ai-list.bad li::marker { color: var(--bad); }
.dl.dl2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dl > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .lead-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .lead-chips .kpi { padding: 10px 12px; } .lead-chips .kpi .value { font-size: 20px; } }

/* ---------- view switch (pipeline / list) ---------- */
.seg-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; color: var(--ink-2); font: 600 13px var(--font); }
.seg-switch a + a { border-left: 1px solid var(--line-2); }
.seg-switch a:hover { background: var(--hover); text-decoration: none; }
.seg-switch a.on { background: #e9eef6; color: var(--ink); }
.seg-switch svg { width: 15px; height: 15px; }

/* ---------- leads pipeline board ---------- */
.board-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.board-bar input, .board-bar select { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; font: 13px var(--font); }
.board-bar .grow { flex: 1; min-width: 180px; max-width: 320px; }
.board-sum { margin-left: auto; font-weight: 600; color: var(--ink-2); font-size: 13px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: calc(100vh - 250px); }
.bcol { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.bcol:last-child { border-right: 0; }
.bcol-h { position: relative; background: var(--surface); padding: 10px 22px 9px 14px; border-bottom: 1px solid var(--line); }
/* chevron edge between stage headers */
.bcol:not(:last-child) .bcol-h::after { content: ""; position: absolute; right: -9px; top: 50%; width: 16px; height: 16px; background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.bcol-t { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bcol-t b { font-size: 14px; }
.bcol-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bcol-add { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 4px; display: inline-flex; }
.bcol-add:hover { background: var(--hover); color: var(--accent); } .bcol-add svg { width: 16px; height: 16px; }
.bcol-b { padding: 8px; overflow-y: auto; flex: 1; max-height: calc(100vh - 300px); min-height: 120px; }
.bcol.over { background: #eaf6ef; } .bcol.over .bcol-b { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 8px; }
.bcol-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 0; }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; margin-bottom: 7px; cursor: pointer; box-shadow: 0 1px 2px rgba(20,28,38,.06); user-select: none; transition: box-shadow .12s, border-color .12s; }
.deal:hover { border-color: var(--line-2); box-shadow: 0 2px 8px rgba(20,28,38,.1); }
.deal:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.deal-t { font-weight: 600; font-size: 13.5px; line-height: 1.3; overflow-wrap: anywhere; }
.deal-s { font-size: 12px; color: var(--muted); margin: 2px 0 7px; min-height: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.deal-v { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.deal-i { display: inline-flex; align-items: center; gap: 6px; }
.deal .fu { display: inline-flex; } .deal .fu svg { width: 15px; height: 15px; }
.fu.late { color: var(--bad); } .fu.today { color: var(--accent); } .fu.later { color: var(--muted); } .fu.none { color: var(--warn); }
.deal .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); } .deal .dot.Hot { background: var(--bad); } .deal .dot.Warm { background: var(--warn); }
.mini-av { width: 22px; height: 22px; border-radius: 50%; background: #dfe7f3; color: #2a4a7a; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.deal.lifted { opacity: .35; }
.deal.ghost { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; box-shadow: 0 12px 30px rgba(20,28,38,.25); border-color: var(--accent); margin: 0; }
body.dragging-deal, body.dragging-deal * { cursor: grabbing !important; }
.board-drop { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; z-index: 400; }
.dz { display: flex; align-items: center; gap: 8px; padding: 16px 34px; border-radius: 8px; font-weight: 700; font-size: 14px; color: #fff; box-shadow: 0 8px 24px rgba(20,28,38,.22); border: 2px solid transparent; }
.dz svg { width: 18px; height: 18px; }
.dz.won { background: var(--accent); } .dz.lost { background: var(--bad); }
.dz.over { border-color: #fff; transform: scale(1.06); }
@media (max-width: 760px) { .board { grid-auto-columns: 82vw; min-height: 0; } .bcol-b { max-height: none; } .board-sum { margin-left: 0; width: 100%; } .seg-switch span { display: none; } }

/* lead stage bar: chevrons, as on the board */
.stepper { gap: 0; flex-wrap: nowrap; overflow-x: auto; }
.stepper .step { flex: 1 1 0; min-width: 96px; border: 0; border-radius: 0; padding: 7px 10px 7px 20px; background: #e6e9ee; color: var(--ink-2); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -6px; white-space: nowrap; }
.stepper .step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; padding-left: 12px; }
.stepper .step.done { background: #bfe6cf; color: var(--accent-ink); border: 0; }
.stepper .step.now { background: var(--accent); color: #fff; border: 0; }
.stepper .step.lost { background: var(--bad); color: #fff; clip-path: none; border-radius: 6px; margin-left: 12px; flex: 0 0 auto; }
.stepper button.step:not(:disabled):hover { background: #d4dae2; color: var(--ink); }

/* ---------- dashboard ---------- */
.dk { display: block; padding: 14px 16px 14px; color: inherit; text-decoration: none; position: relative; overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s; }
.dk::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--tc); opacity: .85; }
.dk:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tc) 40%, var(--line)); box-shadow: 0 6px 18px -8px rgba(16,24,40,.25); transform: translateY(-1px); }
.dk-top { display: flex; align-items: center; gap: 9px; }
.dk-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, #fff); }
.dk-ic svg { width: 17px; height: 17px; }
.dk-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); flex: 1; min-width: 0; }
.dk-go { color: var(--muted); opacity: 0; transition: opacity .15s; } .dk-go svg { width: 15px; height: 15px; transform: rotate(-90deg); display: block; }
.dk:hover .dk-go { opacity: 1; }
.dk-v { font-size: 26px; font-weight: 700; margin-top: 10px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink); }
.dk-h { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk.alert .dk-v { color: var(--bad); }
.w-big { font-size: 20px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.w-big span { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card-h h3 + .w-big { margin-top: 3px; }
.dash-pipe .card-h { align-items: flex-start; }
.pipe-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 4px 16px 0; }
.pipe-st { position: relative; display: grid; gap: 2px; padding: 12px 22px 12px 16px; color: inherit; text-decoration: none; background: var(--surface-2); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-left: -6px; transition: background .15s; }
.pipe-st:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); margin-left: 0; border-radius: 8px 0 0 8px; }
.pipe-st:hover { background: #e7f3ec; text-decoration: none; }
.pipe-st .ps-n { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-st b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pipe-st .ps-c { font-size: 11.5px; color: var(--muted); }
.ps-bar { height: 4px; border-radius: 4px; background: #dfe3e8; margin-top: 6px; overflow: hidden; } .ps-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.pipe-out { display: flex; gap: 10px; padding: 12px 16px 14px; }
.po { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); color: var(--ink); }
.po:hover { text-decoration: none; background: var(--hover); }
.po svg { width: 15px; height: 15px; } .po.won svg { color: var(--accent); } .po.lost svg { color: var(--bad); }
.po .muted { font-weight: 500; }
.acts { padding: 0 8px 8px; }
.act { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; }
.act:hover { background: var(--hover); text-decoration: none; }
.act-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.act-ic svg { width: 14px; height: 14px; }
.act-ic.late { background: var(--bad-soft); color: var(--bad); border-color: transparent; } .act-ic.today { background: #e7f3ec; color: var(--accent-ink); border-color: transparent; }
.act-t { flex: 1; min-width: 0; display: grid; } .act-t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .act-t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; } .when.late { color: var(--bad); font-weight: 600; } .when.today { color: var(--accent-ink); font-weight: 600; }
.act-none { padding: 8px; font-size: 13px; }
.feed { padding: 0 16px 8px; }
.fd { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.fd:last-child { border-bottom: 0; } .fd-t { flex: 1; min-width: 0; }
@media (max-width: 1100px) { .pipe-strip { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; padding-bottom: 4px; } }
@media (max-width: 1100px) { .dash-kpis.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash-kpis.g2, .dash-kpis.g3, .dash-kpis.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dk-v { font-size: 21px; } .dk { padding: 12px; } .dash-kpis { gap: 10px; } .dk-h { white-space: normal; } .pipe-out { flex-wrap: wrap; } }
.grid > * { min-width: 0; }
.x-scroll { overflow-x: auto; }
.proj-sub { margin-left: 4px; }
@media (max-width: 760px) { .proj-sub { display: none; } }

/* ---------- customers: avatar, type pill, record page with a details sidebar ---------- */
.org-av { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, #fff); }
.org-av.big { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; }
.org-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.type-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: var(--tc); background: color-mix(in srgb, var(--tc) 11%, #fff); white-space: nowrap; }
.rec-head { align-items: center; }
.rec-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rec-id h1 { margin: 0; }
.rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.rec-meta span { display: inline-flex; align-items: center; gap: 4px; } .rec-meta svg { width: 13px; height: 13px; }
.rec { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-side { display: grid; gap: 12px; }
.side-sec { padding: 14px 16px; }
.side-sec h3 { font-size: 13px; margin: 0 0 10px; color: var(--ink); }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum-st { display: grid; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); color: inherit; text-decoration: none; }
a.sum-st[href]:hover { background: var(--hover); text-decoration: none; }
.sum-st span { font-size: 11.5px; color: var(--muted); font-weight: 600; } .sum-st b { font-size: 17px; font-variant-numeric: tabular-nums; }
.sum-st.alert b { color: var(--bad); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.kv:first-of-type { border-top: 0; }
.kv > span { color: var(--muted); font-size: 12.5px; } .kv > div { overflow-wrap: anywhere; }
.kv .wa { display: inline-grid; place-items: center; vertical-align: middle; margin-left: 4px; color: var(--accent); } .kv .wa svg { width: 15px; height: 15px; }
.side-note { margin: 0; font-size: 13px; white-space: pre-wrap; color: var(--ink-2); }
.tab-n { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.tabs button.active .tab-n { background: #e7f3ec; color: var(--accent-ink); }
.tl { padding: 14px 18px; }
.tl-i { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.tl-i:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.tl-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.tl-ic svg { width: 14px; height: 14px; }
.tl-b { flex: 1; min-width: 0; padding-top: 5px; font-size: 13px; } .tl-b .badge { margin-left: 4px; }
@media (max-width: 1100px) { .rec { grid-template-columns: minmax(0, 1fr); } }
.rec-main .tabs { overflow-x: auto; scrollbar-width: none; } .rec-main .tabs button { white-space: nowrap; flex: none; }
@media (max-width: 760px) { .org-av.big { width: 44px; height: 44px; font-size: 16px; border-radius: 11px; } .kv { grid-template-columns: 100px minmax(0, 1fr); } }

/* ---------- project page: status bar and delivery flow ---------- */
.org-av svg { width: 55%; height: 55%; }
.stage-bar { display: flex; align-items: center; gap: 0; }
.stage-bar .sb { flex: 1; position: relative; border: 0; padding: 9px 22px 9px 26px; margin-left: -8px; background: #e6e9ee; color: var(--ink-2); font: 600 12.5px var(--font); cursor: pointer; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%); transition: background .15s, color .15s; }
.stage-bar .sb:first-child { margin-left: 0; padding-left: 16px; border-radius: 8px 0 0 8px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
.stage-bar .sb.done { background: #cfe9da; color: var(--accent-ink); }
.stage-bar .sb.now { background: var(--accent); color: #fff; }
.stage-bar .sb:disabled { cursor: default; }
.stage-bar button.sb:not(:disabled):hover { background: #b9dfc8; color: var(--accent-ink); }
.sb-hold { margin-left: 12px; padding: 6px 12px; border-radius: 99px; background: #fdecdf; color: #c2410c; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.sb-holdbtn { margin-left: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 6px 12px; font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.sb-holdbtn:hover { border-color: #c2410c; color: #c2410c; }
.flow { display: grid; grid-template-columns: repeat(var(--fl-n, 4), minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.fl { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.fl-top { display: flex; align-items: center; gap: 8px; }
.fl-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #fff; color: var(--ink-2); border: 1px solid var(--line); } .fl-ic svg { width: 14px; height: 14px; }
.fl-l { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fl-v { font-size: 22px; font-weight: 700; margin: 8px 0 6px; font-variant-numeric: tabular-nums; } .fl-v span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fl-p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.late-tx { color: var(--bad); font-weight: 600; }
.towers .hbar { grid-template-columns: 70px 1fr 120px; }
@media (max-width: 1100px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stage-bar { flex-wrap: wrap; row-gap: 8px; } .stage-bar .sb { padding: 8px 16px 8px 22px; font-size: 12px; } .sb-hold, .sb-holdbtn { margin-left: 0; } }

/* ---------- quotations: status strip, details beside a summary ---------- */
.q-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.q-st { display: grid; gap: 2px; padding: 11px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.q-st:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tc) 45%, var(--line)); box-shadow: 0 4px 12px -6px rgba(16,24,40,.2); }
.q-st.on { border-color: var(--tc); box-shadow: inset 0 -3px 0 var(--tc); }
.q-n { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.q-n i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.q-st b { font-size: 17px; font-variant-numeric: tabular-nums; }
.q-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.q-sum { border-top: 3px solid var(--tc); }
.q-big { font-size: 28px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.q-rows { margin-top: 12px; display: grid; }
.q-rows > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.q-rows span { color: var(--muted); } .q-rows b { font-weight: 600; font-variant-numeric: tabular-nums; }
.q-rows .q-cost { background: var(--bg, #f6f7f9); margin: 0 -8px; padding: 7px 8px; } .q-rows .q-cost .badge { margin-left: 4px; }
.cost-card .card-h { gap: 8px 10px; flex-wrap: wrap; } .cost-card h3 { white-space: nowrap; } .cost-card td:first-child { min-width: 180px; } .cost-card tr.low td { background: var(--bad-soft); } .cost-card tfoot td { border-top: 2px solid var(--line); }
.q-valid { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.q-valid svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
@media (max-width: 1100px) { .q-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } .q-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .q-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* ---------- searchable select boxes (public/js/select.js): the real <select> is hidden, a button opens a searchable list ---------- */
.ss-native { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; clip-path: inset(50%); }
.ss-btn { display: inline-flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; vertical-align: middle; min-width: min(calc(var(--ss-ch, 8ch) + 36px), 100%); max-width: 100%;
  padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; color: var(--ink); font: 13.5px var(--font); line-height: 1.4; }
.ss-btn:hover:not(:disabled) { border-color: #b4bbc4; }
.ss-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-ph { color: var(--muted); }
.ss-car { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .12s; }
.ss-btn.ss-open .ss-car { transform: rotate(180deg); }
.ss-btn:focus-visible, .ss-btn.ss-open { outline: 3px solid var(--info-soft); border-color: var(--link); }
.ss-btn:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.field .ss-btn { width: 100%; padding: 7px 10px; }
.toolbar .ss-btn { padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.board-bar .ss-btn { padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.field.invalid .ss-btn, .ss-btn.bad, .ss-btn[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-soft); }
.lines .ss-btn.cell-input { min-width: 125px; }
.lines td:first-child .ss-btn.cell-input { min-width: 240px; }
table.perm .ss-btn { min-width: 108px; padding: 4px 6px; font-size: 12.5px; }
table.perm .ss-btn.lv-none { color: var(--muted); }
table.perm .ss-btn.lv-edit { color: var(--good); font-weight: 600; }
table.perm .changed .ss-btn, table.perm tr.changed .ss-btn { border-color: var(--accent); background: var(--accent-soft); }
table.perm .unsaved .ss-btn, table.perm tr.unsaved .ss-btn { box-shadow: 0 0 0 2px var(--accent); }
.ss-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px;
  box-shadow: 0 12px 32px rgba(20,28,38,.18); font: 13.5px var(--font); color: var(--ink); animation: fade .08s; }
.ss-search { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex: none; }
.ss-search svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.ss-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 2px 0; background: transparent; color: var(--ink); font: inherit; }
.ss-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.ss-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; line-height: 1.35; overflow-wrap: anywhere; }
.ss-opt.ss-act { background: var(--hover); }
.ss-opt.ss-sel { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.ss-opt.ss-sel.ss-act { background: #d2ebdc; }
.ss-opt b { font-weight: 700; color: var(--ink); background: #fff1c2; border-radius: 2px; }
.ss-opt.ss-dis { color: var(--muted); cursor: default; opacity: .65; }
.ss-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ss-none { padding: 14px 10px; color: var(--muted); text-align: center; }
@media (max-width: 760px) { .ss-search input { font-size: 16px; } .ss-opt { padding: 10px 12px; } }
@media print { .ss-car { display: none; } .ss-btn { border: 0; padding: 0; } }

/* sales orders */
.so-ful { display: grid; gap: 3px; min-width: 150px; font-size: 13px; }
.li-item { min-width: 220px; max-width: 340px; }
/* invoices */
.inv-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .inv-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .inv-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack-bar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.stack-bar span { display: block; height: 100%; min-width: 4px; }
.stack-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.stack-key > div { display: grid; grid-template-columns: 10px 1fr; column-gap: 7px; align-items: center; align-content: start; }
.stack-key i { width: 10px; height: 10px; border-radius: 3px; }
.stack-key span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stack-key b, .stack-key em { grid-column: 2; font-style: normal; } .stack-key b { font-size: 15px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .stack-key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* dispatch */
.dc-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .dc-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.jr-dot { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.jr-dot.ok { background: var(--good); border-color: var(--good); color: #fff; } .jr-dot svg { width: 12px; height: 12px; }
.fl.jr-done { background: var(--good-soft); }
.fl.jr-done .fl-ic { color: var(--good); border-color: #bfe3cd; }

/* production: board, work-order list and record */
.wo-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .wo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
button.q-st { font: inherit; text-align: left; cursor: pointer; }
.wo-board { grid-auto-columns: minmax(180px, 1fr); }
@media (max-width: 760px) { .wo-board { grid-auto-columns: 78vw; } }
.bcol-gate { display: inline-flex; color: var(--warn); } .bcol-gate svg { width: 15px; height: 15px; }
.wo-deal { border-left: 3px solid var(--tc, var(--line)); }
.wo-deal.held { background: #fff8f5; }
.wo-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.wo-deal .deal-i .badge { font-size: 10.5px; padding: 1px 6px; }
.fu.ok { color: var(--good); }
.wo-bar .sb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .wo-bar .sb { flex: 1 1 40%; } }

/* inventory: list strip, stock meter, category mix, stock position */
.mat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .mat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-meter { position: relative; display: block; width: 96px; height: 5px; margin: 5px 0 3px auto; border-radius: 3px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.st-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c); }
.st-meter em { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink-2); border-radius: 1px; }
.mat-mix .stack-key { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mat-mix .stack-key > a { display: grid; grid-template-columns: 10px 1fr; column-gap: 7px; align-items: center; align-content: start; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.mat-mix .stack-key > a:hover { background: var(--hover); text-decoration: none; }
.mat-mix .stack-key > a.on { border-color: var(--line-2); background: var(--surface-2); }
@media (max-width: 760px) { .mat-mix .stack-key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pos-bar { position: relative; height: 14px; border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: visible; }
.pos-bar i { position: absolute; top: 0; bottom: 0; }
.pos-stock { left: 0; border-radius: 7px 0 0 7px; }
.pos-order { background: repeating-linear-gradient(135deg, #2560c4 0 4px, #9db8e6 4px 8px); opacity: .75; }
.pos-bar em { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; }
.pos-need { background: var(--ink); } .pos-re { background: #b26b00; }
.pos-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.pos-key span { display: inline-flex; align-items: center; gap: 6px; }
.pos-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pos-order-k { background: repeating-linear-gradient(135deg, #2560c4 0 3px, #9db8e6 3px 6px); }
.pos-need-k { background: var(--ink); width: 3px !important; height: 12px !important; } .pos-re-k { background: #b26b00; width: 3px !important; height: 12px !important; }
.pos-v { font-size: 19px; font-weight: 700; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }

/* purchase orders: received / billed bars and the goods receipts */
.po-meter { width: 84px; margin: 4px 0 0; }
.grn-list { display: grid; gap: 10px; padding: 14px 16px; }
.grn { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.grn-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.grn-h svg { width: 16px; height: 16px; color: var(--good); }
.grn-l { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0 5px 24px; border-top: 1px dashed var(--line); font-size: 13px; }
.grn-l b { white-space: nowrap; color: var(--good); }

/* vendors: rating stars */
.stars { color: #d69e2e; letter-spacing: 1px; white-space: nowrap; } .stars span { color: var(--line-2); }
.ven-strip { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
@media (max-width: 760px) { .ven-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* job work: the one year to bring inputs back */
.year-bar { height: 8px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.year-bar i { display: block; height: 100%; border-radius: 4px; }

/* site installation: progress by tower or project, status select coloured by status */
.inst-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.inst-key span { display: inline-flex; align-items: center; gap: 5px; } .inst-key i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.inst-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.inst-g { display: grid; gap: 8px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.inst-g:hover { border-color: var(--line-2); box-shadow: 0 4px 12px -6px rgba(16,24,40,.2); }
.inst-g.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.inst-gh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.inst-bar { height: 10px; }
.inst-st { width: 140px; border-left: 3px solid var(--tc, var(--line-2)) !important; }
@media (max-width: 760px) { .inst-h { flex-direction: column; align-items: flex-start; gap: 8px; } .inst-groups { grid-template-columns: 1fr; padding: 4px 12px 12px; } }

/* snags: open snags by problem and team, the problem, before / after photos */
.snag-mix { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mt-s { margin-top: 8px; } .mb-s { margin-bottom: 6px; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 340px; }
.snag-desc { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.snag-fix { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--good); background: var(--good-soft); border-radius: 6px; } .snag-fix p { margin: 4px 0 0; white-space: pre-wrap; }
.snag-ba { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.snag-ba-h { display: flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 8px; } .snag-ba-h i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.snag-ph { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.snag-ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: block; }
.snag-noph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 110px; border: 1px dashed var(--line-2); border-radius: 8px; color: var(--ink-3); font-size: 12px; text-align: center; padding: 10px; }
@media (max-width: 760px) { .snag-mix, .snag-ba { grid-template-columns: 1fr; } }

/* scan door label: mode tiles, the label box, the door card and the session log */
.scan-modes { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; }
.scan-mode { display: flex; align-items: flex-start; gap: 10px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.scan-mode > span:last-child { display: grid; gap: 2px; } .scan-mode:hover { border-color: var(--line-2); }
.scan-mode.on { border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); } .scan-mode.on .fl-ic { color: var(--accent); }
.scan-in { display: flex; align-items: center; gap: 8px; } .scan-in input { flex: 1; font-size: 18px; min-width: 0; }
.scan-in-ic { color: var(--muted); display: grid; } .scan-in-ic svg { width: 22px; height: 22px; }
.scan-prog { display: grid; gap: 6px; margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.scan-prog-h { display: flex; justify-content: space-between; font-size: 13px; } .good-tx { color: var(--good); font-weight: 600; }
.scan-wait { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 20px; text-align: center; color: var(--ink-2); }
.scan-wait svg { width: 40px; height: 40px; color: var(--muted); } .scan-wait.bad { color: var(--bad); } .scan-wait.bad svg { color: var(--bad); }
.scan-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px; } .scan-id { display: grid; gap: 4px; min-width: 0; }
.scan-serial { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.scan-flow { padding-top: 0; }
.scan-kv { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; padding: 0 16px 8px; }
.scan-snags { padding: 4px 16px 12px; } .scan-snags h3 { margin: 6px 0 8px; font-size: 13px; }
.scan-snag { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; margin-bottom: 6px; }
.scan-snag:hover { border-color: var(--line-2); text-decoration: none; } .scan-snag-t { display: grid; flex: 1; min-width: 0; }
.scan-acts { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.scan-empty { padding: 12px 16px; color: var(--muted); }
.scan-log { display: flex; align-items: center; gap: 10px; padding: 7px 16px; border-top: 1px solid var(--line); border-left: 3px solid var(--good); font-size: 13px; }
.scan-log.bad { border-left-color: var(--bad); } .scan-log-t { flex: 1; min-width: 0; color: var(--ink-2); } .scan-log.bad .scan-log-t { color: var(--bad); }
@media (max-width: 760px) { .scan-modes { grid-template-columns: 1fr; } .scan-kv { grid-template-columns: 1fr; } .scan-serial { font-size: 18px; } }

/* stock ledger: the period switch and the material being shown */
.ledger-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ledger-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 13px; font-weight: 600; }
.ledger-chip svg { width: 14px; height: 14px; } .ledger-chip a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; } .ledger-chip a:hover { background: rgba(37,96,196,.15); }
@media (max-width: 760px) { .ledger-bar .seg-switch { width: 100%; overflow-x: auto; } .ledger-bar .seg-switch a { flex: none; } }

/* quality control: the queue at the QC gates, pass rate by check, defects, the three checks on a row */
.qc-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.qc-q { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--tc); border-radius: 10px; background: var(--surface); }
.qc-q-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .qc-q-t { font-weight: 600; }
.qc-q-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.qc-mix { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; padding-top: 14px; } .qc-mix h3 { font-size: 13px; }
.qc-row { display: grid; grid-template-columns: 170px 1fr 44px 44px; align-items: center; gap: 10px; padding: 6px 0; color: inherit; } .qc-row:hover { text-decoration: none; background: var(--hover); }
.qc-row b, .qc-row .muted { text-align: right; }
.qc-def { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; } .qc-def:last-child { border-bottom: 0; }
.qc-checks { display: inline-flex; gap: 6px; flex-wrap: wrap; font-size: 11.5px; } .qc-checks span { white-space: nowrap; } .qc-checks .ok { color: var(--muted); } .qc-checks .no { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) { .qc-mix { grid-template-columns: 1fr; } .qc-row { grid-template-columns: 1fr 70px 40px; } .qc-row .muted { display: none; } .qc-queue { padding: 4px 12px 12px; } }

/* material planning: shortages grouped by vendor, and the coverage bar (stock, then open POs, against what is needed) */
.mrp-vendors { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 4px 16px 16px; }
.mrp-v { display: grid; gap: 4px; align-content: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.mrp-v.none { border-style: dashed; border-color: var(--warn); background: var(--warn-soft); }
.mrp-v-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; } .mrp-v-h svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--warn); }
.mrp-v-l { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; } .mrp-v-l span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mrp-cover { position: relative; display: flex; width: 140px; height: 8px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 4px; }
.mrp-cover .s { background: var(--good); border-radius: 4px 0 0 4px; } .mrp-cover .o { background: var(--info); opacity: .75; }
.mrp-cover i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
@media (max-width: 760px) { .mrp-vendors { padding: 4px 12px 12px; } }

/* products: the cost build-up bar, the share of each BOM line, actions above a tab's table */
.prod-bar { height: 12px; }
.fl-l .dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 6px; }
.bom-share { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; } .bom-share i { display: block; height: 100%; background: #0e7490; }
.tab-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 0; }

/* site visits: the check-in panel (GPS, site, photos), and where a visit was logged */
.visit-panel { display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); }
.visit-panel .field { margin: 0; } .visit-panel .log-row input[name=place_in] { flex: 1 1 220px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; font: 13.5px var(--font); background: var(--surface, #fff); color: var(--ink); } .visit-panel .log-row select { flex: 0 1 240px; }
.visit-gps { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); } .visit-gps > span { flex: 1; min-width: 0; }
.visit-gps svg { width: 15px; height: 15px; flex: none; } .visit-gps.ok { color: var(--good); } .visit-gps.bad { color: var(--warn); }
.visit-gps .spin { flex: none; width: 13px; height: 13px; border: 2px solid var(--line-2); border-top-color: var(--accent, #2560c4); border-radius: 50%; animation: vspin .8s linear infinite; }
@keyframes vspin { to { transform: rotate(360deg); } }
.visit-where { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.visit-where svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.gps-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--good); background: var(--good-soft, rgba(18,138,78,.1)); }
.gps-tag svg { width: 12px; height: 12px; margin: 0; } .gps-tag.rough { color: var(--warn); background: var(--warn-soft); } .gps-tag.none { color: var(--warn); background: var(--warn-soft); white-space: normal; }
a.gps-tag:hover { text-decoration: none; filter: brightness(.95); }
.visit-ph { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .visit-ph img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* BOQ: the line editor, the door-type bars and the lead card */
.boq-ed td { vertical-align: middle; } .boq-ed .cell-input { padding: 5px 7px; }
.boq-type { display: grid; grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; }
.boq-type span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .boq-type b { text-align: right; } .boq-type .year-bar i { background: var(--accent, #2560c4); }
.boq-mini { display: flex !important; justify-content: space-between; align-items: center; gap: 8px; color: inherit; } .boq-mini:hover { text-decoration: none; background: var(--hover); }
.boq-mini > svg { width: 14px; height: 14px; color: var(--muted); flex: none; transform: rotate(-90deg); } .boq-mini .type-pill { margin-left: 4px; }

/* quotation rates: list and floor under the rate, red when the net rate is below the floor */
.rate-hint { font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 3px; white-space: nowrap; text-align: right; }
.rate-hint.below { color: var(--bad); } .rate-hint.below b { font-weight: 700; }
/* spec lock */
.spec-code { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; margin: 2px 2px 0 0; }
.spec-sample { margin-top: 16px; display: grid; gap: 10px; }
.spec-lbl { font-weight: 600; font-size: 13px; }
.spec-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-seg label { cursor: pointer; } .spec-seg input { position: absolute; opacity: 0; pointer-events: none; }
.spec-seg span { display: inline-block; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 99px; font-size: 13px; background: var(--surface); }
.spec-seg input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.spec-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.spec-when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .spec-when[hidden] { display: none; }
.spec-when label, .spec-notes { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.spec-when input, .spec-notes textarea { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: 13.5px var(--font); background: var(--surface); color: var(--ink); }
@media (max-width: 600px) {
  .spec-when { grid-template-columns: 1fr; }
  .spec-form thead { display: none; }
  .spec-form table, .spec-form tbody { display: block; }
  .spec-form tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .spec-form .table-wrap { max-height: none; overflow: visible; }
  .spec-form .t td { display: block; border: 0; padding: 0; }
  .spec-form td:nth-child(3), .spec-form td:nth-child(4) { grid-column: 1 / -1; }
  .spec-form td .cell-input { width: 100%; min-width: 0 !important; }
}
tr.row-on td { background: var(--accent-soft, #eef4ff); }
/* advance gate */
.adv-pill { display: inline-block; white-space: nowrap; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); vertical-align: 1px; }
.adv-pill.ok { background: var(--good-soft); color: var(--good); } .adv-pill.warn { background: var(--warn-soft); color: var(--warn); } .adv-pill.bad { background: var(--bad-soft); color: var(--bad); }
.adv-gate { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; } .adv-gate .btn { flex: none; }
@media (max-width: 600px) { .adv-gate { flex-direction: column; } }
/* site inspection */
.insp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.insp-meta label, .insp-more label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.insp-meta input, .insp-more input { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; font: 13.5px var(--font); background: var(--surface); color: var(--ink); min-width: 0; }
.insp-list { display: grid; gap: 8px; margin-bottom: 12px; }
.insp-row { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 8px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; background: var(--surface); }
.insp-row.ok { border-left-color: var(--good); } .insp-row.bad { border-left-color: var(--bad); background: var(--bad-soft); } .insp-row.was:not(.ok):not(.bad) { border-left-color: var(--warn); }
.insp-q { font-size: 13.5px; }
.insp-more { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 170px; gap: 8px 10px; align-items: end; } .insp-more[hidden] { display: none; }
.insp-more [data-ph] { grid-column: 1 / -1; } .insp-more .field { margin: 0; }
.insp-pend { display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; } .insp-pend:last-child { border-bottom: 0; }
.insp-pend .visit-ph { margin: 0; flex: none; }
.insp-pend svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; }
.insp-ul { margin: 6px 0; padding-left: 18px; } .insp-ul li { margin: 2px 0; }
@media (max-width: 600px) {
  .insp-meta { grid-template-columns: 1fr; }
  .insp-row { grid-template-columns: 1fr; } .insp-more { grid-template-columns: 1fr; }
  .insp-pend { flex-direction: column; }
}
/* measurement: the automatic door size */
.auto-hint { font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 3px; max-width: 120px; }
.auto-hint.off { color: var(--bad); font-weight: 600; }
tr.off-auto td { background: var(--bad-soft); }
.notice > svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }

/* production lines (routes) */
.rt-chip { display: inline-block; font: 600 10.5px/1 var(--mono, ui-monospace, monospace); letter-spacing: .02em; padding: 3px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: 1px; }
.wo-top .rt-chip { margin-left: 6px; }
.rt-wh { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--muted); }
.rt-wh svg, .rt-dest svg { width: 13px; height: 13px; }
.rt-dest { display: inline-flex; align-items: center; gap: 4px; }
.side-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-h h3 { margin: 0; }
.rt-sec .side-h { margin-bottom: 8px; }
.rt-steps { margin: 6px 0 8px; padding-left: 20px; font-size: 12.5px; color: var(--muted); }
.rt-steps li { margin: 2px 0; }
.rt-tbl td { vertical-align: top; }
@media (max-width: 640px) {
  .rt-tbl thead { display: none; }
  .rt-tbl tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
  .rt-tbl td { display: block; border: 0; padding: 2px 0; text-align: left; }
  .rt-tbl td[data-l]:not([data-l="Line"])::before { content: attr(data-l) ": "; color: var(--muted); font-size: 11.5px; }
}

/* Sakinaka warehouse */
.wh-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .wh-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wh-scan-f { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.wh-scan-f .field { margin: 0; }
.wh-scan-f .field:first-child { width: 130px; }
.wh-scan-f .grow { flex: 1 1 260px; }
.wh-scan .card-b > .btn { margin-top: 10px; }
.wh-log { margin-top: 10px; display: grid; gap: 4px; }
.wh-l { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 10px; border-radius: 6px; background: var(--good-soft); }
.wh-l.bad { background: var(--bad-soft, #fbeaea); color: var(--bad, #b0473a); }
.wh-l svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.wh-note { margin: 0; padding: 0 16px 10px; }
.wh-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--tc); }
.wh-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); }
.wh-scan-f [data-bin] { font-size: 18px; }
@media (max-width: 640px) {
  .wh-tw thead { display: none; }
  .wh-tw tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line, #e5e7eb); }
  .wh-tw td { display: block; border: 0 !important; padding: 0 !important; }
  .wh-tw td.wh-c-door { flex-basis: 100%; order: 2; }
  .wh-tw td.wh-c-pick, .wh-tw td.wh-c-label { order: 1; }
  .wh-tw td:not(.wh-c-pick):not(.wh-c-label):not(.wh-c-door) { order: 3; }
}

/* loading a challan at dispatch: scan, kit, truck */
.ld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.ld-chk { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.ld-chk .jr-dot { margin-left: 0; margin-top: 1px; }
.ld-chk.ok b { color: var(--good); }
.ld-chk .progress, .ld-chk .bar { margin-top: 6px; }
.ld-todo { margin: 0 16px 16px; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft, #fff6e0); font-size: 13px; }
.ld-todo ul { margin: 4px 0 0 18px; padding: 0; }
.ld-kbar { display: flex; gap: 8px; align-items: center; padding: 12px 16px 4px; flex-wrap: wrap; }
.ld-kbar .muted { margin-right: auto; }
.ld-tick { width: 20px; height: 20px; accent-color: var(--good); cursor: pointer; }
@media (max-width: 760px) { .ld-grid { grid-template-columns: 1fr; } }
/* billing desk (Mumbai office) */
.desk-act { white-space: nowrap; text-align: right; }
.desk-act .btn + .btn { margin-left: 6px; }
.desk-strip .q-st { min-width: 0; }
@media (max-width: 900px) {
  .desk-tw thead { display: none; }
  .desk-tw tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 18px; padding: 12px 14px; border-bottom: 1px solid var(--line, #e5e7eb); }
  .desk-tw td { display: block; border: 0 !important; padding: 0 !important; text-align: left !important; }
  .desk-tw td.desk-c-proj { flex-basis: 100%; }
  .desk-tw td.desk-act { flex-basis: 100%; text-align: left; }
  .desk-tw td.desk-act:empty { display: none; }
}
/* WhatsApp alerts when a truck leaves */
.al-card .card-h h3 { display: flex; align-items: center; gap: 8px; } .al-card .card-h h3 svg { width: 16px; height: 16px; }
.al-list { padding: 0 16px 8px; }
.al-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line, #e5e7eb); }
.al-row:first-child { border-top: 0; }
.al-act { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.al-foot { padding: 0 16px 14px; }
.al-msg { white-space: pre-wrap; font: 13.5px/1.5 inherit; font-family: inherit; background: var(--surface-2); padding: 12px 14px; border-radius: 10px; margin: 0; }
@media (max-width: 640px) { .al-row { grid-template-columns: 1fr; gap: 6px; } .al-act { justify-content: flex-start; } }
/* builder QC at unloading */
.un-card .card-h h3 { display: flex; align-items: center; gap: 8px; } .un-card .card-h h3 svg { width: 16px; height: 16px; }
.un-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px 16px; } .un-sum > div { display: flex; flex-direction: column; gap: 2px; }
.un-note { margin: 0 16px 12px; } .un-rep { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; font-size: 13px; } .un-rep svg { width: 14px; height: 14px; }
.un-free { color: var(--good); }
.un-lines { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; } .un-lh { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.un-line { display: grid; grid-template-columns: 1fr 80px 80px 140px; gap: 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.un-line.bad { border-color: var(--bad); background: var(--bad-soft, transparent); }
.un-line label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.un-more { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .un-more .full { grid-column: 1 / -1; }
.thumbs.big a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
@media (max-width: 760px) { .un-sum { grid-template-columns: 1fr; } .un-line { grid-template-columns: 1fr 1fr; } .un-ld { grid-column: 1 / -1; } .un-line > label:nth-of-type(3) { grid-column: 1 / -1; } }
.pod-card .card-h h3 { display: flex; align-items: center; gap: 8px; } .pod-card .card-h h3 svg { width: 16px; height: 16px; } .pod-th { padding: 0 16px 12px; } .pod-card .al-foot { display: flex; gap: 8px; }
/* installation job cards */
.ij-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .ij-form .full { grid-column: 1 / -1; }
.ij-sum { padding: 10px 0; grid-template-columns: 1fr 1fr; } .ij-floors > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ij-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; }
@media (max-width: 760px) { .ij-form, .ij-sum { grid-template-columns: 1fr; } .ij-grid { grid-template-columns: 1fr 1fr; } }
.ij-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .ij-bh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 13px; }
.ij-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ij-th { margin-top: 4px; } .ij-th img { width: 64px; height: 48px; }
.ij-upd { display: flex; flex-direction: column; } .ij-u { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; } .ij-uh { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ij-mon .card-h h3 { display: flex; align-items: center; gap: 8px; } .ij-mon .card-h h3 svg { width: 16px; height: 16px; color: var(--warn); }
.ij-mon-r { display: grid; grid-template-columns: 1.4fr 1fr 1.6fr; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; } .ij-mon-r:hover { background: var(--surface-2); }
.ij-mon-r .ij-flags { margin-top: 0; }
@media (max-width: 760px) { .ij-bars, .ij-mon-r { grid-template-columns: 1fr; } }
/* builder verification */
.bv-card .card-h h3 { display: flex; align-items: center; gap: 8px; } .bv-card .card-h h3 svg { width: 16px; height: 16px; }
.bv-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .bv-form .full { grid-column: 1 / -1; }
.bv-sec { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; } .bv-sh { display: flex; justify-content: space-between; align-items: center; }
.bv-rc { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; } .bv-rc [data-rcn] { grid-column: 1 / -1; }
.bv-rc .seg { display: flex; gap: 12px; font-size: 13px; } .bv-rc .seg label { display: flex; gap: 4px; align-items: center; }
.bv-sn { display: grid; grid-template-columns: 1.2fr 1fr 2fr auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; } .bv-sn .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .bv-form, .bv-sn { grid-template-columns: 1fr; } }
.bv-sn [data-x] { justify-self: end; }
/* handover certificates */
.hc-ready .card-h h3 { display: flex; align-items: center; gap: 8px; } .hc-ready .card-h h3 svg { width: 16px; height: 16px; color: var(--good); }
.hc-r { flex-direction: row; justify-content: space-between; align-items: center; }
.hc-jobs { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; } .hc-j { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
/* milestone billing */
.bl-q .card-h h3 { display: flex; align-items: center; gap: 8px; } .bl-q .card-h h3 svg { width: 16px; height: 16px; color: #6b4fa0; }
.bl-ms { display: grid; gap: 14px; }
.bl-m { display: flex; gap: 12px; align-items: flex-start; }
.bl-n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.bl-b { flex: 1; min-width: 0; } .bl-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 2px; }
.bl-b .muted.small { line-height: 1.6; }
/* payment follow-up */
.fu-head { display: grid; gap: 6px; } .fu-steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.fu-step { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; } .fu-step.on { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.fu-checks .card-b { color: var(--warn); font-size: 13px; } .fu-checks svg { width: 15px; height: 15px; vertical-align: -2px; } .fu-checks ul { margin: 6px 0 0 18px; color: var(--text); }
.fu-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.fu-msg { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; background: var(--surface-2); padding: 12px 14px; border-radius: 8px; }
.stage-bar a.sb { text-align: center; text-decoration: none; display: block; }
/* project close */
.pc-ck { display: grid; gap: 8px; } .pc-i { display: flex; gap: 10px; align-items: flex-start; }
.pc-i .pc-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--good); }
.pc-i.no .pc-dot { background: var(--warn); } .pc-i .muted { font-size: 12.5px; }
.pc-pl { width: 100%; border-collapse: collapse; font-size: 13.5px; } .pc-pl td { padding: 6px 4px; border-bottom: 1px solid var(--line); } .pc-pl td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-pl tr.t td { font-weight: 700; border-top: 2px solid var(--line); } .pc-pl tr.h td { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding-top: 12px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 14px; align-items: start; }

/* the technical specification card on the quotation screen */
.q-spec .spec-type { margin-top: 12px; } .q-spec .spec-type:first-child { margin-top: 0; }
.q-spec .spec-h { background: var(--surface-2); border: 1px solid var(--line-2); border-bottom: 0; padding: 8px 10px; border-radius: 6px 6px 0 0; } .q-spec .spec-h span { float: right; color: var(--ink-2); }
.q-spec table.spec { width: 100%; border-collapse: collapse; border: 1px solid var(--line-2); } .q-spec table.spec th, .q-spec table.spec td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.q-spec table.spec th { width: 32%; background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
