/* ServHub brand tokens (taken from the ServHub CAFM web app theme) */
:root {
  --navy: #071B4F; --blue: #145EDB; --blue-hover: #0F4FC0; --blue-tint: rgba(20, 94, 219, 0.10);
  --teal: #12BFC4; --teal-tint: #E9FBFE; --ink: #071827; --ink-depth: #0B2A3C;
  --surface: #F4F7FB; --row-alt: #EAF1F8; --border: #E5ECF5; --silver: #D5DEE9;
  --muted: #59697C; --secondary: #526173;
  --success: #147A46; --success-bg: #E8F7EE; --warning: #8A4B00; --warning-bg: #FFF4D6;
  --danger: #B42318; --danger-bg: #FEECEB; --purple: #6D3FE0; --purple-bg: #F3EFFE;
  --radius: 14px; --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(7,24,39,0.05), 0 1px 3px rgba(7,24,39,0.06);
  --shadow-md: 0 10px 26px -14px rgba(7,24,39,0.32);
  --shadow-lg: 0 30px 80px -30px rgba(7,24,39,0.55);
  --nav-w: 244px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Inter, Aptos, Sora, 'Segoe UI', system-ui, sans-serif; font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
code { background: var(--row-alt); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
kbd { font: 600 10.5px/1 inherit; background: #fff; border: 1px solid var(--silver); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; color: var(--secondary); }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .small { font-size: 11.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; } .clickable { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Layout & navigation ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; transition: grid-template-columns .28s var(--ease); }
body.nav-collapsed .app { grid-template-columns: 68px 1fr; }
.sidebar { background: linear-gradient(185deg, var(--navy) 0%, #06143A 55%, var(--ink) 100%); color: #DCE6F5; display: flex; flex-direction: column; padding: 16px 10px 14px; min-height: 0; min-width: 0; overflow: hidden; z-index: 26; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; white-space: nowrap; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 7px); gap: 3px; align-items: end; height: 26px; flex: none; }
.brand-mark span { border-radius: 3px; background: var(--blue); height: 14px; }
.brand-mark span:nth-child(2) { height: 26px; background: #1769E0; }
.brand-mark span:nth-child(3) { height: 20px; background: var(--teal); }
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .2px; }
.brand-sub { font-size: 10.5px; color: var(--teal); font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; color: #7F95B8; padding: 12px 12px 4px; white-space: nowrap; }
.nav button { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0; color: #C5D3E8; padding: 9px 12px; border-radius: 10px; white-space: nowrap; transition: background .18s, color .18s, transform .18s; }
.nav button:hover { background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.nav button.active { background: linear-gradient(90deg, var(--blue), #1B73F0); color: #fff; font-weight: 600; box-shadow: 0 8px 18px -10px rgba(20,94,219,.9); }
.nav button.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal); }
.nav .count { margin-left: auto; font-size: 10.5px; font-weight: 700; background: rgba(255,255,255,.16); padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.12); padding: 12px 8px 0; display: grid; gap: 6px; min-width: 0; }
.foot-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: #8FA5C4; }
.sidebar-foot select { width: 100%; min-width: 0; background: var(--ink-depth); color: #fff; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; padding: 7px 8px; }
.foot-user { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.foot-name { color: #fff; font-weight: 600; }
.foot-links { display: flex; gap: 12px; }
.link-btn { background: none; border: 0; color: #8FA5C4; font-size: 11.5px; text-align: left; padding: 2px 0; }
.link-btn:hover { color: #fff; text-decoration: underline; }
body.nav-collapsed .nav-label, body.nav-collapsed .brand-text, body.nav-collapsed .nav-group, body.nav-collapsed .nav .count { display: none; }
body.nav-collapsed .nav button { justify-content: center; padding: 10px 0; }
body.nav-collapsed .brand { justify-content: center; padding-inline: 0; }
body.nav-collapsed .foot-user { justify-content: center; }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: relative; z-index: 5; }
.titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 18px; font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.view { flex: 1; overflow: auto; padding: 18px 22px 28px; min-height: 0; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--silver); background: #fff; color: var(--secondary); transition: background .15s, color .15s, transform .15s; flex: none; }
.icon-btn:hover { background: var(--row-alt); color: var(--navy); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 24px; height: 24px; border-radius: 7px; border-color: transparent; background: transparent; }
.icon-btn.sm:hover { background: var(--row-alt); }
.jump { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--silver); background: var(--surface); color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.jump:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); color: var(--navy); }

/* ---------- Controls ---------- */
input, select, textarea { border: 1px solid var(--silver); border-radius: 9px; padding: 7px 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
select:disabled { background: var(--surface); color: var(--muted); }
textarea { resize: vertical; min-height: 60px; width: 100%; }
#search { width: 190px; height: 36px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--silver); background: #fff; border-radius: 10px; padding: 7px 13px; font-weight: 600; white-space: nowrap; transition: background .15s, transform .12s, box-shadow .15s, border-color .15s; }
.btn:hover { background: var(--surface); border-color: #BFCBDB; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, #1B6BEA, var(--blue)); border-color: var(--blue); color: #fff; box-shadow: 0 6px 14px -8px rgba(20,94,219,.9); }
.btn.primary:hover { background: var(--blue-hover); }
.btn.teal { background: var(--teal); border-color: var(--teal); color: var(--navy); box-shadow: 0 6px 14px -8px rgba(18,191,196,.9); }
.btn.teal:hover { background: #2BD0D4; }
.btn.danger { color: var(--danger); border-color: #F3C7C2; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.solid:hover { background: #991B12; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn.on-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.btn.on-dark:hover { background: rgba(255,255,255,.2); }
.btn.glass { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; }
.btn.glass:hover { background: rgba(255,255,255,.26); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.loc { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.stat-pill { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-weight: 600; color: var(--navy); box-shadow: var(--shadow); }
.seg { display: inline-flex; border: 1px solid var(--silver); border-radius: 10px; overflow: hidden; background: #fff; padding: 2px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 5px 11px; font-weight: 600; color: var(--secondary); border-radius: 8px; transition: background .15s, color .15s; }
.seg button:hover { background: var(--row-alt); }
.seg button.active { background: var(--navy); color: #fff; }
.pill-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill-row.tight { gap: 4px; flex-wrap: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--silver); background: #fff; border-radius: 999px; padding: 6px 13px; font-weight: 600; color: var(--secondary); transition: all .16s var(--ease); }
.pill:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-1px); }
.pill.active { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 14px -8px rgba(20,94,219,.9); }
.pill.xs { padding: 3px 9px; font-size: 11.5px; }
.pill.outline { border-style: dashed; }
.check-pill { cursor: pointer; } .check-pill input { margin: 0; accent-color: var(--blue); }
.check-pill:has(input:checked) { background: var(--blue-tint); border-color: var(--blue); color: var(--blue); }
.add-row { margin-top: 10px; }

/* ---------- Chips & avatars ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--row-alt); color: var(--secondary); white-space: nowrap; }
.chip.blue { background: var(--blue-tint); color: var(--blue); } .chip.teal { background: var(--teal-tint); color: #0B7F83; }
.chip.green { background: var(--success-bg); color: var(--success); } .chip.amber { background: var(--warning-bg); color: var(--warning); }
.chip.red { background: var(--danger-bg); color: var(--danger); } .chip.purple { background: var(--purple-bg); color: var(--purple); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 700; flex: none; vertical-align: middle; }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; } .avatar.lg { width: 42px; height: 42px; font-size: 14px; background: linear-gradient(135deg, var(--blue), var(--teal)); }
.avatar.teal { background: var(--teal); color: var(--navy); width: 32px; height: 32px; }
.avatar.owner { width: 24px; height: 24px; font-size: 9.5px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--teal); margin-left: 6px; }
.avatar.more { background: var(--row-alt); color: var(--secondary); }
.avatars { display: inline-flex; } .avatars .avatar { background: #5B6B86; box-shadow: 0 0 0 2px #fff; margin-left: -6px; } .avatars .avatar:first-child { margin-left: 0; }
.star { color: #E0A100; } .star svg { fill: #F5B301; }

/* ---------- Panels ---------- */
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.grid-2 .panel, .grid-4 .panel, .admin-grid .panel, .account-grid .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-size: 13.5px; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.panel-body { padding: 12px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 23px; font-weight: 700; color: var(--navy); margin-top: 4px; letter-spacing: -.3px; }
.kpi .hint { font-size: 11.5px; color: var(--muted); }
.kpi.accent { background: linear-gradient(135deg, #fff 55%, var(--teal-tint)); border-top: 3px solid var(--teal); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 18px; margin-bottom: 16px; color: #fff; background: radial-gradient(120% 160% at 100% 0%, rgba(18,191,196,.55) 0%, transparent 55%), linear-gradient(120deg, var(--navy), var(--blue)); box-shadow: var(--shadow-md); }
.hero h2 { font-size: 21px; letter-spacing: -.2px; } .hero p { color: #D6E4FB; margin-top: 2px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 26px 16px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--silver); margin-bottom: 4px; } .empty strong { color: var(--navy); } .empty .btn { margin-top: 10px; }

/* ---------- Tables & lists ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); background: #FAFCFE; white-space: nowrap; }
thead tr:first-child th:first-child { border-top-left-radius: var(--radius); } thead tr:first-child th:last-child { border-top-right-radius: var(--radius); }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.clickable td { transition: background .12s; } tr.clickable:hover td { background: var(--surface); }
.matrix-wrap { overflow-x: auto; }
.matrix th, .matrix td { text-align: center; } .matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix th { text-transform: none; letter-spacing: 0; font-size: 11.5px; white-space: normal; min-width: 120px; } .matrix th div { margin-top: 4px; }
.dot-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--silver); background: #fff; color: #fff; display: inline-grid; place-items: center; transition: all .16s var(--ease); }
.dot-btn:hover { border-color: var(--blue); transform: scale(1.1); }
.dot-btn.on { background: var(--teal); border: 2px solid var(--teal); color: var(--navy); box-shadow: 0 6px 12px -6px rgba(18,191,196,.9); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .title { font-weight: 600; }
.list-row.clickable { margin-inline: -8px; padding-inline: 8px; border-radius: 9px; transition: background .12s; } .list-row.clickable:hover { background: var(--surface); }
.done .title { text-decoration: line-through; color: var(--muted); }
.tick { position: relative; width: 20px; height: 20px; flex: none; cursor: pointer; }
.tick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tick span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--silver); color: transparent; transition: all .16s var(--ease); }
.tick input:checked + span { background: var(--success); border-color: var(--success); color: #fff; transform: scale(1.05); }
.tick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.timeline { display: grid; gap: 8px; margin-top: 4px; }
.tl-item { display: flex; gap: 9px; align-items: flex-start; }
.tl-item .body { flex: 1; background: var(--surface); border-radius: 10px; padding: 7px 10px; transition: background .12s; }
.tl-item.clickable:hover .body { background: var(--row-alt); }
.tl-item .meta { font-size: 11px; color: var(--muted); }

/* ---------- Deal board ---------- */
.board { display: flex; gap: 12px; align-items: stretch; height: calc(100vh - 168px); min-height: 380px; overflow-x: auto; padding-bottom: 8px; scroll-behavior: smooth; }
.column { flex: 0 0 262px; display: flex; flex-direction: column; min-height: 0; background: var(--row-alt); border-radius: var(--radius); border: 2px solid transparent; border-top: 3px solid var(--blue); transition: background .18s, border-color .18s, transform .18s var(--ease); }
.column:nth-child(1) { border-top-color: #071B4F; } .column:nth-child(2) { border-top-color: #0C348C; } .column:nth-child(3) { border-top-color: #145EDB; }
.column:nth-child(4) { border-top-color: #1769E0; } .column:nth-child(5) { border-top-color: #1492D2; } .column:nth-child(6) { border-top-color: #12BFC4; }
.column.won { background: #E3F4EA; border-top-color: var(--success); } .column.lost { background: #FBEDEC; border-top-color: var(--danger); }
.column.over { border-color: var(--blue); background: #DCE9FB; transform: scale(1.012); }
.col-head { padding: 10px 12px 6px; }
.col-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy); }
.col-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.column.won .dot { background: var(--success); } .column.lost .dot { background: var(--danger); }
.col-count { margin-left: auto; background: #fff; border-radius: 999px; padding: 0 8px; font-size: 11px; box-shadow: var(--shadow); }
.col-title .add { margin-left: 2px; background: #fff; color: var(--blue); }
.col-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.col-gate { font-size: 10.5px; color: var(--secondary); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.col-body { padding: 6px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; min-height: 0; }
.drop-hint { display: none; border: 2px dashed var(--blue); border-radius: 11px; padding: 14px; text-align: center; color: var(--blue); font-weight: 600; background: rgba(255,255,255,.6); }
.column.over .drop-hint { display: block; animation: pulse 1s ease-in-out infinite; }
.deal-card { position: relative; background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 12px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow); user-select: none; transition: transform .2s var(--ease), box-shadow .2s, opacity .2s; flex: none; }
.deal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.deal-card.tender { border-left-color: var(--teal); }
.deal-card.dragging { opacity: .28; transform: scale(.97); }
.deal-card.ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; box-shadow: var(--shadow-lg); cursor: grabbing; transition: none; opacity: .96; }
body.is-dragging { user-select: none; cursor: grabbing; } body.is-dragging * { cursor: grabbing !important; }
.card-top { display: flex; justify-content: space-between; gap: 6px; }
.deal-card .client { font-size: 11.5px; color: var(--muted); }
.deal-card .grip { color: var(--silver); opacity: 0; transition: opacity .15s; } .deal-card:hover .grip { opacity: 1; }
.deal-card .name { font-weight: 700; margin: 1px 0 6px; }
.deal-card .row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.row-right { display: inline-flex; align-items: center; }
.deal-card .value { font-weight: 700; color: var(--navy); font-size: 14px; }
.deal-card .next { font-size: 11.5px; color: var(--secondary); margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border); }
.card-actions { display: flex; gap: 6px; margin-top: 9px; align-items: center; }
.card-actions .act { height: 28px; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 9px; font-size: 11.5px; font-weight: 600; color: var(--secondary); transition: all .16s var(--ease); white-space: nowrap; }
.card-actions .act.next { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.act.next { color: var(--blue); background: var(--blue-tint); border-color: transparent; }
.act.next:hover { background: var(--blue); color: #fff; box-shadow: 0 6px 14px -8px rgba(20,94,219,.9); }
.act.next:hover .ic { transform: translateX(2px); } .act .ic { transition: transform .16s; }
.act.lost:hover { background: var(--danger-bg); color: var(--danger); border-color: #F3C7C2; }
.act:active { transform: scale(.95); }

/* ---------- Companies & people ---------- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.company-card { padding: 14px 16px; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.company-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #C9D8EE; }
.company-top { display: flex; align-items: center; gap: 11px; color: var(--silver); } .company-top h3 { color: var(--navy); font-size: 14px; }
.company-card:hover .company-top > .ic { color: var(--blue); transform: translateX(3px); } .company-top > .ic { transition: all .2s; }
.logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; font-weight: 700; flex: none; }
.company-people { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.person-card { display: flex; gap: 11px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; transition: all .2s var(--ease); }
.person-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.person-card.primary { border-color: #F3D98A; background: linear-gradient(135deg, #fff 60%, #FFF9E8); }
.person-card .title { font-weight: 700; } .contact-lines { margin-top: 6px; word-break: break-all; }
.team-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.member { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px 4px 4px; background: var(--surface); }
.member > span:not(.avatar) { display: grid; line-height: 1.2; }

/* ---------- Side panel ---------- */
.drawer { position: fixed; inset: 0; background: rgba(7,24,39,.42); display: flex; justify-content: flex-end; z-index: 30; animation: fade .2s ease-out; }
.drawer[hidden], .modal[hidden], .palette[hidden], .auth[hidden] { display: none; }
.drawer-panel { width: min(660px, 100%); background: #fff; height: 100%; overflow: auto; box-shadow: -18px 0 52px -34px rgba(0,27,58,.6); }
.drawer-head { position: relative; background: linear-gradient(135deg, var(--navy), #0B2F86); color: #fff; padding: 16px 20px 16px; }
.drawer-head h2 { font-size: 18px; margin: 2px 0; padding-right: 30px; }
.drawer-head .sub { color: #B9C8E2; font-size: 12px; } .drawer-head .sub.link { display: inline-flex; gap: 5px; align-items: center; color: var(--teal); font-weight: 600; }
.drawer-head .close { position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; transition: background .15s; }
.drawer-head .close:hover { background: rgba(255,255,255,.26); }
.drawer-section { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 9px; }
.path { display: flex; gap: 2px; margin-top: 12px; flex-wrap: wrap; }
.path button { flex: 1; min-width: 60px; border: 0; padding: 7px 4px 7px 10px; font-size: 10.5px; font-weight: 600; background: rgba(255,255,255,.13); color: #C5D3E8; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); transition: background .16s, color .16s; }
.path button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.path button:hover { background: rgba(255,255,255,.28); color: #fff; }
.path button.passed { background: rgba(18,191,196,.4); color: #fff; }
.path button.current { background: var(--teal); color: var(--navy); } .path button.current.lost { background: #F97066; color: #fff; } .path button.current.won { background: #3CCB7F; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 3px; align-content: start; } .field.full { grid-column: 1 / -1; }
.field label { font-size: 11px; font-weight: 600; color: var(--secondary); } .field label .req { color: var(--danger); }
.field > input, .field > select, .field > textarea { width: 100%; }
.field .loc select { flex: 1; min-width: 110px; } .field .loc { display: flex; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink); cursor: pointer; } label.check input { margin: 0; accent-color: var(--blue); }
.inline-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; } .inline-form input, .inline-form select { flex: 1; min-width: 0; } .inline-form select[name=type] { flex: 0 0 auto; }
.approval-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Modal, palette, sign-in ---------- */
.modal, .palette { position: fixed; inset: 0; background: rgba(7,24,39,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 40; padding: 16px; animation: fade .18s ease-out; }
.palette { place-items: start center; padding-top: 12vh; z-index: 45; }
.modal-card { background: #fff; border-radius: 18px; width: min(560px, 100%); max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { padding: 18px 20px 0; } .modal-head h3 { font-size: 16px; color: var(--navy); }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.notice { display: flex; gap: 9px; align-items: flex-start; border-radius: 11px; padding: 10px 12px; margin-bottom: 12px; font-size: 12.5px; }
.notice.block { background: var(--danger-bg); color: var(--danger); } .notice.info { background: var(--blue-tint); color: var(--navy); }
.move-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-weight: 600; flex-wrap: wrap; }
.pal-card { background: #fff; border-radius: 16px; width: min(620px, 100%); box-shadow: var(--shadow-lg); overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal-input input { flex: 1; border: 0; padding: 0; font-size: 15px; box-shadow: none; }
.pal-list { max-height: 50vh; overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; color: var(--secondary); }
.pal-item strong { color: var(--ink); } .pal-item.active, .pal-item:hover { background: var(--blue-tint); color: var(--blue); }
.pal-foot { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; display: flex; gap: 6px; align-items: center; }
.auth { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: radial-gradient(90% 90% at 85% 10%, rgba(18,191,196,.35), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--ink) 75%); }
.auth-card { background: #fff; border-radius: 20px; padding: 28px 28px 26px; width: min(400px, 100%); display: grid; gap: 12px; box-shadow: var(--shadow-lg); }
.auth-card .brand { padding: 0 0 6px; } .auth-card .brand-name { color: var(--navy); } .auth-card h3 { font-size: 18px; color: var(--navy); }
.auth-card .btn { padding: 10px; margin-top: 4px; }

/* ---------- Insights ---------- */
.funnel { width: 100%; max-width: 760px; display: block; margin: 0 auto; height: auto; }
.funnel polygon { transition: filter .2s; } .funnel-row:hover polygon { filter: brightness(1.15); }
.f-num { fill: #fff; font-weight: 700; font-size: 16px; } .f-name { fill: var(--navy); font-weight: 600; font-size: 12.5px; }
.f-val { fill: var(--ink); font-size: 12px; font-weight: 600; } .f-conv { fill: var(--muted); font-size: 11px; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; }
.bar-track { background: var(--row-alt); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--teal)); min-width: 3px; }
.bar-fill.red { background: linear-gradient(90deg, #D9372B, #F97066); }

/* ---------- Data Centre ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-grid .wide { grid-column: 1 / -1; } .admin-grid p { margin-bottom: 10px; }
.dropzone { display: grid; justify-items: center; gap: 3px; margin-top: 12px; padding: 22px; border: 2px dashed var(--silver); border-radius: 14px; background: var(--surface); color: var(--blue); cursor: pointer; transition: all .18s var(--ease); }
.dropzone:hover { border-color: var(--blue); background: var(--blue-tint); transform: translateY(-1px); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.dropzone + .notice { margin-top: 12px; }
.dup-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.danger-zone { border-color: #F3C7C2; } .danger-zone .panel-head { background: var(--danger-bg); border-radius: var(--radius) var(--radius) 0 0; } .danger-zone .panel-head h3 { color: var(--danger); }

/* ---------- Toasts & confetti ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-md); border-left: 4px solid var(--teal); animation: toastIn .3s var(--ease) both; max-width: 90vw; }
.toast.err { border-left-color: #F97066; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti span { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear both; }

/* ---------- Motion ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes grow { from { width: 0; } to { width: var(--w); } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .7; } }
.pop { animation: pop .24s var(--ease) both; }
.slide-in { animation: slideIn .3s var(--ease) both; }
.view-enter > * { animation: rise .34s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .04s; } .view-enter > *:nth-child(3) { animation-delay: .08s; } .view-enter > *:nth-child(n+4) { animation-delay: .12s; }
.view-enter .column, .view-enter .company-card, .view-enter .person-card { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.view-enter .funnel-row { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + .1s); }
.view-enter .bar-fill { animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + .15s); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } #search { display: none; } }
@media (max-width: 900px) {
  .app, body.nav-collapsed .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-102%); transition: transform .28s var(--ease); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(7,24,39,.45); z-index: 25; animation: fade .2s; }
  body.nav-collapsed .nav-label, body.nav-collapsed .brand-text, body.nav-collapsed .nav-group { display: revert; }
  body.nav-collapsed .nav button { justify-content: flex-start; padding: 9px 12px; }
  .grid-2, .admin-grid, .fields, .fields.three { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; gap: 10px; } .topbar p, .jump span, .jump kbd { display: none; } .jump { padding: 0 10px; }
  .view { padding: 14px; } .board { height: calc(100vh - 210px); } .column { flex-basis: 82vw; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
}

/* =====================================================================================
   White theme — calm white surfaces on a lightly dotted canvas, brand colours as accents
   ===================================================================================== */
:root {
  --ink: #1F2433; --surface: #F6F7F9; --row-alt: #F1F4F8; --border: #E8EBF0; --silver: #D9DEE7;
  --shadow: 0 1px 2px rgba(31,36,51,.04), 0 2px 8px rgba(31,36,51,.05);
  --shadow-md: 0 14px 32px -16px rgba(31,36,51,.28);
}
body { background: #fff; color: var(--ink); }
.view { background-color: #FCFCFB; background-image: radial-gradient(#E4E8EF 1px, transparent 1px); background-size: 22px 22px; }
.sidebar { background: #fff; color: var(--ink); border-right: 1px solid var(--border); }
.brand-name { color: var(--navy); } .brand-sub { color: #0E9AA0; }
.nav-group { color: #9AA4B5; }
.nav button { color: #4A5568; }
.nav button:hover { background: var(--row-alt); color: var(--navy); }
.nav button.active { background: var(--blue-tint); color: var(--blue); box-shadow: none; }
.nav button.active::before { background: var(--blue); }
.nav .count { background: var(--row-alt); color: var(--secondary); } .nav button.active .count { background: var(--blue); color: #fff; }
.sidebar-foot { border-top-color: var(--border); } .foot-label { color: var(--muted); } .foot-name { color: var(--navy); }
.sidebar-foot select { background: #fff; color: var(--ink); border-color: var(--silver); }
.link-btn { color: var(--muted); } .link-btn:hover { color: var(--blue); }
.topbar { background: rgba(255,255,255,.92); }
.hero { background: linear-gradient(120deg, #fff 0%, #EEF5FF 55%, #E3FAFA 100%); color: var(--navy); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero p { color: var(--secondary); }
.btn.glass { background: #fff; border-color: var(--silver); color: var(--navy); } .btn.glass:hover { border-color: var(--blue); color: var(--blue); background: #fff; }
.column { background: rgba(255,255,255,.82); border: 1px solid var(--border); border-top: 3px solid var(--blue); box-shadow: var(--shadow); }
.column.won { background: #F4FBF7; } .column.lost { background: #FEF7F6; } .column.over { background: #EEF5FF; border-color: var(--blue); }
.col-count { background: var(--row-alt); box-shadow: none; }
.drawer-head { background: #fff; color: var(--ink); border-bottom: 1px solid var(--border); }
.drawer-head h2 { color: var(--navy); } .drawer-head .sub { color: var(--muted); } .drawer-head .sub.link { color: var(--blue); }
.drawer-head .close { background: var(--row-alt); color: var(--secondary); } .drawer-head .close:hover { background: var(--silver); }
.path button { background: var(--row-alt); color: var(--secondary); } .path button:hover { background: var(--silver); color: var(--navy); }
.path button.passed { background: var(--teal-tint); color: #0B7F83; } .path button.current { background: var(--blue); color: #fff; }
.btn.on-dark { background: #fff; border-color: var(--silver); color: var(--ink); } .btn.on-dark:hover { background: var(--surface); }
.auth { background: linear-gradient(150deg, #fff 0%, #EEF5FF 55%, #DDF8F8 100%); } .auth-card { border: 1px solid var(--border); }
.account-grid[hidden] { display: none; }
.logo.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 10.5px; display: inline-grid; vertical-align: middle; background: var(--row-alt); color: var(--secondary); }
td .logo.sm { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; margin-right: 6px; }
.modal-card.wide { width: min(940px, 100%); }
.modal-head.with-chip { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h3 { display: flex; align-items: center; gap: 8px; }
.form-h { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; color: var(--navy); margin: 18px 0 9px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.form-h .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.req { color: var(--danger); }
.inline-pair { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; } .inline-pair input { width: 70px; }
.tour-btn { color: var(--blue); border-color: #C9D8EE; } .tour-btn:hover { background: var(--blue-tint); }

/* ---------- Colour-coded progress steps ---------- */
.sc0 { --c: #145EDB; --ct: #E8F0FD; } .sc1 { --c: #0E9AA0; --ct: #E3F8F9; } .sc2 { --c: #7C4DFF; --ct: #F0EBFF; }
.sc3 { --c: #B36B00; --ct: #FFF3D6; } .sc4 { --c: #D6457A; --ct: #FDE9F1; } .sc5 { --c: #2E8B57; --ct: #E6F6EC; }
.chip[class*="sc"] { background: var(--ct); color: var(--c); }
.chip[class*="sc"]::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pill[class*="sc"] { border-color: var(--ct); background: var(--ct); color: var(--c); }
.pill[class*="sc"]:hover { border-color: var(--c); color: var(--c); }
.pill[class*="sc"].active { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 6px 14px -8px var(--c); }
.column.sub { border-top-color: var(--c) !important; background: linear-gradient(180deg, var(--ct), rgba(255,255,255,.85) 130px); }
.column.sub .dot { background: var(--c); } .column.sub .col-title { color: var(--c); } .column.sub.over { border-color: var(--c); }
.zoom-note { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px dashed #C9D8EE; border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; color: var(--secondary); }
.zoom-note span { flex: 1; }

/* ---------- Process tabs ---------- */
.p-sales { --pc: #145EDB; --pt: rgba(20,94,219,.13); } .p-bidding { --pc: #7C4DFF; --pt: rgba(124,77,255,.13); } .p-tender { --pc: #0E9AA0; --pt: rgba(14,154,160,.15); }
.proc-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.proc-tab { display: flex; align-items: center; gap: 12px; text-align: left; background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.proc-tab strong { color: var(--navy); font-size: 14px; display: block; } .proc-tab small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--pt); color: var(--pc); flex: none; transition: background .2s, color .2s; }
.proc-num { text-align: right; } .proc-num strong { font-size: 19px; }
.proc-tab:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.proc-tab.active { border-color: var(--pc); box-shadow: 0 0 0 3px var(--pt), var(--shadow); } .proc-tab.active .proc-ico { background: var(--pc); color: #fff; }
.deal-card.p-sales { border-left-color: #145EDB; } .deal-card.p-bidding { border-left-color: #7C4DFF; } .deal-card.p-tender { border-left-color: #0E9AA0; }
.board { height: calc(100vh - 252px); } .board.zoomed { height: calc(100vh - 306px); } .board.leads { height: calc(100vh - 168px); }
.lead-card { cursor: grab; }

/* ---------- Lists: sorting and paging ---------- */
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; display: inline-flex; gap: 5px; align-items: center; }
.th-sort span { opacity: .35; } .th-sort:hover span, .th-sort.on span { opacity: 1; color: var(--blue); } .th-sort.on { color: var(--navy); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); } .pager .spacer { flex: 1; } .pager select { padding: 3px 6px; }

/* ---------- Uploads, photos ---------- */
.upload-btn { position: relative; overflow: hidden; } .upload-btn input, .upload-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-tile { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 128px; border: 2px dashed var(--silver); border-radius: 12px; background: var(--surface); color: var(--blue); cursor: pointer; text-align: center; padding: 10px; transition: all .18s var(--ease); position: relative; }
.upload-tile:hover, .upload-tile:focus-within { border-color: var(--blue); background: var(--blue-tint); transform: translateY(-1px); } .upload-tile.wide { min-height: 96px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { position: relative; display: grid; gap: 5px; } .photo input { width: 100%; padding: 4px 7px; font-size: 11.5px; }
.photo .del { position: absolute; top: 5px; right: 5px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.thumb { border: 0; padding: 0; background: var(--row-alt); border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: block; width: 100%; transition: transform .2s var(--ease), box-shadow .2s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; } .thumb:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.thumb-row { display: flex; gap: 6px; margin-top: 8px; } .thumb.sm { width: 74px; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(7,24,39,.82); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .18s; }
.lightbox figure { margin: 0; text-align: center; } .lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 12px; box-shadow: var(--shadow-lg); } .lightbox figcaption { color: #fff; margin-top: 10px; }

/* ---------- Site survey form ---------- */
.svc td { padding: 6px 10px; } .svc td:first-child { width: 60px; } .svc input:not([type]) { width: 100%; min-width: 160px; }
.seg.cond label { cursor: pointer; } .seg.cond input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg.cond span { display: block; padding: 4px 10px; border-radius: 8px; font-weight: 600; font-size: 12px; color: var(--secondary); transition: all .15s; }
.seg.cond label:hover span { background: var(--row-alt); }
.seg.cond .c-good input:checked + span { background: var(--success); color: #fff; } .seg.cond .c-fair input:checked + span { background: #D99000; color: #fff; } .seg.cond .c-poor input:checked + span { background: var(--danger); color: #fff; }
.seg.cond input:focus-visible + span { outline: 2px solid var(--blue); }

/* ---------- Quotation editor ---------- */
.q-steps { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.q-steps span { flex: 1; min-width: 96px; text-align: center; font-size: 11.5px; font-weight: 600; padding: 6px 4px; border-radius: 8px; background: var(--row-alt); color: var(--muted); }
.q-steps .done { background: var(--success-bg); color: var(--success); } .q-steps .on { background: var(--blue); color: #fff; }
.q-lines td { padding: 5px 6px; } .q-lines input, .q-lines select { width: 100%; } .q-lines td:first-child { min-width: 240px; } .q-lines td:nth-child(3) { width: 84px; } .q-lines td:nth-child(4) { width: 130px; } .q-lines td:nth-child(2) { width: 112px; }
.q-bottom { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; margin-top: 16px; align-items: start; }
.q-totals { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 9px; }
.q-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .q-totals input { width: 64px; padding: 3px 6px; }
.q-totals .grand { border-top: 2px solid var(--navy); padding-top: 10px; font-size: 16px; color: var(--navy); }

/* ---------- Printable documents ---------- */
.sheet-wrap { width: min(900px, 100%); background: #EEF1F5; }
.sheet-bar { position: sticky; top: 0; display: flex; gap: 8px; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); z-index: 1; }
.sheet { background: #fff; margin: 18px auto; padding: 36px 40px; width: min(794px, calc(100% - 36px)); box-shadow: var(--shadow-md); position: relative; font-size: 12.5px; color: #1F2433; overflow: hidden; }
.sheet h1 { font-size: 24px; color: var(--navy); letter-spacing: .5px; }
.sheet h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--navy); margin: 20px 0 8px; border-bottom: 2px solid var(--teal); padding-bottom: 4px; }
.lh { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 14px; margin-bottom: 18px; }
.lh .brand { padding: 0; } .lh .brand-name { color: var(--navy); font-size: 18px; } .lh-sub { color: var(--muted); font-size: 11.5px; } .lh-right { text-align: right; font-size: 11.5px; color: var(--secondary); }
.doc-title { display: flex; justify-content: space-between; align-items: flex-start; } .doc-sub { color: var(--muted); margin: 2px 0 14px; }
.kv { width: auto; } .kv th { background: none; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); padding: 3px 14px 3px 0; border: 0; } .kv td { border: 0; padding: 3px 0; }
.doc-to { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 18px 0; padding: 12px 14px; background: var(--surface); border-radius: 10px; }
.lbl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-top: 4px; }
.lines th { background: var(--navy); color: #fff; border: 0; border-radius: 0 !important; } .lines td { border-bottom: 1px solid var(--border); }
.totals { width: auto; margin: 12px 0 0 auto; } .totals th { background: none; border: 0; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--secondary); text-align: right; padding: 4px 18px; }
.totals td { border: 0; text-align: right; padding: 4px 0; font-weight: 600; } .totals .grand th, .totals .grand td { font-size: 15px; color: var(--navy); border-top: 2px solid var(--navy); padding-top: 8px; }
.terms { white-space: pre-line; color: var(--secondary); }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 36px; font-size: 11.5px; color: var(--muted); } .sign .line { border-bottom: 1px solid var(--ink); height: 46px; margin-bottom: 6px; }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 50px; font-weight: 800; color: rgba(180,35,24,.10); transform: rotate(-24deg); pointer-events: none; text-align: center; }
.doc-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .doc-photos figure { margin: 0; } .doc-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; } .doc-photos figcaption { font-size: 11px; color: var(--muted); }
@media print {
  html, body { height: auto; background: #fff; }
  body:has(.sheet-wrap) > *:not(#modal) { display: none !important; }
  body:has(.sheet-wrap) #modal { position: static; display: block !important; background: none; padding: 0; backdrop-filter: none; animation: none; }
  .sheet-bar { display: none; }
  .sheet-wrap { width: auto; max-height: none; overflow: visible; box-shadow: none; background: none; border-radius: 0; animation: none; }
  .sheet { box-shadow: none; margin: 0; width: auto; padding: 0; overflow: visible; }
  .lines th, .lh, .doc-to, .watermark, .sheet h2 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}

/* ---------- Guided tour ---------- */
#tour { position: fixed; inset: 0; z-index: 90; }
#tourRing { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(7,24,39,.5), 0 0 0 3px var(--teal); transition: all .5s var(--ease); pointer-events: none; }
#tourCursor { position: fixed; left: 0; top: 0; transition: transform .9s var(--ease); pointer-events: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); z-index: 2; }
#tourCursor span { position: absolute; left: -8px; top: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--teal); opacity: 0; }
#tourCursor.click span { animation: tourClick .7s .9s ease-out; }
@keyframes tourClick { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(2.2); } }
#tourCard { position: fixed; width: min(390px, calc(100vw - 24px)); background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-lg); transition: top .45s var(--ease), left .45s var(--ease); z-index: 3; }
.tour-step { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: #0E9AA0; font-weight: 700; }
#tourCard h3 { color: var(--navy); font-size: 16px; margin: 2px 0 6px; } #tourCard p { color: var(--secondary); font-size: 13px; }
.tour-progress { height: 4px; background: var(--row-alt); border-radius: 9px; margin: 12px 0; overflow: hidden; } .tour-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); transition: width .4s; }
.tour-btns { display: flex; gap: 6px; align-items: center; }

@media (max-width: 900px) {
  .proc-tabs, .q-bottom, .doc-to, .sign { grid-template-columns: 1fr; } .proc-tab small { white-space: normal; }
  .board { height: calc(100vh - 420px); min-height: 420px; } .tour-btn span { display: none; }
}
body.touring .board, body.touring .view { scroll-behavior: auto; }

/* ---------- Settings ---------- */
.set-tabs { display: flex; gap: 6px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 5px; margin-bottom: 14px; box-shadow: var(--shadow); }
.set-tabs button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 8px 13px; border-radius: 10px; font-weight: 600; color: var(--secondary); transition: background .16s, color .16s; }
.set-tabs button:hover { background: var(--row-alt); color: var(--navy); } .set-tabs button.active { background: var(--navy); color: #fff; }
.set-intro { background: #fff; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; padding: 10px 14px; margin-bottom: 14px; color: var(--secondary); box-shadow: var(--shadow); max-width: 980px; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; } .m-grid .panel { margin: 0; }
.m-list, .c-list, .g-list { display: grid; gap: 6px; }
.m-row, .c-row { display: flex; align-items: center; gap: 7px; } .m-row input { flex: 1; min-width: 0; }
.c-row input[name=day] { width: 64px; } .c-row input[name=note] { flex: 1; min-width: 0; }
.g-row, .g-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) 24px; gap: 7px; align-items: center; } .g-head { margin-bottom: 4px; }
.wf-list { display: grid; gap: 10px; counter-reset: wf; }
.wf-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 150px; gap: 14px; align-items: start; border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); counter-increment: wf; transition: box-shadow .2s, border-color .2s; }
.wf-row:hover, .wf-row:focus-within { border-color: #C9D8EE; box-shadow: var(--shadow-md); background: #fff; }
.wf-order { display: grid; justify-items: center; gap: 4px; } .wf-no::before { content: counter(wf); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; }
.wf-side { display: grid; gap: 8px; justify-items: end; }
.wf-fixed { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--silver); border-radius: 10px; color: var(--secondary); flex-wrap: wrap; }
.rule-list { display: grid; gap: 12px; } .rule-list > div { display: flex; gap: 10px; align-items: flex-start; } .rule-list .ic { color: var(--blue); margin-top: 1px; }
.q-rule { font-size: 12px; border-radius: 8px; padding: 7px 9px; } .q-rule.ok { background: var(--success-bg); color: var(--success); } .q-rule.warn { background: var(--warning-bg); color: var(--warning); } .q-rule.bad { background: var(--danger-bg); color: var(--danger); }

/* ---------- Target tables ---------- */
.t-wrap { overflow-x: auto; }
.t-table { border-collapse: separate; border-spacing: 3px; min-width: 460px; }
.t-table th, .t-table td { border: 0; border-radius: 6px !important; text-align: center; padding: 8px 10px; }
.t-table thead th { background: var(--navy); color: #fff; font-size: 11px; letter-spacing: 1.2px; }
.t-table .t-title { letter-spacing: 3px; font-size: 12px; } .t-table .t-head { background: #fff; color: var(--navy); border: 1px solid var(--border); } .t-head strong { display: block; font-size: 18px; letter-spacing: 0; }
.t-table .t-hit { background: #C8F5F6; color: var(--navy); font-weight: 700; } .t-table thead .t-hit { background: var(--teal); color: var(--navy); }
.t-table tbody th { background: var(--navy); color: #fff; text-align: right; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.t-table td { background: var(--surface); } .t-num { font-size: 16px; font-weight: 700; color: var(--navy); }
.t-actual { font-size: 10.5px; color: var(--muted); margin-top: 3px; } .t-actual.hit { color: var(--success); font-weight: 700; }
.t-bar { height: 4px; background: var(--silver); border-radius: 9px; overflow: hidden; margin-top: 3px; } .t-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--blue), var(--teal)); border-radius: 9px; } .t-actual.hit .t-bar i { background: var(--success); }

/* ---------- Outreach plan ---------- */
.cad-strip { display: flex; align-items: flex-start; overflow-x: auto; padding: 6px 2px 10px; }
.cad-step { display: grid; justify-items: center; gap: 2px; min-width: 96px; text-align: center; font-size: 12px; } .cad-step small { color: var(--muted); font-size: 10.5px; max-width: 110px; }
.cad-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ct); color: var(--c); border: 2px solid var(--c); margin-bottom: 3px; transition: transform .2s var(--ease); } .cad-step:hover .cad-ico { transform: scale(1.12); }
.cad-line { flex: 1; min-width: 18px; height: 2px; background: var(--silver); margin-top: 20px; }
.outreach { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--border); flex-wrap: wrap; } .outreach.compact { border: 0; margin: 0; padding: 0; display: inline-flex; flex-wrap: nowrap; }
.o-bar { flex: 1; min-width: 46px; height: 6px; border-radius: 9px; background: var(--row-alt); overflow: hidden; } .o-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--teal)); border-radius: 9px; transition: width .4s var(--ease); }
.outreach .act { padding: 3px 6px; } .outreach-start { margin-top: 8px; width: 100%; } td .outreach-start { width: auto; margin: 0; }

/* ---------- Customer journey ---------- */
.journey { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr); gap: 20px; align-items: center; }
.j-phases { display: flex; align-items: stretch; gap: 6px; }
.j-card { flex: 1; min-width: 0; border: 1px solid var(--border); border-top: 3px solid var(--teal); border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #fff, var(--surface)); transition: transform .2s var(--ease), box-shadow .2s; }
.j-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.j-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--navy); color: var(--teal); margin-bottom: 8px; }
.j-n { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--navy); } .j-v { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.2; } .j-h { font-size: 11.5px; font-weight: 600; color: #0B7F83; margin-top: 4px; }
.j-arrow { display: grid; place-items: center; color: var(--teal); flex: none; }
.j-funnel { display: grid; justify-items: center; gap: 2px; }
.j-tier { width: var(--w); min-width: 110px; background: var(--c); color: #fff; padding: 9px 8px; text-align: center; clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%); display: grid; line-height: 1.2; } .j-tier span { font-size: 17px; font-weight: 700; }
.j-conv { font-size: 10.5px; color: var(--muted); }
.view-enter .j-card, .view-enter .j-tier, .view-enter .cad-step, .view-enter .m-card { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + .05s); }
.view-enter .t-bar i { animation: grow .7s var(--ease) both; }
@media (max-width: 1100px) { .journey { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .j-phases { flex-direction: column; } .j-arrow { transform: rotate(90deg); } .wf-row { grid-template-columns: 1fr; } .wf-order { grid-auto-flow: column; justify-content: start; } .wf-side { justify-items: start; } .g-row, .g-head { grid-template-columns: 1fr; } }

/* ---------- Service catalogue and service picker ---------- */
.svc-pick { display: grid; gap: 8px; }
.svc-line { border: 1px solid var(--border); border-left: 3px solid var(--silver); border-radius: 12px; padding: 9px 11px; background: var(--surface); transition: border-color .18s, background .18s, box-shadow .18s; }
.svc-line.on { border-color: var(--ct); border-left-color: var(--c); background: #fff; box-shadow: var(--shadow); }
.svc-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0 0 7px; text-align: left; cursor: pointer; color: var(--ink); font-size: 13px; }
.svc-head input { position: absolute; opacity: 0; width: 1px; height: 1px; } .svc-head .muted { margin-left: auto; }
.svc-tick { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--silver); color: transparent; flex: none; transition: all .16s var(--ease); }
.svc-line.on .svc-tick { background: var(--c); border-color: var(--c); color: #fff; } .svc-head:focus-within .svc-tick, .svc-head:focus-visible .svc-tick { outline: 2px solid var(--blue); outline-offset: 2px; }
.svc-line .pill.xs { padding: 3px 9px; } .svc-field .svc-pick { max-height: 300px; overflow: auto; padding-right: 4px; }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } .cat-card { border-top: 3px solid var(--c); }
.cat-card .panel-head input { flex: 1; min-width: 0; font-weight: 700; color: var(--navy); }
.bar-fill[class*="sc"] { background: var(--c); }
.act.svc-edit { padding: 2px 7px; font-size: 11px; }

/* ---------- Flyers ---------- */
.flyer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; } .flyer-grid .panel { margin: 0; overflow: hidden; }
.flyer-card { transition: transform .2s var(--ease), box-shadow .2s; } .flyer-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.flyer-art { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; width: 100%; min-height: 150px; border: 0; padding: 14px; text-align: left; color: #fff; background: linear-gradient(135deg, var(--navy), var(--c)); overflow: hidden; }
.flyer-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; } .flyer-art strong { position: relative; font-size: 19px; line-height: 1.2; }
.flyer-tag { position: relative; align-self: flex-start; background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.flyer-body { padding: 12px 14px 14px; } .flyer-body h3 { font-size: 13.5px; color: var(--navy); } .flyer-body ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; color: var(--secondary); font-size: 12.5px; }
.flyer-body li { display: flex; gap: 6px; align-items: flex-start; } .flyer-body li .ic { color: var(--c); margin-top: 2px; }
.flyer-bar { flex-wrap: wrap; } .btn.wa { background: #1FAF54; border-color: #1FAF54; color: #fff; } .btn.wa:hover { background: #17994A; text-decoration: none; } a.btn:hover { text-decoration: none; }
.flyer-log { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 16px; background: #fff; border-bottom: 1px solid var(--border); } .flyer-log select { flex: 1; min-width: 160px; }
.flyer-sheet { padding: 0; } .flyer-doc { color: var(--ink); }
.fd-top { padding: 22px 34px; } .fd-top .brand { padding: 0; } .fd-top .brand-name { color: var(--navy); font-size: 20px; }
.fd-img { display: block; width: 100%; max-height: 260px; object-fit: cover; }
.fd-hero { background: linear-gradient(120deg, var(--navy), var(--c)); color: #fff; padding: 30px 34px; } .fd-hero h1 { color: #fff; font-size: 30px; line-height: 1.15; letter-spacing: 0; } .fd-hero p { margin-top: 10px; font-size: 14px; color: #E6EEFB; }
.fd-points { list-style: none; margin: 0; padding: 24px 34px 8px; display: grid; gap: 11px; font-size: 14px; } .fd-points li { display: flex; gap: 11px; align-items: flex-start; }
.fd-points li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ct); color: var(--c); flex: none; }
.fd-subs { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 34px 22px; } .fd-subs span { border: 1px solid var(--c); color: var(--c); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.fd-cta { background: var(--surface); border-top: 3px solid var(--c); padding: 20px 34px 24px; } .fd-cta strong { display: block; font-size: 16px; color: var(--navy); margin-bottom: 6px; } .fd-cta div { color: var(--secondary); font-size: 12.5px; }
@media print { .flyer-log { display: none; } .fd-hero, .fd-cta, .fd-points li span { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.view-enter .flyer-card { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* =====================================================================================
   Phone and small tablet layout
   ===================================================================================== */
.tabbar { display: none; }
@media (max-width: 900px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 14px; }
  .app, .main { height: auto; min-height: 100dvh; } .main { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .view { overflow: visible; padding: 12px; } html, body { height: auto; }
  input, select, textarea { font-size: 16px; }                      /* stops phones zooming in on focus */
  .btn, .seg button, .pill { min-height: 38px; } .btn.sm, .pill.xs, .act { min-height: 32px; } .icon-btn { width: 40px; height: 40px; } .icon-btn.sm { width: 32px; height: 32px; }

  /* top bar: title + the two actions that matter */
  .topbar { position: sticky; top: 0; padding: 8px 12px; gap: 8px; z-index: 20; } .topbar h1 { font-size: 16px; }
  .topbar p, #search, .tour-btn span, .jump span, .jump kbd { display: none; } .jump, .tour-btn { padding: 0; width: 40px; height: 40px; justify-content: center; }
  .topbar-actions { gap: 6px; } .topbar .btn.primary { padding: 0 12px; }

  /* bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 24; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px -14px rgba(31,36,51,.4); }
  .tabbar button { display: grid; justify-items: center; gap: 2px; border: 0; background: none; padding: 8px 2px 7px; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; }
  .tabbar button.active { color: var(--blue); } .tabbar button.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 4px 4px; background: var(--blue); }
  .tabbar button:active { transform: scale(.94); }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); left: 12px; right: 12px; transform: none; } .toast { max-width: none; width: 100%; }
  .sidebar { width: min(300px, 86vw); padding-bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; } body.nav-open .scrim { z-index: 39; }

  /* content */
  .hero { padding: 16px; border-radius: 14px; } .hero h2 { font-size: 18px; } .hero-actions .btn { flex: 1; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 11px 12px; } .kpi .value { font-size: 19px; }
  .grid-2, .admin-grid, .journey { grid-template-columns: 1fr; gap: 12px; } .panel { margin-bottom: 12px; }
  .toolbar { gap: 8px; } .toolbar > select, .toolbar .loc { flex: 1 1 100%; } .toolbar .loc select { flex: 1; min-width: 0; } .toolbar .spacer { display: none; } .toolbar .seg { flex: 1; } .toolbar .seg button { flex: 1; justify-content: center; }
  .toolbar > .btn { flex: 1; } .stat-pill { font-size: 12px; }
  .panel > table, .panel > .panel-body > table { display: block; overflow-x: auto; white-space: nowrap; }
  .matrix-wrap td, .matrix-wrap th { white-space: nowrap; }
  .set-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .set-tabs button { white-space: nowrap; flex: none; }
  .proc-tabs { display: flex; overflow-x: auto; gap: 10px; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; } .proc-tab { flex: 0 0 78%; scroll-snap-align: start; }
  .board, .board.zoomed, .board.leads { height: auto; min-height: 0; max-height: none; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 12px; align-items: flex-start; }
  .column { flex: 0 0 86%; scroll-snap-align: center; max-height: 68vh; } .deal-card { cursor: pointer; } .deal-card .grip { display: none; }
  .account-grid, .people-grid, .flyer-grid, .m-grid, .cat-grid, .photo-grid { grid-template-columns: 1fr; } .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .fields, .fields.three, .q-bottom, .doc-to, .sign { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 92px 1fr auto; font-size: 12px; }
  .pager { flex-wrap: wrap; } .zoom-note { flex-wrap: wrap; }

  /* panels that slide over: full width, sheet from the bottom */
  .drawer-panel { width: 100%; } .drawer-head { padding: 14px 14px 12px; } .drawer-section { padding: 13px 14px; }
  .path { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .path button { flex: 0 0 auto; padding-inline: 14px 12px; white-space: nowrap; }
  .head-actions .btn { flex: 1 1 46%; } .list-row { flex-wrap: wrap; } .inline-form > * { flex: 1 1 100%; } .team-row .member { width: 100%; border-radius: 12px; }
  .modal { padding: 0; place-items: end stretch; } .palette { padding: 8px; }
  .modal-card, .modal-card.wide, .sheet-wrap { width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .modal-head { padding: 16px 16px 0; } .modal-body { padding: 12px 16px; }
  .modal-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); } .modal-foot .btn { flex: 1 1 46%; white-space: normal; }
  .pop { animation-name: sheetUp; }
  .sheet { margin: 0; width: 100%; padding: 20px 16px; box-shadow: none; } .sheet.flyer-sheet { padding: 0; } .sheet-bar .btn { flex: 1 1 30%; } .sheet-bar strong { flex: 1 1 100%; }
  .fd-top, .fd-hero, .fd-points, .fd-subs, .fd-cta { padding-inline: 18px; } .fd-hero h1 { font-size: 24px; }
  .lh { flex-direction: column; } .lh-right { text-align: left; } .doc-title { flex-direction: column; gap: 8px; } .doc-photos { grid-template-columns: repeat(2, 1fr); }
  .q-steps span { min-width: 30%; } .q-lines td:first-child { min-width: 200px; }
  .svc-field .svc-pick { max-height: none; }
  .t-table { min-width: 430px; } .cad-strip { padding-bottom: 14px; }
  #tourCard { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: calc(70px + env(safe-area-inset-bottom)); }
  .auth-card { padding: 22px 18px; }
}
@media (max-width: 420px) { .grid-4 { gap: 8px; } .kpi .label { font-size: 10px; } .tabbar button { font-size: 10px; } .topbar .btn.primary { font-size: 13px; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.nd-short { display: none; }
@media (max-width: 900px) { .nd-long { display: none; } .nd-short { display: inline; } }
@media (max-width: 900px) {
  .grid-2, .admin-grid, .journey, .m-grid, .cat-grid, .account-grid, .people-grid, .flyer-grid { grid-template-columns: minmax(0, 1fr); }
  .panel, .grid-2 > *, .admin-grid > * { min-width: 0; }
  .c-row { flex-wrap: wrap; } .c-row input[name=note] { flex: 1 1 100%; order: 3; } .c-row select { flex: 1; min-width: 0; }
  .m-row input, .cat-card .panel-head input { min-width: 0; width: 100%; }
}
@media (max-width: 900px) {
  .toolbar > select { flex: 1 1 45%; min-width: 0; }
  .drawer .list-row > select { flex: 1 1 100%; order: 5; }
}
