/* Brand font: Calibri is the closest visual match to the English logo lettering.
   Use local Calibri when available, otherwise the bundled metric-compatible Carlito. */
@font-face { font-family: 'Carlito'; font-style: normal; font-weight: 400; font-display: swap; src: local('Calibri'), url('../assets/fonts/Carlito-Regular-latin.woff2') format('woff2'), url('../assets/fonts/Carlito-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Carlito'; font-style: normal; font-weight: 700; font-display: swap; src: local('Calibri Bold'), local('Calibri-Bold'), url('../assets/fonts/Carlito-Bold-latin.woff2') format('woff2'), url('../assets/fonts/Carlito-Bold.ttf') format('truetype'); }
/* Qanawat Insight - styles */
:root {
  /* sampled from the Qanawat logo */
  --brand: #5B292E;
  --brand-dark: #41191D;
  --brand-light: #7E3A41;
  --brand-tint: #F9F1F2;
  --ai: #FFF7D6; --ai-bd: #E9C64A; --ai-text: #7A5A00;
  --bottom-nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ok: #047857; --ok-bg: #ECFDF5; --ok-bd: #A7F3D0;
  --warn: #B45309; --warn-bg: #FFFBEB; --warn-bd: #FDE68A;
  --bad: #B91C1C; --bad-bg: #FEF2F2; --bad-bd: #FECACA;
  --info: #0369A1; --info-bg: #F0F9FF; --info-bd: #BAE6FD;
  --bg: #F6F5F3; --card: #FFFFFF; --line: #E8E4E2; --line-strong: #CEC6C4;
  --text: #302A2C; --muted: #73696C; --subtle: #8B8084;
  --radius: 16px;
  --shadow: 0 3px 14px rgba(60, 35, 40, .035);
  --font: 'Carlito', Calibri, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.45; font-feature-settings: 'liga' 1, 'kern' 1; }
button, input, select, textarea { font-family: var(--font); }
a { color: var(--brand-light); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(91, 41, 46, .24); outline-offset: 2px; }
.ui-icon { display: block; width: 1em; height: 1em; flex: none; }
code, .mono { font-family: var(--mono); font-size: 12px; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.text-bad { color: var(--bad); }
.hidden { display: none !important; }
[hidden] { display: none !important; }
img { max-width: 100%; }
input, select, textarea { min-width: 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; align-self: start; min-width: 0; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { flex: none; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.brand img { height: auto; width: 100%; max-width: 200px; display: block; }
.drawer-user { display: none; }
#drawer-logout { display: none; }
.sidebar-foot { flex: none; display: flex; flex-direction: column; gap: 8px; }
.topbar-mark { display: none; }
.bottom-nav { display: none; }
.drawer-backdrop { display: none; }
.offline-chip { display: none; }
.is-offline .offline-chip { display: inline-flex; background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-bd); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.sync-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.sync-chip.ok { color: var(--ok); border-color: var(--ok-bd); background: var(--ok-bg); }
.sync-chip.warn { color: var(--warn); border-color: var(--warn-bd); background: var(--warn-bg); }
.sync-chip.busy { color: var(--info); border-color: var(--info-bd); background: var(--info-bg); }
.text-ok { color: var(--ok); }
body.no-scroll { overflow: hidden; }
#nav { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 12px; border-radius: 9px; color: #564A4E; font-weight: 600; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item:hover { background: #FAF8F7; color: var(--brand); text-decoration: none; transform: translateX(2px); }
.nav-item.active { background: var(--brand-tint); color: var(--brand); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; color: currentColor; }
.nav-icon .ui-icon { width: 19px; height: 19px; }
.nav-item .badge { margin-left: auto; }
.sidebar-foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 13px 24px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 17px; font-weight: 700; }
.topbar-right { flex: none; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.user-meta { max-width: 150px; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--muted); }
.bell { position: relative; text-decoration: none !important; }
.bell .badge { position: absolute; top: -4px; right: -6px; }
.badge { background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
main#main { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-width: 1500px; width: 100%; }
/* "Get alerts on this phone / computer" banner */
.push-prompt { display: flex; align-items: center; gap: 12px; margin: 16px 24px 0; padding: 12px 14px; max-width: 1452px; background: var(--brand-tint); border: 1px solid var(--line-strong); border-radius: 12px; }
.push-prompt > div:not(.push-prompt-actions) { flex: 1; min-width: 0; }
.push-prompt strong { display: block; color: var(--brand); }
.push-prompt small { display: block; color: var(--muted); line-height: 1.35; }
.push-prompt-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 18px; flex: none; }
.push-prompt-actions { display: flex; gap: 6px; flex: none; }
.push-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.push-status.off .push-prompt-ico { background: var(--muted); }
@media (max-width: 820px) {
  .push-prompt { margin: 12px 12px 0; flex-wrap: wrap; }
  .push-prompt-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- Page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head p { margin-top: 2px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Flexible children must be allowed to shrink inside cards and dialogs. */
main#main > *, .grid-2 > *, .g-grid > *, .form-grid > *, .field-grid > *, .actions > *, .card-head > *, .page-head > * { min-width: 0; }
.page-head > div:first-child { flex: 1 1 280px; }
.page-head > .actions { flex: 0 1 auto; }
.form label, .field, .alert, .setup-list li > div { overflow-wrap: anywhere; min-width: 0; }
select.input { appearance: none; -webkit-appearance: none; line-height: 1.4; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2373696C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
select.input[multiple] { background-image: none; padding-right: 12px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); flex: none; }
summary:focus-visible { outline: 3px solid #A56C76; outline-offset: 3px; }
body:has(#modal-root .modal) { overflow: hidden; }
.modal { max-height: calc(100dvh - 32px); }
.modal-head { flex: none; gap: 12px; }
.modal-head h3 { min-width: 0; overflow-wrap: anywhere; }
.modal-head .icon-btn { flex: none; }
.modal:focus { outline: none; }
.push-status-copy { flex: 1 1 200px; min-width: 0; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kpi-value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-ok { border-left-color: var(--ok); }
.kpi-warn { border-left-color: var(--warn); }
.kpi-bad { border-left-color: var(--bad); }
.kpi-bad .kpi-value { color: var(--bad); }
.kpi-accent { border-left-color: var(--brand); }
.kpi-accent .kpi-value { color: var(--brand); }

.progress { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.progress-ok { background: var(--ok); } .progress-info { background: var(--info); } .progress-warn { background: #D97706; } .progress-bad { background: var(--bad); }

.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.summary-cell { flex: 1 1 90px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.summary-cell span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.summary-cell strong { font-size: 20px; font-weight: 700; }
.summary-cell.total { background: var(--brand); border-color: var(--brand); }
.summary-cell.total span, .summary-cell.total strong { color: #fff; }
.summary-cell small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.summary-cell.total small { color: rgba(255, 255, 255, .85); }
.summary-cell.bad strong { color: var(--bad); } .summary-cell.warn strong { color: var(--warn); }

/* charts */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 200px) 1fr 50px; gap: 10px; align-items: center; font-size: 12px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg); height: 14px; border-radius: 4px; overflow: hidden; }
.bar-fill { background: var(--brand-light); height: 100%; border-radius: 4px; }
.bar-val { text-align: right; font-weight: 700; }
.col-chart { overflow-x: auto; padding-bottom: 28px; display: flex; align-items: flex-end; gap: 6px; height: 208px; padding-top: 18px; padding-right: 14px; padding-left: 6px; }
.col { flex: 1 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.col-bar { width: 100%; max-width: 32px; background: var(--brand-light); border-radius: 4px 4px 0 0; min-height: 2px; }
.col-val { font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.col-label { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; transform: rotate(-35deg); transform-origin: center; height: 22px; }

/* ---------- Alerts / pills ---------- */
.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid; font-size: 13px; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn); }
.alert-bad { background: var(--bad-bg); border-color: var(--bad-bd); color: var(--bad); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bd); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bd); }
.pill-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bd); }
.pill-info { background: var(--info-bg); color: var(--info); border-color: var(--info-bd); }
.pill-muted { background: var(--bg); color: var(--muted); border-color: var(--line); }

/* ---------- Buttons / inputs ---------- */
.btn { max-width: 100%; white-space: normal; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: var(--bad); border-color: var(--bad-bd); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: none; background: transparent; cursor: pointer; font-size: 16px; padding: 0; border-radius: 8px; color: var(--text); transition: background .16s ease, color .16s ease; }
.icon-btn .ui-icon { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--bg); color: var(--brand); }
.input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 13px; background: #fff; color: var(--text); }
.input:focus { outline: 2px solid rgba(107, 29, 47, .25); border-color: var(--brand-light); }
textarea.input { resize: vertical; }
.num-input { width: 70px; text-align: right; padding: 5px 6px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #564A4E; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.form-grid.cols-7 { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.form-section { font-size: 13px; font-weight: 700; color: var(--brand); margin-top: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.form-error { color: var(--bad); font-size: 13px; }
.form-error ul { padding-left: 18px; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; }
.check-row { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.linked-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 10px; background: var(--brand-tint); border: 1px solid #F1D5DB; border-radius: 8px; padding: 12px; }
.linked-box span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.dropzone { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line-strong); border-radius: 10px; padding: 24px; cursor: pointer; font-weight: 600; color: var(--muted); }
.dropzone:hover { border-color: var(--brand-light); color: var(--brand); }

.shot-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.shot { position: relative; width: 120px; height: 160px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .icon-btn { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, .9); font-size: 12px; }

/* ---------- Tables ---------- */
.table-toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.table-toolbar .search { max-width: 280px; }
.toolbar-right { min-width: 0; flex-wrap: wrap; display: flex; gap: 10px; align-items: center; }
.table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: #FAF8F7; white-space: nowrap; cursor: pointer; user-select: none; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table.compact td, .data-table.compact th { padding: 6px 8px; }
.data-table tr.clickable { cursor: pointer; }
.data-table tbody tr:hover { background: #FCF9F9; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .empty { text-align: center; color: var(--muted); padding: 24px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.pager { flex-wrap: wrap; display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card .filter-bar { border: none; padding: 0 0 12px; }
.filter-bar label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); min-width: 140px; flex: 1 1 140px; max-width: 220px; }
.filter-bar label.check { flex-direction: row; align-items: center; min-width: auto; flex: 0 0 auto; }

/* ---------- Details ---------- */
.field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px 16px; margin-bottom: 8px; }
.field span { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.field strong { font-weight: 600; word-break: break-word; }
.timeline { list-style: none; display: flex; flex-direction: column; gap: 10px; border-left: 2px solid var(--line); padding-left: 14px; }
.timeline li { position: relative; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-light); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: none; background: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 18px; }
.step-heading { display: flex; align-items: center; gap: 12px; }
.step-heading h3 { min-width: 0; font-size: 18px; line-height: 1.4; }
.step-no { flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.step .form-grid > label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: #564A4E; }
.step > .btn { align-self: flex-start; }
.dropzone:has(.dropzone-input) { position: relative; min-height: 116px; text-align: center; }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:focus-within { outline: 3px solid #A56C76; outline-offset: 3px; border-color: var(--brand); }
.notif-list { list-style: none; }
.notif-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.notif-list li a { flex: 1; min-width: 0; text-align: left; }
.notif-list li.unread a { font-weight: 700; }
.notif-list li.unread::before { content: '●'; color: var(--brand); margin-right: -4px; }

/* ---------- Modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { min-width: 0; background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal-wide { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { min-height: 0; min-width: 0; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
#toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; transform: translateY(10px); transition: all .25s; max-width: 360px; }
.toast.show { opacity: 1; transform: none; }
.toast-ok { background: var(--ok); } .toast-bad { background: var(--bad); }

/* ---------- Large controls and demo layouts ---------- */
.demo-box summary { cursor: pointer; list-style: none; padding: 4px 0; }
.demo-box[open] summary { margin-bottom: 8px; }
.input-lg { padding: 12px 14px; font-size: 16px; }
.btn-lg { padding: 12px 18px; font-size: 15px; }
.demo-box { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.demo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.demo-grid .btn { flex-direction: column; gap: 0; line-height: 1.25; white-space: normal; }
.demo-grid small { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 10px; }

/* ---------- Agent home ---------- */
.hero-cta { display: none; }
.today-strip { display: none; }

/* ---------- New sale wizard ---------- */
.wiz { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.wiz-head { display: flex; flex-direction: column; gap: 12px; }
.wiz-title { display: flex; justify-content: space-between; align-items: center; }
.wiz-title h2 { font-size: 22px; font-weight: 700; }
.stepper { list-style: none; display: flex; gap: 4px; counter-reset: s; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--subtle); position: relative; min-width: 0; }
.stepper li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.now::before { background: var(--brand-light); }
.stepper span { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line-strong); font-weight: 700; font-size: 12px; color: var(--muted); }
.stepper li.done span { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }
.stepper li.done { cursor: pointer; color: var(--brand-light); }
.stepper li.now span { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(91, 41, 46, .15); }
.stepper li.now { color: var(--brand); font-weight: 700; }
.stepper em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wiz-body { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.wiz-q { font-size: 15px; font-weight: 700; margin-top: 4px; }
.wiz-foot { position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(241, 245, 249, 0)); }
.wiz-foot .btn { min-height: 46px; padding: 10px 22px; font-size: 15px; }
.wiz-foot .btn-primary { flex: 1; max-width: 320px; margin-left: auto; }
.wiz-ctx { max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-errors:empty { display: none; }
.wiz-errors { background: var(--bad-bg); border: 1px solid var(--bad-bd); border-radius: 10px; padding: 10px 14px; }
.linked-mini { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); font-weight: 600; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: var(--text); min-height: 104px; transition: border-color .15s, box-shadow .15s, transform .15s, background .15s; }
.tile:hover { border-color: var(--brand-light); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(15, 23, 42, .08); }
.tile.sel { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px rgba(91, 41, 46, .12); }
.tile-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 5px; color: var(--brand); background: var(--brand-tint); border-radius: 9px; }
.tile-icon .ui-icon { width: 20px; height: 20px; }
.tile.sel .tile-icon { color: #fff; background: var(--brand); }
.tile strong { font-size: 14px; }
.tile small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; }
.choice input { accent-color: var(--brand); width: 18px; height: 18px; }
.choice.sel { border-color: var(--brand); background: var(--brand-tint); }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: 10px; border-radius: 8px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.seg.seg-row { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; }
.seg.seg-row button { padding: 8px 14px; white-space: nowrap; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px dashed var(--warn-bd); background: var(--warn-bg); border-radius: 10px; font-size: 13px; cursor: pointer; }
.consent.ok { border-style: solid; border-color: var(--ok-bd); background: var(--ok-bg); }
.consent input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); margin-top: 1px; }
.scan-cta { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.scan-cta:has(> :only-child) { grid-template-columns: 1fr; }
.scan-btn { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border-radius: 12px; border: none; background: var(--brand); color: #fff; font: inherit; cursor: pointer; box-shadow: 0 6px 16px rgba(91, 41, 46, .25); width: 100%; }
.scan-btn:hover { background: var(--brand-dark); }
.scan-btn:disabled { background: var(--line-strong); box-shadow: none; cursor: not-allowed; }
.scan-btn strong { display: block; font-size: 15px; }
.scan-btn small { display: block; opacity: .85; font-size: 12px; }
.scan-ico { font-size: 26px; line-height: 1; }
.scan-btn-2 { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); box-shadow: none; }
.scan-btn-2:hover { background: var(--brand-tint); }
.scan-btn-2:disabled { background: #fff; color: var(--subtle); border-color: var(--line); }
.scan-result { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--ai-bd); background: var(--ai); border-radius: 12px; }
.scan-result.demo { border-style: dashed; }
.scan-thumbs { display: flex; gap: 6px; flex: none; }
.scan-thumbs figure { width: 92px; }
.scan-thumbs img { width: 92px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.scan-thumbs figcaption { font-size: 10px; text-align: center; color: var(--muted); text-transform: capitalize; }
.scan-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.scan-issues { padding-left: 16px; color: var(--warn); font-size: 12px; }
.ai-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--ai); border: 1px solid var(--ai-bd); vertical-align: -1px; }

.wf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wf-grid.one { grid-template-columns: 1fr; }
.wf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wf-label { font-size: 12px; font-weight: 700; color: #564A4E; }
.wf-row { display: flex; gap: 6px; }
.wf-row .input { flex: 1; min-width: 0; }
.wf .input { padding: 11px 12px; font-size: 15px; border-radius: 10px; }
.wf.ai .input { background: var(--ai); border-color: var(--ai-bd); }
.ai-tag { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ai-text); background: var(--ai); border: 1px solid var(--ai-bd); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.ai-text { background: var(--ai); border-radius: 4px; padding: 0 4px; }
.wf-hint { font-size: 11.5px; color: var(--muted); }
.req { color: var(--bad); }
.btn-scan { border-color: var(--brand); color: var(--brand); border-radius: 10px; padding: 0 14px; }
.shot-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-style: dashed; color: var(--muted); font-size: 24px; cursor: pointer; }
.shot-add span { font-size: 12px; font-weight: 600; }
.shot-wide { width: 200px; height: 130px; }

.rv { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rv header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #FAF8F7; border-bottom: 1px solid var(--line); }
.rv h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.rv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rv-row:last-child { border-bottom: none; }
.rv-row span { color: var(--muted); }
.rv-row strong { text-align: right; word-break: break-word; font-weight: 600; }

.done-card { align-items: center; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px 20px; box-shadow: var(--shadow); max-width: 520px; }
.done-tick { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 38px; display: grid; place-items: center; animation: pop .35s ease-out; }
.done-id { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--brand); }
.done-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 320px; margin-top: 8px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.busy { position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 20px; }
.busy-card { background: #fff; border-radius: 16px; padding: 24px 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 240px; text-align: center; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--brand-tint); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Camera ---------- */
.cam { position: fixed; inset: 0; z-index: 400; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px; }
.cam-top strong { font-size: 15px; }
.cam-x { background: rgba(255, 255, 255, .15); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.cam-x.on { background: #FACC15; color: #000; }
.cam-stage { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.cam-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-guide { position: relative; z-index: 2; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 3px solid rgba(255, 255, 255, .95); }
.cam-guide-card { width: min(88vw, 560px); aspect-ratio: 1.586; }
.cam-guide-passport { width: min(90vw, 560px); aspect-ratio: 1.42; }
.cam-guide-barcode { width: min(86vw, 520px); aspect-ratio: 3.2; }
.cam-guide-barcode span { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #EF4444; box-shadow: 0 0 10px #EF4444; animation: laser 1.6s ease-in-out infinite; }
.cam-guide-screen { width: min(80vw, 420px); aspect-ratio: .62; max-height: 70vh; }
@keyframes laser { 0%, 100% { transform: translateY(-18px); } 50% { transform: translateY(18px); } }
.cam-msg { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; font-size: 14px; }
.cam-chip { background: rgba(0, 0, 0, .6); padding: 6px 12px; border-radius: 999px; font-size: 12px; }
.cam-big { padding: 14px 24px; font-size: 16px; }
.cam-hint { text-align: center; padding: 10px 16px 0; font-size: 13px; color: #E5E7EB; }
.cam-bar { display: flex; justify-content: space-around; align-items: center; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.cam-side { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px; cursor: pointer; }
.cam-side span { font-size: 11px; color: #D1D5DB; }
.cam-shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer; }
.cam-shutter:active { background: #fff; transform: scale(.94); }
.cam-flash::after { content: ''; position: fixed; inset: 0; background: #fff; animation: flash .25s ease-out forwards; z-index: 10; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }

/* ---------- GPS / location ---------- */
.geo-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.geo-card:empty { display: none; }
.geo-card > div { flex: 1; min-width: 0; }
.geo-card strong { display: block; font-size: 14px; }
.geo-card small { display: block; font-size: 12px; color: var(--muted); }
.geo-ico { font-size: 22px; width: 32px; text-align: center; flex: none; }
.geo-ok { border-color: var(--ok-bd); background: var(--ok-bg); } .geo-ok strong { color: var(--ok); }
.geo-bad { border-color: var(--bad-bd); background: var(--bad-bg); } .geo-bad strong { color: var(--bad); }
.geo-warn { border-color: var(--warn-bd); background: var(--warn-bg); } .geo-warn strong { color: var(--warn); }
.geo-muted { background: #FAF8F7; }
.lock-tag { flex: none; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--brand); color: #fff; white-space: nowrap; }
.geo-chip { border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); background: #fff; cursor: pointer; white-space: nowrap; }
.geo-chip.geo-ok { color: var(--ok); } .geo-chip.geo-bad { color: var(--bad); } .geo-chip.geo-warn { color: var(--warn); }
.spinner-sm { display: inline-block; width: 20px; height: 20px; border-width: 3px; vertical-align: middle; }
.nosale-link { display: block; padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text); background: #fff; font-size: 14px; }
.map-card { padding: 10px; }
.map-box { height: 62vh; min-height: 360px; border-radius: 10px; overflow: hidden; background: #F4F0E1; position: relative; z-index: 0; }
.map-box-sm { height: 300px; min-height: 0; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.dot-ok { background: var(--ok); } .dot-bad { background: var(--bad); } .dot-stale { background: var(--subtle); }
.ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand); background: rgba(91, 41, 46, .1); margin-right: 4px; vertical-align: -2px; }
.dot-warn { background: #D97706; }
.outlet-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand); margin-right: 4px; vertical-align: -1px; }
/* agent: round badge with initials, white border, status colour; pulses when away from the outlet */
.agent-pin span { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; border: 2.5px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .35); transition: transform .15s ease; }
.agent-pin:hover span { transform: scale(1.12); }
.pin-ok span { background: var(--ok); } .pin-bad span { background: var(--bad); } .pin-warn span { background: #D97706; } .pin-stale span { background: #94A3B8; }
.pin-bad span::after { content: ''; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid var(--bad); animation: pin-pulse 1.6s ease-out infinite; }
@keyframes pin-pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
.pin-outdoor span { border-radius: 9px; }
/* outlet: a dot on the exact GPS spot, code label sitting above it (clear of agent badges) */
.outlet-mk i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--brand), 0 1px 4px rgba(0, 0, 0, .3); box-sizing: border-box; }
.outlet-mk .outlet-lbl { position: absolute; left: 50%; bottom: calc(100% + 18px); transform: translateX(-50%); white-space: nowrap; background: #fff; color: var(--brand); border: 1px solid rgba(91, 41, 46, .28); border-radius: 7px; padding: 2px 8px; font-size: 12px; font-weight: 700; line-height: 1.45; box-shadow: 0 2px 6px rgba(15, 23, 42, .22); pointer-events: none; }
.outlet-mk .outlet-lbl::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff; filter: drop-shadow(0 1px 0 rgba(91, 41, 46, .28)); }
.outlet-area i { background: #0369A1; box-shadow: 0 0 0 1px #0369A1, 0 1px 4px rgba(0, 0, 0, .3); }
.outlet-area .outlet-lbl { color: #0369A1; border-color: rgba(3, 105, 161, .35); }
.ring-area { border-color: #0369A1; border-style: dashed; background: rgba(3, 105, 161, .08); }
.dot-sq { border-radius: 3px; background: var(--ok); }
.dot-never { background: transparent; border: 1.5px solid var(--subtle); box-sizing: border-box; }
/* map controls */
.map-box .leaflet-control-layers, .map-box .leaflet-bar { border: none; border-radius: 9px; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); overflow: hidden; }
.map-box .leaflet-bar a { width: 34px; height: 34px; line-height: 34px; color: var(--text); }
.map-box .leaflet-control-layers-toggle { width: 38px; height: 38px; background-size: 20px; }
.map-box .leaflet-control-layers-expanded { padding: 8px 12px; font-family: inherit; font-size: 13px; line-height: 1.7; }
.map-box .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 6px 20px rgba(15, 23, 42, .2); }
.map-box .leaflet-popup-content { margin: 10px 14px; font-family: inherit; font-size: 13px; line-height: 1.5; }
.map-box .leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .8); }
/* Live Map toolbar: status chips (tap = show only those) + find / show all / full screen */
.map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 2px 2px 10px; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 420px; min-width: 0; }
.map-chip { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; cursor: pointer; white-space: nowrap; min-height: 34px; }
.map-chip .dot { margin: 0; }
.map-chip b { font-weight: 700; background: var(--bg); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.map-chip:hover { border-color: var(--line-strong); }
.map-chip.active { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.map-chip.active b { background: #fff; }
.chip-short { display: none; }
.map-chip-toggle { color: var(--muted); }
.map-chip-toggle.on { color: var(--text); border-color: var(--info-bd); background: var(--info-bg); }
.map-chip-toggle:not(.on) .key-sale { opacity: .35; }
.map-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.map-actions .btn { min-height: 34px; white-space: nowrap; }
.map-full-btn.btn-primary { box-shadow: 0 2px 8px rgba(91, 41, 46, .3); }
/* what the symbols mean, in plain words, under the map */
.map-key { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 4px 2px; font-size: 12px; color: var(--muted); }
.map-key span { display: inline-flex; align-items: center; gap: 6px; }
.map-key .outlet-key, .map-key .ring { margin: 0; }
.key-pin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .25); }
.key-cluster { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--bad) 0 25%, var(--ok) 25% 100%); -webkit-mask: radial-gradient(circle, transparent 4px, #000 4.5px); mask: radial-gradient(circle, transparent 4px, #000 4.5px); }
.key-sale { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--info); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--info); }
.map-tip { margin: -4px 0 8px; }
/* group of agents: count in the middle, ring split by status, red tag = how many are away */
.agent-cluster { background: none; }
.agent-cluster span { position: relative; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 2px 10px rgba(15, 23, 42, .3); cursor: pointer; transition: transform .15s ease; }
.agent-cluster span::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.agent-cluster span:hover { transform: scale(1.08); }
.agent-cluster b { position: relative; font-size: 14px; font-weight: 700; color: var(--text); }
.agent-cluster em { position: absolute; left: 50%; top: calc(100% - 4px); transform: translateX(-50%); white-space: nowrap; padding: 0 6px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 17px; border: 1.5px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .25); pointer-events: none; }
/* outlet codes only once zoomed in on the Live Map (zoomed out they pile up) */
#live-map:not(.show-labels) .outlet-lbl, #live-map .lbl-hide .outlet-lbl { display: none; }
/* zoomed far out: small plain outlet dots (they would crowd the agent groups) */
#live-map.zoom-far .outlet-mk i { width: 8px; height: 8px; margin: 3px; border-width: 1px; box-shadow: none; }
.outlet-name { pointer-events: none !important; }
/* Map / Streets / Satellite switch */
.map-seg { display: flex; background: #fff; border-radius: 9px; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); padding: 3px; gap: 2px; }
.map-seg button { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.map-seg button:hover { color: var(--text); background: var(--bg); }
.map-seg button.active { background: var(--brand); color: #fff; }
/* popups */
.map-pop { min-width: 200px; }
.map-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; font-size: 14px; }
.map-pop-st { flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; color: #fff; background: #94A3B8; }
.map-pop-st.st-ok { background: var(--ok); } .map-pop-st.st-bad { background: var(--bad); } .map-pop-st.st-warn { background: #D97706; } .map-pop-st.st-never { background: var(--subtle); }
.map-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 12.5px; }
.map-pop dt { color: var(--muted); }
.map-pop dd { margin: 0; }
.map-pop-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
/* Live Map body: searchable list of agents / outlets on the left, the map on the right */
.map-main { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 10px; height: clamp(480px, calc(100vh - 190px), 920px); position: relative; }
.map-main .map-box { height: 100%; min-height: 0; }
.map-side { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.map-search { position: relative; flex: none; padding: 8px; border-bottom: 1px solid var(--line); }
.map-search > svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.map-search .input { width: 100%; height: 38px; padding: 6px 34px 6px 34px; font-size: 14px; border-radius: 9px; }
.map-search .input::-webkit-search-cancel-button { display: none; }
.map-search-x { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.map-search-x:hover { background: var(--bg); color: var(--text); }
.map-search-x svg { width: 15px; height: 15px; }
.map-search-x[hidden] { display: none; }
.map-drop { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.map-side-tabs { display: flex; flex: none; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.map-side-tabs button { flex: 1; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 7px; padding: 6px 2px; cursor: pointer; white-space: nowrap; }
.map-side-tabs button b { font-weight: 700; font-size: 11px; background: var(--bg); border-radius: 999px; padding: 1px 5px; margin-left: 1px; color: var(--text); }
.map-side-tabs button:hover { background: var(--bg); }
.map-side-tabs button.active { background: var(--brand-tint); color: var(--brand); }
.map-side-tabs button.active b { background: #fff; }
.map-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.map-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; min-height: 48px; }
.map-row:hover, .map-row:focus-visible { background: var(--brand-tint); outline: none; }
.map-row > i { flex: none; margin: 0; }
.map-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.map-row-main strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-row-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-row em { flex: none; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.map-row em.st-bad { color: var(--bad); } .map-row em.st-ok { color: var(--ok); } .map-row em.st-warn { color: #B45309; }
.map-row em { text-align: right; line-height: 1.25; } .map-row em small { font-size: 11px; font-weight: 600; }
.map-row small b.st-warn { color: #B45309; font-weight: 600; }
.map-row-all { background: var(--bg); }
.map-list-note { margin: 0; padding: 14px 12px; font-size: 12.5px; color: var(--muted); text-align: center; }
/* agents of an outlet inside its map card */
.map-pop-team { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 3px; font-size: 12.5px; }
.map-pop-team li { display: flex; align-items: center; gap: 6px; }
.map-pop-team li .dot { flex: none; margin: 0; width: 9px; height: 9px; }
.map-pop-team li a { font-weight: 600; }
.map-pop-team li small { margin-left: auto; padding-left: 10px; color: var(--muted); white-space: nowrap; }
/* satellite: thin white edge so the allowed-zone circles stay visible on dark imagery */
.map-box.on-satellite .leaflet-overlay-pane path { filter: drop-shadow(0 0 1px #fff); }
/* full-screen map: the toolbar stays on top with a clear "Exit full screen" button */
.map-card.map-full { position: fixed; inset: 0; z-index: 90; margin: 0; border: 0; border-radius: 0; display: flex; flex-direction: column; padding: calc(10px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) calc(10px + var(--safe-b, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
.map-card.map-full .map-main { flex: 1; height: auto; min-height: 0; }
.map-card.map-full .map-key { display: none; }
body.map-full-open { overflow: hidden; }
/* tabs with line icons */
.tab-icon { display: inline-flex; align-items: center; gap: 7px; }
.tab-icon .ui-icon { width: 17px; height: 17px; }
/* Excel / PDF buttons: coloured file badge */
.file-icon { width: 17px; height: 19px; flex: none; }
.btn-file { gap: 7px; }
.btn-sm .file-icon { width: 15px; height: 17px; }
.btn-xlsx:hover { border-color: #1D6F42; background: #F0F8F3; color: #14532D; }
.btn-pdf:hover { border-color: #C62828; background: #FDF2F2; color: #7F1D1D; }
.btn .ui-icon { width: 17px; height: 17px; }
.plain-list { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cell-bad { color: var(--bad); font-weight: 700; background: var(--bad-bg); }
.old-val { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(185, 28, 28, .4); }
.new-val { color: var(--ok); font-weight: 600; }

/* ---------- Commission monthly sheets ---------- */
.comm-status { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.comm-status h3 { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.rate-table .input { max-width: 140px; }
#pr-tbl .input { min-width: 110px; }

.setup-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.setup-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.setup-list li > div { flex: 1; min-width: 0; }
.setup-list strong { display: block; font-size: 14px; }
.setup-list small { display: block; color: var(--muted); font-size: 12px; }
.setup-tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; }
.setup-list li.done { background: #FAF8F7; }
.setup-list li.done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.setup-list li.done .setup-tick { background: var(--ok); border-color: var(--ok); }
.modal-backdrop.locked { background: rgba(15, 23, 42, .75); }

/* ---------- No-sale ---------- */
.chip-select { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip-select.chip-wrap { flex-wrap: wrap; overflow: visible; }
.chip-opt { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.chip-opt.sel { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------- Settings: Google ---------- */
.g-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.g-block { display: flex; flex-direction: column; gap: 10px; }
.howto { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-2, .steps, .g-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  html, body { font-size: 16px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 286px; max-width: 85vw; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .2); padding-bottom: var(--safe-b); }
  .sidebar.open { transform: none; }
  .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  #drawer-logout { display: flex; }
  .drawer-user { display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
  .drawer-user strong { display: block; font-size: 14px; }
  .drawer-user span { font-size: 12px; color: var(--muted); }
  .brand img { max-width: 170px; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); gap: 8px; }
  .topbar-mark { display: block; width: 30px; height: 30px; object-fit: contain; }
  .topbar h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar-right { gap: 6px; }
  .user-chip, #logout-btn { display: none; }
  main#main { padding: 14px 12px calc(var(--bottom-nav-h) + var(--safe-b) + 20px); gap: 14px; }
  .hide-phone { display: none !important; }
  .map-box { height: 52vh; min-height: 300px; }
  /* phone: search box above the map; the list drops down over the map while searching */
  .map-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto; gap: 8px; position: relative; }
  .map-card.map-full { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
  .map-bar, .map-main { display: contents; }
  .map-side { grid-area: 1 / 1; overflow: visible; border: 0; background: none; min-width: 0; }
  .map-actions { grid-area: 1 / 2; margin: 0; gap: 6px; }
  .map-actions [data-fit] span { display: none; }
  .map-actions .btn { min-height: 44px; padding-left: 11px; padding-right: 11px; }
  .map-chips { grid-area: 2 / 1 / 3 / 3; }
  .map-main .map-box { grid-area: 3 / 1 / 4 / 3; height: 64vh; min-height: 340px; }
  .map-card.map-full .map-main .map-box { height: auto; min-height: 0; }
  .map-key { grid-area: 4 / 1 / 5 / 3; padding-top: 2px; }
  .map-search { padding: 0; border: 0; }
  .map-search > svg { left: 11px; }
  .map-search-x { right: 6px; width: 32px; height: 32px; }
  .map-search .input { height: 44px; font-size: 16px; }
  .map-drop { display: none; position: absolute; z-index: 5; left: 10px; right: 10px; top: 60px; max-height: min(56vh, 420px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .22); overflow: hidden; }
  .map-side.open .map-drop { display: flex; }
  .map-card.map-full .map-drop { top: calc(60px + env(safe-area-inset-top, 0px)); }
  .map-bar { gap: 8px; }
  .map-chips { flex-basis: 100%; gap: 5px; }
  .map-chip { font-size: 12.5px; padding: 3px 8px; gap: 4px; min-height: 32px; }
  .map-chip b { padding: 0 5px; }
  .chip-long { display: none; }
  .chip-short { display: inline; }
  .map-key { gap: 4px 14px; font-size: 11.5px; }
  .map-seg button { padding: 6px 8px; font-size: 12px; }
  .map-box-sm { height: 260px; min-height: 0; }
  .geo-card { padding: 10px; gap: 10px; }
  .lock-tag { font-size: 10px; padding: 2px 6px; }

  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--bottom-nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none !important; min-width: 0; }
  .bn-item > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .bn-ico { width: 21px; height: 21px; display: grid; place-items: center; line-height: 1.1; position: relative; }
  .bn-ico .ui-icon { width: 20px; height: 20px; }
  .bn-ico .badge { position: absolute; top: -4px; right: -12px; font-size: 9px; }
  .bn-item.active { color: var(--brand); }
  .bn-item.active .bn-ico { transform: translateY(-1px); }
  .bn-fab { position: relative; }
  .bn-fab-btn { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(91, 41, 46, .45); border: 4px solid #fff; }
  .bn-fab-btn .ui-icon { width: 24px; height: 24px; }
  .bn-fab.active .bn-fab-btn { background: var(--brand-dark); }
  .bn-fab span:last-child { color: var(--brand); font-weight: 700; }

  .hero-cta { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; color: #fff; text-decoration: none !important; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); box-shadow: 0 8px 20px rgba(91, 41, 46, .3); }
  .hero-ico { width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; font-size: 24px; flex: none; }
  .hero-cta strong { display: block; font-size: 16px; }
  .hero-cta small { display: block; font-size: 12px; opacity: .85; }
  .hero-go { margin-left: auto; font-size: 28px; opacity: .8; }
  .today-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .today-strip > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; }
  .today-strip span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
  .today-strip strong { font-size: 22px; font-weight: 700; color: var(--brand); }
  .today-strip small { font-size: 11px; color: var(--muted); }

  .wiz-title h2 { display: none; } /* the top bar already says "New Sale" */
  .wiz-title { justify-content: flex-end; min-height: 0; }
  .wiz-title:not(:has(button)) { display: none; }
  .wiz-body { padding: 14px; border-radius: 14px; }
  .wiz-foot { bottom: calc(var(--bottom-nav-h) + var(--safe-b)); padding: 10px 0; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 98px; padding: 10px; }
  .wf-grid { grid-template-columns: 1fr; }
  .wf .input, .input { font-size: 16px; } /* prevents iOS zoom on focus */
  .scan-cta { grid-template-columns: 1fr; }
  .scan-result { flex-direction: column; }

  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: var(--safe-b); }
  #toast-container { left: 12px; right: 12px; bottom: auto; top: calc(58px + env(safe-area-inset-top, 0px)); }
  .toast { transform: translateY(-10px); }
  .toast { max-width: none; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .page-head h2 { font-size: 19px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 20px; }
  .filter-bar label { max-width: none; }
  .table-toolbar .search { max-width: none; }
}
@media (max-width: 640px) {
  .data-table.cardify thead { display: none; }
  .data-table.cardify, .data-table.cardify tbody { display: block; }
  .data-table.cardify tr { display: block; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; background: #fff; }
  .data-table.cardify tbody tr:hover { background: #fff; }
  .data-table.cardify td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px dashed var(--line); padding: 6px 10px; text-align: right; }
  .data-table.cardify td:last-child { border-bottom: none; }
  .data-table.cardify td::before { content: attr(data-label); font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: left; flex: none; max-width: 45%; }
  .data-table.cardify td[data-label=""]::before { display: none; }
  .data-table.cardify td.empty { justify-content: center; }
  .data-table.cardify td.empty::before { display: none; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: space-between; }
  .filter-bar label { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .summary-cell { flex: 1 1 calc(25% - 8px); padding: 6px 8px; }
  .summary-cell strong { font-size: 17px; }
  .page-head .actions { width: 100%; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 10px; }
  .demo-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Phone workflows: kiosk and outdoor agents share the same touch interface. */
.drawer-close { display: none; }
.brand { position: relative; }
.bn-item { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.hero-ico .ui-icon { width: 26px; height: 26px; }
.nosale-link { display: flex; align-items: center; gap: 10px; }
.nosale-link > .ui-icon { width: 20px; height: 20px; color: var(--brand); }
.nosale-link > span:last-child { margin-left: auto; }

@media (max-width: 820px) {
  html { scroll-padding-top: 84px; scroll-padding-bottom: 140px; }
  .shell, .login-page { min-height: 100dvh; }
  .sidebar { height: 100dvh; visibility: hidden; overscroll-behavior: contain; padding-top: env(safe-area-inset-top, 0px); }
  .sidebar.open { visibility: visible; }
  body.drawer-open { overflow: hidden; }
  .drawer-close { display: inline-grid; position: absolute; right: 8px; top: 12px; font-size: 26px; }
  .drawer-user .avatar { color: #fff; flex: none; }
  .nav-item { min-height: 48px; }
  .topbar { flex-wrap: wrap; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .topbar-mark { display: none; }
  .topbar h1 { flex: 1; }
  .topbar-right { gap: 4px; flex-shrink: 0; }
  .topbar .geo-chip { display: none; } /* Full status and retry remain on Home and New Sale. */
  .topbar .sync-chip { max-width: 92px; overflow: hidden; text-overflow: ellipsis; min-height: 36px; padding: 4px 8px; }
  .topbar .offline-chip { padding: 3px 6px; }
  .icon-btn, .btn, .btn-sm, .chip-opt, .tab { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; flex: none; }
  .shot .icon-btn { min-height: 32px; width: 32px; height: 32px; }
  .input, .wf .input { min-height: 46px; font-size: 16px; max-width: 100%; }
  input[type=date], input[type=month] { appearance: none; -webkit-appearance: none; min-width: 0; }
  .form label, .inline-label, .wf { min-width: 0; }
  main#main { padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); padding-bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 32px); }
  .bottom-nav { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .bn-item { min-height: 56px; }
  .bn-fab-btn { flex-shrink: 0; }
  .selling .bn-fab-btn { width: 32px; height: 30px; margin-top: 0; border: 0; border-radius: 8px; box-shadow: none; }
  .selling .bn-fab-btn .ui-icon { width: 20px; height: 20px; }
  .geo-card { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
  .geo-card > .geo-ico { grid-column: 1; grid-row: 1; width: 28px; }
  .geo-card > div { grid-column: 2 / -1; grid-row: 1; }
  .geo-card > .lock-tag { grid-column: 2; justify-self: start; align-self: center; }
  .geo-card > .btn { grid-column: 3; grid-row: 2; }
  .geo-card small, .page-head p, .kpi-sub { overflow-wrap: anywhere; }
  .role-agent .page-head { align-items: stretch; gap: 10px; }
  .role-agent .page-head > div { min-width: 0; }
  .role-agent .page-head .inline-label { width: 100%; justify-content: space-between; }
  .role-agent .page-head input[type=month] { width: 180px; }
  .role-agent .hero-cta { box-shadow: 0 5px 14px rgba(91, 41, 46, .16); padding: 16px 14px; gap: 12px; }
  .hero-cta > span:nth-child(2) { min-width: 0; }
  .hero-cta small { line-height: 1.5; margin-top: 4px; }
  .role-agent .kpi { min-width: 0; }
  .role-agent .kpi-value { overflow-wrap: anywhere; }
  .role-agent .form-grid, .role-agent .field-grid { grid-template-columns: minmax(0, 1fr); }
  .role-agent .chip-wrap .chip-opt { white-space: normal; text-align: left; }
  .role-agent .check { min-height: 44px; }
  .role-agent input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
  .wiz { gap: 12px; }
  .wiz-head { padding-top: 4px; }
  .wiz-body { padding: 14px 12px; }
  .wiz-foot { padding: 10px 0; gap: 8px; }
  .wiz-foot .btn { min-height: 48px; }
  .tile { min-height: 126px; gap: 5px; }
  .tile strong { line-height: 1.35; }
  .tile small { line-height: 1.4; }
  .tile:hover { transform: none; }
  .seg button { min-height: 48px; padding: 10px 6px; }
  .scan-ico { flex: none; }
  .scan-ico .ui-icon { width: 26px; height: 26px; }
  .scan-btn { min-height: 76px; }
  .data-table.cardify td { overflow-wrap: anywhere; }
  .toolbar-right { flex-wrap: wrap; }
  .modal { max-height: 92dvh; }
  .modal-head { flex: none; }
  .modal-body { overscroll-behavior: contain; }
  .keyboard-open .bottom-nav { display: none; }
  .keyboard-open .wiz-foot { position: static; }
  .keyboard-open main#main { padding-bottom: 24px; }
  .cam { height: 100dvh; }
}
@media (max-width: 360px) {
  .topbar { gap: 4px; }
  .topbar h1 { font-size: 15px; }
  .topbar .sync-chip { max-width: 72px; }
  .today-strip { gap: 6px; }
  .today-strip > div { padding: 9px 7px; }
  .today-strip span { font-size: 10px; }
  .stepper em { font-size: 10px; }
  .wiz-foot .btn { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media print {
  .sidebar, .topbar, .actions, .filter-bar, .pager, .table-toolbar, .bottom-nav, .hero-cta { display: none !important; }
  .shell { display: block; }
}

/* Logo-style lettering (spaced capitals, like "Q A N A W A T") */
.brand-caps { text-transform: uppercase; letter-spacing: .32em; font-weight: 700; }

.pdf-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; font-size: 34px; color: var(--bad); text-decoration: none; }
.pdf-tile small { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Qanawat brand system ---------- */
.eyebrow, .brand-caption, .nav-group { display: block; font-size: 10px; line-height: 1.5; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; }
.eyebrow { color: var(--brand-light); margin-bottom: 6px; }
.brand { padding: 26px 24px 20px; }
.brand-caption { color: var(--muted); margin-top: 18px; font-size: 9px; letter-spacing: .22em; }
.nav-group { color: var(--muted); padding: 18px 12px 7px; font-size: 9px; }
#nav { padding: 0 14px 20px; gap: 4px; }
.nav-item { font-size: 14px; padding: 11px 12px; border-radius: 10px; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(91, 41, 46, .13); }
.nav-item:hover { transform: none; }
.sidebar-foot .btn { justify-content: flex-start; background: #FAF8F7; border-color: var(--line); }
.partner-label { font-size: 10px; line-height: 1.6; color: var(--muted); padding-top: 5px; }
.partner-label::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--brand); border-radius: 50%; margin-right: 6px; }
.topbar { min-height: 74px; }
.topbar h1 { font-size: 16px; }
.user-chip { padding-left: 16px; border-left: 1px solid var(--line); gap: 10px; }
.avatar { background: var(--brand-tint); color: var(--brand); border: 1px solid #E7D4D7; width: 36px; height: 36px; }
main#main { padding: 28px 32px 36px; gap: 22px; margin: 0 auto; }
.page-head h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.025em; }
.page-head p { max-width: 800px; margin-top: 7px; font-size: 14px; line-height: 1.5; }
.card { padding: 22px; }
.card-head { margin-bottom: 18px; }
.card-head h3 { font-size: 18px; letter-spacing: -.015em; }
.btn { border-radius: 9px; min-height: 38px; transition: background .16s ease, box-shadow .16s ease; }
.btn .ui-icon { width: 16px; height: 16px; }
.btn-primary { box-shadow: 0 3px 8px rgba(91, 41, 46, .12); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(91, 41, 46, .2); }
.input { font-weight: 400; border-radius: 9px; min-height: 39px; padding: 9px 12px; }
.input::placeholder { color: #85777D; opacity: 1; }
.input:focus { outline: 3px solid #5B292E18; }
.form label { font-size: 13px; gap: 7px; }
.form { gap: 16px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #A56C76; outline-offset: 3px; }
.kpi { border-left-width: 1px; border-top: 3px solid var(--line-strong); padding: 20px; gap: 9px; min-width: 0; }
.kpi-label { font-size: 10px; letter-spacing: .08em; }
.kpi-value { font-size: 32px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-ok { border-top-color: var(--ok); border-left-color: var(--line); }
.kpi-warn { border-top-color: var(--warn); border-left-color: var(--line); }
.kpi-bad { border-top-color: var(--bad); border-left-color: var(--line); }
.kpi-accent { border-top-color: var(--brand); border-left-color: var(--line); background: linear-gradient(130deg, #fff, #FBF4F5); }
.kpi-sub { line-height: 1.5; }
.data-table td { padding: 13px 12px; }
.data-table th { padding: 12px; letter-spacing: .07em; }
.data-table.compact td, .data-table.compact th { padding: 10px 12px; }
.data-table .empty { padding: 36px 16px; }
.table-toolbar { gap: 14px; margin-bottom: 16px; }
.filter-bar { padding: 16px; }
.modal { border: 1px solid var(--line); box-shadow: 0 20px 80px #302A2C26; }
.col-bar, .bar-fill { background: linear-gradient(0deg, var(--brand), #A16C74); }
.col-chart { border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0, transparent 44px, #E8E4E280 45px, transparent 46px); }
.dashboard-head { position: relative; isolation: isolate; overflow: hidden; padding: 30px; border: 1px solid #E4D7DA; border-radius: 18px; background: linear-gradient(110deg, #F4E9EB, #FFFDFB 75%); align-items: center; }
.dashboard-head::after { content: ''; position: absolute; z-index: -1; width: 240px; height: 240px; border: 1px solid #B38A9428; border-radius: 50%; right: -100px; top: -120px; box-shadow: 0 0 0 35px #B38A9408, 0 0 0 70px #B38A9408; pointer-events: none; }
.dashboard-head h2 { font-size: 34px; color: var(--brand-dark); }
.dashboard-head .eyebrow { margin-bottom: 10px; }
.dashboard-head .input { background: #FFFCFC; }
.quick-links { display: flex; flex-wrap: wrap; gap: 12px; }
.quick-links a { flex: 1 1 160px; display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; transition: border-color .16s, background .16s; }
.quick-links a:hover { border-color: #B58B95; background: #FFFAFB; }
.quick-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-tint); color: var(--brand); }
.quick-icon .ui-icon { width: 18px; height: 18px; }
.quick-links a > .ui-icon { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }
.setup-progress { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.setup-progress span { color: var(--muted); font-size: 12px; }
.setup-progress progress { flex: 1; max-width: 280px; min-width: 60px; height: 6px; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg); accent-color: var(--brand); }
.setup-progress progress::-webkit-progress-bar { background: var(--bg); }
.setup-progress progress::-webkit-progress-value { background: var(--brand); border-radius: 10px; }
.setup-progress progress::-moz-progress-bar { background: var(--brand); }
.setup-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.setup-list li { padding: 14px; align-items: flex-start; background: #FFFDFC; }
.setup-list strong { font-size: 14px; line-height: 1.35; }
.setup-list small { margin-top: 4px; line-height: 1.5; }
.setup-list .btn { align-self: center; flex: none; }
.setup-tick { width: 28px; height: 28px; border: 0; background: var(--brand-tint); color: var(--brand); font-size: 11px; }
.setup-list li.done .setup-tick { color: #fff; }

/* A connection motif echoes the circular Q and signal in the original logo. */
.login-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #F7F5F3; min-height: 100vh; min-height: 100dvh; }
.login-story { position: relative; align-self: stretch; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: clamp(32px, 4vw, 60px); background: radial-gradient(ellipse at 85% 65%, #884650, transparent 65%), #411D25; color: #fff; }
.story-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .22em; color: #E9CED3; }
.story-copy { margin-top: 16px; }
.story-eyebrow { display: block; font-size: 13px; color: #E7C7CE; margin-bottom: 16px; }
.story-copy h1 { font-size: clamp(36px, 3.8vw, 60px); line-height: 1.07; letter-spacing: -.035em; font-weight: 700; }
.story-copy p { color: #E6D2D6; font-size: 17px; line-height: 1.7; max-width: 350px; margin-top: 22px; }
.connection-art { height: 210px; width: 100%; max-width: 380px; align-self: center; position: relative; display: grid; place-items: center; margin: 4px 0; }
.connection-orbit { position: absolute; border: 1px solid #FFFFFF21; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.orbit-one { width: 140px; height: 140px; }
.orbit-two { width: 240px; height: 240px; }
.orbit-three { width: 340px; height: 340px; border-style: dashed; opacity: .45; }
.connection-center { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 26px; border: 1px solid #F5E8EC99; background: linear-gradient(145deg, #FEF8F9, #C8B8BD); box-shadow: 0 12px 45px #24101840; color: var(--brand); transform: rotate(-8deg); }
.connection-center .ui-icon { width: 42px; height: 42px; transform: rotate(8deg); }
.connection-node { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #75414B; border: 1px solid #B68B94; color: #FAEDF1; }
.connection-node .ui-icon { width: 23px; height: 23px; }
.node-one { left: calc(50% - 122px); top: 16px; }
.node-two { right: calc(50% - 140px); top: 75px; }
.node-three { left: calc(50% - 70px); bottom: -8px; }
.story-features { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 25px; padding-top: 24px; border-top: 1px solid #FFFFFF26; }
.story-features span { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #F2DFE4; }
.story-features .ui-icon { width: 17px; height: 17px; }
.story-footer { color: #D3ADB7; font-size: 11px; }
/* Login form: one card and one field system across all screen sizes. */
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px clamp(24px, 4vw, 64px); min-width: 0; }
.login-card { display: flex; flex-direction: column; gap: 26px; width: 100%; max-width: 460px; min-width: 0; padding: 36px; background: #fff; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 48px #411D2509, 0 2px 6px #411D2504; }
.login-card > * { min-width: 0; }
.login-logo { display: block; width: 100%; max-width: 260px; height: auto; margin-bottom: 2px; }
.login-card h2 { font-size: 36px; font-weight: 700; letter-spacing: -.035em; line-height: 1.2; color: var(--text); text-transform: none; margin: 6px 0 8px; }
.login-heading > .muted { font-size: 16px; line-height: 1.5; }
.login-heading .eyebrow { font-size: 11px; letter-spacing: .12em; }
.login-card .form { gap: 20px; }
.login-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.login-card .login-field label { color: var(--text); font-size: 14px; font-weight: 700; }
.login-input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.login-input-wrap > .ui-icon { position: absolute; left: 15px; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.login-card .input { width: 100%; min-height: 52px; padding: 13px 14px 13px 44px; font-size: 16px; line-height: 1.5; border: 1px solid #9C8A90; border-radius: 10px; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
.login-card .input:hover { border-color: #8B747B; }
.login-card .input:focus { outline: 2px solid var(--brand); outline-offset: 2px; border-color: var(--brand); }
.login-input-wrap:focus-within > .ui-icon { color: var(--brand); }
.login-card .input[aria-invalid="true"] { border-color: var(--bad); background: #FFFAFA; }
.login-card .input[readonly] { background: #F7F5F3; }
.login-card #login-password { padding-right: 54px; }
.login-card #pw-show { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; min-height: 44px; color: var(--muted); border-radius: 7px; }
.login-card #pw-show:hover { color: var(--brand); background: var(--brand-tint); }
.login-card #pw-show:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.login-card .btn-primary { min-height: 52px; font-size: 16px; line-height: 1.5; justify-content: space-between; padding: 13px 18px; border-radius: 10px; }
.login-card .btn-primary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.login-card .btn-primary:disabled { opacity: 1; background: #76565B; border-color: #76565B; cursor: wait; }
.login-card .btn-primary .ui-icon { width: 20px; height: 20px; }
.login-spinner { display: block; width: 20px; height: 20px; border-width: 2px; border-color: #FFFFFF55; border-top-color: #fff; }
.login-field-error { color: var(--bad); font-size: 13px; }
.login-error, .login-notice, .login-offline { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--bad-bd); border-radius: 10px; background: var(--bad-bg); color: #991B1B; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.login-error:focus { outline: 2px solid var(--bad); outline-offset: 2px; }
.login-error > .ui-icon, .login-notice > .ui-icon, .login-offline > .ui-icon { width: 18px; height: 18px; margin-top: 2px; }
.login-notice { color: var(--info); border-color: var(--info-bd); background: var(--info-bg); }
.login-offline { display: none; color: #85400D; border-color: var(--warn-bd); background: var(--warn-bg); }
.is-offline .login-offline { display: flex; }
.login-caps { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #85400D; }
.login-caps .ui-icon { width: 15px; height: 15px; }
#login-geo:empty { display: none; }
#login-geo { display: grid; gap: 12px; }
#login-geo ol { padding-left: 20px; line-height: 1.6; }
#login-geo li + li { margin-top: 8px; }
.login-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.login-help { display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: var(--muted); line-height: 1.6; border-top: 1px solid var(--line); padding-top: 20px; }
.login-help > .ui-icon { width: 20px; height: 20px; color: var(--brand); margin-top: 2px; }
.login-help strong { color: var(--text); font-size: 14px; }
.login-foot { width: 100%; max-width: 460px; text-align: center; margin-top: 24px; font-size: 12px; line-height: 1.8; }
.login-foot span { color: var(--muted); }
@media (min-width: 821px) {
  .menu-btn { display: none; }
  .hero-cta { display: flex; align-items: center; gap: 16px; background: var(--brand); color: #fff; padding: 22px; border-radius: var(--radius); text-decoration: none; }
  .hero-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #FFFFFF1C; flex: none; }
  .hero-cta strong, .hero-cta small { display: block; }
  .hero-cta strong { font-size: 20px; }
  .hero-cta small { font-size: 13px; margin-top: 3px; color: #EDD9DE; }
  .hero-go { margin-left: auto; font-size: 28px; }
}
@media (max-width: 1100px) {
  .setup-list { grid-template-columns: 1fr; }
  main#main { padding: 24px; }
  .dashboard-head { padding: 24px; }
  .dashboard-head h2 { font-size: 29px; }
}
@media (max-width: 820px) {
  .topbar { min-height: 64px; }
  .topbar h1 { font-size: 16px; }
  .brand { padding: 24px; }
  main#main { padding: 20px max(14px, env(safe-area-inset-right, 0px)) calc(var(--bottom-nav-h) + var(--safe-b) + 28px) max(14px, env(safe-area-inset-left, 0px)); gap: 16px; }
  .card { padding: 16px; }
  .card-head h3 { font-size: 17px; }
  .page-head h2 { font-size: 24px; }
  .page-head p { font-size: 13px; }
  .dashboard-head { padding: 22px 18px; border-radius: 15px; }
  .dashboard-head h2 { font-size: 28px; }
  .dashboard-head .actions { width: 100%; }
  .quick-links { gap: 8px; }
  .quick-links a { padding: 12px; font-size: 13px; gap: 8px; flex-basis: 120px; }
  .quick-links a > .ui-icon { display: none; }
  .quick-icon { width: 28px; height: 28px; flex: none; }
  .kpi { padding: 16px; gap: 7px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { font-size: 10px; line-height: 1.4; }
  .btn, .btn-sm, .icon-btn { min-height: 44px; }
  .input { min-height: 46px; font-size: 16px; }
  .setup-list li { padding: 12px 10px; gap: 9px; }
  .setup-list strong { font-size: 13px; }
  .setup-list small { font-size: 12px; }
  .setup-progress { gap: 12px; }
  .login-page { display: flex; flex-direction: column; justify-content: flex-start; }
  .login-story { width: 100%; padding: max(26px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 26px max(24px, env(safe-area-inset-left, 0px)); gap: 16px; }
  .story-copy { margin-top: 0; }
  .story-copy h1 { font-size: 32px; }
  .story-copy h1 br { display: none; }
  .story-copy p, .story-eyebrow, .connection-art, .story-features, .story-footer { display: none; }
  .story-label { font-size: 9px; }
  .login-main { width: 100%; flex: 1; padding: 28px max(20px, env(safe-area-inset-right, 0px)) calc(24px + var(--safe-b)) max(20px, env(safe-area-inset-left, 0px)); }
  .login-card { gap: 24px; padding: 28px; border-radius: 20px; }
  .login-logo { max-width: 240px; margin-bottom: 4px; }
  .login-card h2 { font-size: 32px; }
  .login-foot { margin-top: 28px; }
  .drawer-user .avatar { color: var(--brand); }
}
@media (max-width: 420px) {
  .quick-links a { flex: 1 1 0; flex-direction: column; text-align: center; font-size: 12px; padding: 12px 6px; }
  .kpi { padding: 14px 12px; }
  .kpi-value { font-size: 24px; }
  .login-main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(24px + var(--safe-b)) max(16px, env(safe-area-inset-left, 0px)); }
  .login-card { padding: 24px 20px; gap: 22px; }
  .login-card h2 { font-size: 30px; }
  .login-heading > .muted { font-size: 15px; }
  .login-story { padding-top: max(20px, env(safe-area-inset-top, 0px)); padding-bottom: 20px; }
  .story-copy h1 { font-size: 25px; }
}
@media print {
  .quick-links { display: none; }
  .dashboard-head { background: white; border: 0; padding: 0; }
  .dashboard-head::after { display: none; }
}

/* Stock: deliveries to confirm, delivery note lines, scan hit */
.card.card-highlight { border-color: var(--warn-bd); background: var(--warn-bg); }
.card.card-inset { padding: 12px; margin-bottom: 10px; box-shadow: none; background: var(--brand-tint); }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
tr.row-hit td { background: var(--ok-bg); }

/* Sale wizard: e& screen photos */
.pslots { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.pslot { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); }
.pslot.done { border-color: var(--ok-bd); background: var(--ok-bg); }
.pslot.part { border-color: var(--warn-bd); }
.pslot-head { display: flex; align-items: center; gap: 10px; }
.pslot-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pslot-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); font-weight: 700; flex: none; }
.pslot.done .pslot-n { background: var(--ok); color: #fff; }
.pshots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pshot { position: relative; width: 84px; margin: 0; }
.pshot img { width: 84px; height: 112px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); display: block; }
.pshot.ok img { border-color: var(--ok); }
.pshot.bad img { border-color: var(--bad); }
.pshot figcaption { font-size: 11px; text-align: center; color: var(--muted); }
.pshot-act { position: absolute; top: 2px; right: 2px; display: flex; gap: 2px; }
.pshot-act .icon-btn { width: 24px; height: 24px; min-height: 24px; padding: 0; background: rgba(255,255,255,.92); border-radius: 50%; font-size: 12px; }
/* GPS required screen */
.geo-gate { max-width: 460px; margin: 8vh auto; text-align: center; padding: 24px; }
.geo-gate .geo-gate-ico { font-size: 52px; }
.geo-gate ol { text-align: left; margin: 12px 0 18px 18px; }
.alert-info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info); }
.dz-label { display: inline-flex; align-items: center; gap: 8px; }
.dz-label .file-icon { width: 22px; height: 25px; }

/* Backend workspace: compact overview, consistent metric icons, expandable setup. */
.backend-kpis { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 14px; }
.backend-kpis .kpi { border-top: 1px solid var(--line); padding: 18px; gap: 10px; }
.backend-kpis .kpi-warn { background: #FFFCF5; border-color: var(--warn-bd); }
.backend-kpis .kpi-bad { background: #FFFAFA; border-color: var(--bad-bd); }
.kpi-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; min-height: 34px; }
.kpi-heading .kpi-label { min-width: 0; font-size: 12px; line-height: 1.45; text-transform: none; letter-spacing: 0; }
.kpi-icon, .setup-disclosure-icon, .empty-state-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-tint); color: var(--brand); }
.kpi-icon .ui-icon, .setup-disclosure-icon .ui-icon { width: 18px; height: 18px; }
.backend-kpis .kpi-value { color: var(--brand-dark); }
.backend-kpis .kpi-sub { margin-top: auto; }
.backend-kpis .kpi-sub a { display: inline-block; padding: 2px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.setup-disclosure { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); }
.setup-disclosure > summary { display: flex; align-items: center; gap: 12px; padding: 18px 20px; list-style: none; cursor: pointer; border-radius: inherit; }
.setup-disclosure > summary::-webkit-details-marker { display: none; }
.setup-disclosure > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.setup-disclosure strong, .setup-disclosure small { display: block; }
.setup-disclosure small { margin-top: 3px; color: var(--muted); line-height: 1.5; }
.setup-disclosure > summary > .ui-icon { width: 18px; height: 18px; color: var(--muted); transition: transform .16s; }
.setup-disclosure[open] > summary > .ui-icon { transform: rotate(180deg); }
.setup-count { flex: none; border-radius: 6px; background: var(--brand-tint); color: var(--brand); padding: 4px 8px; font-size: 12px; font-weight: 700; }
.setup-disclosure .setup-card { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; min-height: 190px; padding: 20px 12px; }
.empty-state-icon { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 2px; }
.empty-state-icon .ui-icon { width: 22px; height: 22px; }
.empty-state strong { font-size: 15px; }
.empty-state p { color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 300px; }
@media (min-width: 821px) and (max-width: 1100px) {
  .topbar { padding: 12px 20px; gap: 10px; }
  .topbar-right { gap: 8px; }
  .user-meta { display: none; }
  .user-chip { padding-left: 10px; }
}
@media (max-width: 820px) {
  .backend-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .backend-kpis .kpi { padding: 16px; }
  .setup-disclosure > summary { padding: 16px; flex-wrap: wrap; }
  .setup-disclosure > summary > span:nth-child(2) { flex-basis: calc(100% - 56px); }
  .setup-count { margin-left: 44px; }
  .setup-disclosure > summary > .ui-icon { margin-left: auto; }
  .page-head > .actions { flex: 1 1 100%; }
  .page-head .actions > .btn { flex: 1 1 auto; }
  .tabs { flex: none; min-width: 0; max-width: 100%; padding-bottom: 2px; }
  .tab { flex: none; }
  .toolbar-right { justify-content: flex-start; gap: 8px; }
  .toolbar-right > .muted { margin-right: auto; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); }
  .modal-body .form-grid { grid-template-columns: minmax(0, 1fr); }
  .push-status-copy { flex-basis: calc(100% - 52px); }
}
@media (max-width: 640px) {
  .data-table.cardify td { overflow-wrap: anywhere; flex-wrap: wrap; text-align: left; }
  .data-table.cardify td > * { min-width: 0; max-width: 100%; }
  .data-table.cardify td .pill { white-space: normal; }
  .filter-bar label { flex-basis: min(160px, 100%); }
  .inline-label { flex-wrap: wrap; }
  .setup-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); }
  .setup-list li > .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 420px) {
  .backend-kpis { gap: 10px; }
  .backend-kpis .kpi { padding: 14px 12px; }
  .kpi-heading { flex-direction: column-reverse; gap: 8px; }
  .kpi-heading .kpi-label { min-height: 35px; }
  .backend-kpis .kpi-value { font-size: 28px; }
  .backend-kpis .kpi-sub { font-size: 12px; }
  .role-backend .quick-links a { flex-direction: row; flex-basis: 100%; text-align: left; padding: 12px; }
  .role-backend .quick-links a > .ui-icon { display: block; }
  .topbar #pw-btn { display: none; } /* Password control remains in the menu. */
  .modal-body { padding: 16px; }
  .modal .form-actions > .btn { flex: 1 1 100px; }
}

/* ---------- Customer Tracker (e& Customer Interaction Tracker sheet) ---------- */
:root { --hot: #C2410C; --hot-bg: #FFF1E7; --hot-bd: #FDBA8C; --warm: #A16207; --warm-bg: #FEF9E7; --warm-bd: #F5D77A; --cold: #1D4ED8; --cold-bg: #EEF4FF; --cold-bd: #BFD3FE; }
.ct-dash-link { display: flex; align-items: center; gap: 10px; }
.ct-dash-link > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; }
.ct-dash-link small { color: var(--muted); font-size: 12.5px; }

.ct-shift { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; }
.ct-shift.st-off { border: 1.5px dashed var(--line-strong); background: #fff; }
.ct-shift.st-on { border-color: var(--ok-bd); background: linear-gradient(90deg, var(--ok-bg), #fff 70%); }
.ct-shift.st-break { border-color: var(--warn-bd); background: linear-gradient(90deg, var(--warn-bg), #fff 70%); }
.ct-shift-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 220px; }
.ct-shift-info > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ct-shift-info small { color: var(--muted); }
.ct-shift-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-shift-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.ct-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong); }
.ct-dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(4, 120, 87, .15); }
.ct-dot.brk { background: var(--warn); box-shadow: 0 0 0 4px rgba(180, 83, 9, .15); }
.ct-dot.done { width: 26px; height: 26px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.ct-dot.done .ui-icon { width: 16px; height: 16px; }

.ct-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ct-stats > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.ct-stats strong { font-size: 22px; line-height: 1.1; letter-spacing: -.02em; color: var(--brand); }
.ct-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ct-stats .is-due { border-color: var(--bad-bd); background: var(--bad-bg); }
.ct-stats .is-due strong { color: var(--bad); }

.ct-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: #EFEBEA; border-radius: 12px; padding: 4px; }
.ct-tabs button { display: flex; align-items: center; justify-content: center; gap: 6px; border: none; background: transparent; border-radius: 9px; padding: 9px 6px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; min-width: 0; }
.ct-tabs button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-tabs button .ui-icon { width: 16px; height: 16px; }
.ct-tabs button b { font-size: 11px; background: var(--line); color: var(--text); border-radius: 999px; padding: 1px 7px; }
.ct-tabs button b.due { background: var(--bad); color: #fff; }
.ct-tabs button.on { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(60, 35, 40, .1); }

.ct-form { display: flex; flex-direction: column; gap: 14px; }
.ct-form-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ct-form-head h3 { font-size: 16px; }
.ct-clock { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 4px 10px; }
.ct-clock .ui-icon { width: 14px; height: 14px; }
.ct-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.ct-group legend { padding: 0; margin-bottom: 6px; }
.ct-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.ct-svc { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.ct-svc .ui-icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ct-svc.sel { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.ct-svc.sel .ui-icon { color: var(--brand); }
.ct-quick { display: flex; gap: 6px; overflow-x: auto; margin-top: -6px; padding-bottom: 2px; scrollbar-width: none; }
.ct-quick::-webkit-scrollbar { display: none; }
.ct-quick button { flex: none; border: 1px dashed var(--line-strong); background: #fff; color: var(--muted); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ct-quick button:active { background: var(--brand-tint); color: var(--brand); }
.ct-outcome { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ct-outcome button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text); cursor: pointer; }
.ct-outcome button .ui-icon { width: 20px; height: 20px; color: var(--muted); }
.ct-outcome .o-sale.sel { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.ct-outcome .o-follow.sel { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.ct-outcome .o-enq.sel { border-color: var(--info); background: var(--info-bg); color: var(--info); }
.ct-outcome .sel .ui-icon { color: currentColor; }
.ct-follow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: end; padding: 12px; border-radius: 12px; background: #FCFAF9; border: 1px solid var(--line); }
.ct-temp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ct-temp button { min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.ct-temp .t-hot.sel { border-color: var(--hot); background: var(--hot-bg); color: var(--hot); }
.ct-temp .t-warm.sel { border-color: var(--warm); background: var(--warm-bg); color: var(--warm); }
.ct-temp .t-cold.sel { border-color: var(--cold); background: var(--cold-bg); color: var(--cold); }
.ct-temp-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.ct-temp-pill.t-hot { color: var(--hot); background: var(--hot-bg); border-color: var(--hot-bd); }
.ct-temp-pill.t-warm { color: var(--warm); background: var(--warm-bg); border-color: var(--warm-bd); }
.ct-temp-pill.t-cold { color: var(--cold); background: var(--cold-bg); border-color: var(--cold-bd); }
#ct-sale-hint { display: flex; flex-direction: column; gap: 6px; }
#ct-sale-hint[hidden] { display: none; }
.ct-live-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ct-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #DC2626; animation: lvPulse 1.6s infinite; flex: none; }
.ct-actions { display: flex; gap: 8px; }
.ct-actions .btn-primary { flex: 1; }

.ct-rows { list-style: none; display: flex; flex-direction: column; }
.ct-row { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.ct-row:first-child { border-top: 0; }
.ct-row:hover, .ct-row:focus-visible { background: #FCF9F9; }
.ct-sr { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--brand); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.ct-row-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.ct-row-top { display: flex; justify-content: space-between; gap: 8px; }
.ct-row-top time { color: var(--muted); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ct-row-main p, .ct-fu p { font-size: 13.5px; color: #4A4144; overflow-wrap: anywhere; }
.ct-row-svc { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-row-svc span { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--brand-tint); color: var(--brand); }
.ct-row-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.ct-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 16px; color: var(--muted); }
.ct-empty > .ui-icon { width: 36px; height: 36px; color: var(--line-strong); }
.ct-empty strong { color: var(--text); }

.ct-sub { font-size: 14px; margin: 4px 2px 0; display: flex; align-items: center; gap: 8px; }
.ct-fu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ct-fu { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.ct-fu.t-hot { border-left-color: var(--hot); }
.ct-fu.t-warm { border-left-color: var(--warm); }
.ct-fu.t-cold { border-left-color: var(--cold); }
.ct-fu-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ct-fu-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.ct-fu-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ct-fu-meta .ui-icon { width: 13px; height: 13px; }
.ct-fu-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ct-fu-actions .btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.ct-fu-actions .btn .ui-icon { width: 15px; height: 15px; }
.ct-fu-actions .btn-primary { margin-left: auto; }
.ct-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ct-results button { min-height: 46px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; color: var(--text); padding: 6px 8px; }
.ct-results .sel { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.ct-results .r-converted.sel { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.ct-results .r-lost.sel { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.ct-detail { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ct-detail h4, #ct-fu-form h4 { font-size: 13px; margin-top: 4px; }
.ct-log { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ct-log time { color: var(--muted); font-size: 12px; margin-right: 4px; }
.ct-edit .ct-services { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* Live now (office): agents' forms as they type */
.lv-panel { border-color: var(--line); }
.lv-panel.has-typing { border-color: #FCA5A5; box-shadow: 0 0 0 3px rgba(220, 38, 38, .06); }
.lv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.lv-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.lv-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.has-typing .lv-pulse { background: #DC2626; animation: lvPulse 1.6s infinite; }
@keyframes lvPulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 70% { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.lv-empty { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; padding: 6px 2px; }
.lv-empty .ui-icon { width: 18px; height: 18px; }
.lv-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, box-shadow .2s; animation: lvIn .25s ease-out; }
@keyframes lvIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lv-card.is-typing { border-color: #FCA5A5; box-shadow: 0 4px 14px rgba(220, 38, 38, .08); }
.lv-card.is-idle { opacity: .82; }
.lv-card.is-saved { border-color: var(--ok-bd); background: linear-gradient(180deg, var(--ok-bg), #fff 60%); }
.lv-card header { display: flex; align-items: center; gap: 10px; }
.lv-card header > div { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.lv-card header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-card header small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-state { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.lv-state.typing { color: #B91C1C; background: #FEF2F2; }
.lv-state.typing i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: lvDot 1.2s infinite; }
.lv-state.typing i:nth-child(2) { animation-delay: .2s; }
.lv-state.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes lvDot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
.lv-state.idle { color: var(--muted); background: var(--bg); }
.lv-state.saved { color: var(--ok); background: #fff; border: 1px solid var(--ok-bd); }
.lv-state .ui-icon { width: 13px; height: 13px; }
.lv-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.lv-f { min-width: 0; padding: 6px 8px; border-radius: 8px; background: #FAF8F7; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.lv-f.wide { grid-column: 1 / -1; }
.lv-f dt { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lv-f dd { font-size: 13.5px; overflow-wrap: anywhere; min-height: 1.4em; }
.lv-f.is-active { background: #FFF7F7; border-color: #FCA5A5; }
.lv-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: text-bottom; background: #DC2626; animation: lvBlink 1s steps(1) infinite; }
@keyframes lvBlink { 50% { opacity: 0; } }
.lv-card footer { font-size: 11.5px; color: var(--muted); }

@media (max-width: 820px) {
  .ct-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ct-stats > div { padding: 8px; border-radius: 10px; }
  .ct-stats strong { font-size: 19px; }
  .ct-stats span { font-size: 10.5px; line-height: 1.2; }
  .ct-form { padding: 14px; }
  .ct-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-follow { grid-template-columns: 1fr; }
  .ct-shift-btns { width: 100%; }
  .ct-shift-btns .btn { flex: 1; justify-content: center; }
  .ct-actions { position: sticky; bottom: calc(var(--bottom-nav-h) + var(--safe-b) + 8px); background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); padding-top: 10px; margin: 0 -14px -14px; padding: 10px 14px 14px; border-radius: 0 0 var(--radius) var(--radius); }
  .keyboard-open .ct-actions { bottom: 0; }
  .ct-fu-list, .lv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .ct-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-tabs button { flex-direction: column; gap: 2px; font-size: 12px; padding: 7px 4px; }
  .ct-outcome button { font-size: 12.5px; }
  .ct-services { grid-template-columns: 1fr 1fr; }
  .ct-svc { font-size: 13px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .lv-pulse, .ct-live-dot, .lv-state.typing i, .lv-caret, .lv-card { animation: none !important; }
}
/* location help (sign-in and the "turn on location" screen): what is wrong + exact steps + Try again */
.geo-help { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--warn-bd); border-radius: 12px; background: var(--warn-bg); text-align: left; }
.geo-help-head { display: flex; gap: 10px; align-items: flex-start; }
.geo-help-head > .ui-icon { flex: none; width: 22px; height: 22px; color: var(--warn); margin-top: 1px; }
.geo-help-head strong { display: block; font-size: 15px; color: var(--text); }
.geo-help-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.geo-steps { margin: 0 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; line-height: 1.45; }
.geo-help .btn-block { min-height: 44px; justify-content: center; }
.geo-gate h2 { margin: 6px 0 14px; }
.geo-gate .geo-help { margin-bottom: 10px; }

/* outlet location search (Outlets & Areas → outlet form) */
.loc-search { display: flex; gap: 8px; margin: 8px 0; }
.loc-search .input { flex: 1; min-width: 0; }
.loc-results { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 220px; overflow: auto; }
.loc-result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: inherit; cursor: pointer; font: inherit; }
.loc-result:hover, .loc-result.active { border-color: var(--brand); background: var(--bg); }
.loc-result.active strong::before { content: '✓ '; color: var(--brand); }

/* outlet form: team section */
.team-now { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.agent-pick { margin: 8px 0 4px; }
.agent-pick-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.agent-pick-head .input { flex: 1; min-width: 180px; }
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row:last-child { border-bottom: none; }
.pick-row.on { background: var(--bg); }
.pick-row > span:last-child { text-align: right; }
.pick-list > p { padding: 10px 12px; margin: 0; }
.summary-cell.clickable { cursor: pointer; }
.summary-cell.clickable:hover { border-color: var(--brand); }
@media (max-width: 600px) { .pick-row { grid-template-columns: auto 1fr; } .pick-row > span:last-child { grid-column: 2; text-align: left; } }
.form .pick-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-weight: 400; margin: 0; text-align: left; }
.form .pick-row input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.form .agent-pick-head .check { margin: 0; flex-direction: row; }
@media (max-width: 600px) { .form .pick-row { grid-template-columns: auto 1fr; row-gap: 2px; } .form .pick-row > span:last-child { grid-column: 2; text-align: left; } }
.form-grid .span-2 { grid-column: 1 / -1; }
.spinner.spinner-xs { width: 12px; height: 12px; border-width: 2px; display: inline-block; vertical-align: -2px; }
/* admin dashboard: health lists */
.health-list { display: flex; flex-direction: column; }
.health-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.health-row:last-child { border-bottom: none; }
.health-row:hover { background: var(--bg); }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.health-row.warn .health-dot { background: #D97706; }
.health-row.bad .health-dot { background: var(--bad); }
.health-row.bad strong { color: var(--bad); }

/* ---------- e& Revenue ---------- */
.rev-status { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.rev-status > div:first-child { flex: 1 1 320px; min-width: 0; }
.rev-status h3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 17px; margin-bottom: 4px; }
.rev-basis { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg); border-radius: 10px; }
.rev-basis button { border: none; background: transparent; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.rev-basis button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.rev-basis button:disabled { opacity: .45; cursor: not-allowed; }
.rev-body { display: flex; flex-direction: column; gap: 16px; }
.rev-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.rev-grid th, .rev-grid td { white-space: nowrap; }
.rev-cat { font-weight: 700; text-align: center; vertical-align: middle !important; letter-spacing: .03em; }
.rev-tag { display: inline-block; min-width: 46px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; text-align: center; }
.rev-cat-MNP { background: var(--info-bg); color: var(--info); }
.rev-cat-NEW { background: var(--ok-bg); color: var(--ok); }
.rev-cat-P2P { background: var(--warn-bg); color: var(--warn); }
.rev-slab { font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle !important; color: var(--muted); background: #FAF8F7; letter-spacing: .04em; }
.data-table tr.rev-sub td { background: #FAF8F7; font-weight: 700; }
.data-table tr.rev-total td, .data-table tr.grand td { background: var(--brand); color: #fff; font-weight: 700; border-bottom-color: var(--brand); }
.data-table tr.rev-total:hover td, .data-table tr.grand:hover td { background: var(--brand); }
.data-table tr.rev-on td { background: var(--ok-bg); }
.rev-list td:last-child, .rev-list th:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rev-list tr.neg td:last-child { color: var(--bad); }
.rev-bars .bar-row { grid-template-columns: minmax(110px, 210px) 1fr 132px; font-size: 13px; }
.rev-bars .bar-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rev-bars .bar-val small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.rev-hints { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rev-hints li { padding: 10px 12px; border: 1px solid var(--ok-bd); background: var(--ok-bg); border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.rev-edit .form-section small { font-weight: 400; }
.rev-edit .data-table .input { min-width: 84px; }
.rev-edit .data-table td:first-child .input { min-width: 180px; }
.rev-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 260px; }
.rev-checks .check { font-size: 12.5px; white-space: nowrap; }
.rev-save { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.rev-save .form-actions { margin: 0; }
.rev-preview { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; font-size: 13.5px; }
.rev-preview strong { font-variant-numeric: tabular-nums; }
@media (min-width: 821px) {
  .rev-save { position: sticky; bottom: 0; z-index: 5; background: var(--card); margin: 0 -22px -22px; padding: 12px 22px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 14px rgba(60, 35, 40, .05); }
}
@media (max-width: 820px) {
  .rev-bars .bar-row { grid-template-columns: minmax(90px, 130px) 1fr 118px; }
  .rev-basis { width: 100%; }
  .rev-basis button { flex: 1 1 auto; }
}
.data-table.rev-grid.compact th, .data-table.rev-grid.compact td { padding: 8px 7px; font-size: 12.5px; }
.data-table.rev-grid.compact th { font-size: 10px; letter-spacing: .03em; }

/* ---------- multi-select in tables (Stock sheet: tick → Assign / Move) ---------- */
.data-table th.sel-col, .data-table td.sel-col { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
.data-table .sel-col input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--brand); }
.data-table tr.row-selected td { background: var(--brand-tint); }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 10px;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--bg); }
.bulk-bar.on { position: sticky; top: 0; z-index: 5; border-style: solid; border-color: var(--brand-light); background: var(--brand-tint); box-shadow: var(--shadow); }
.bulk-bar .bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 720px) {
  .data-table.cardify td.sel-col { width: auto; text-align: left; }
  .bulk-bar .bulk-actions .btn { flex: 1 1 auto; }
}
/* outlet form: agents here now, each can stay / move / be removed */
.here-list { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; max-height: 320px; overflow: auto; }
.here-row { display: grid; grid-template-columns: 1fr minmax(180px, 260px); gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.here-row:last-child { border-bottom: none; }
.here-row .input { margin: 0; padding-top: 6px; padding-bottom: 6px; }
.here-row.leaving { background: var(--warn-bg, #FFF7E6); }
.here-row.leaving strong { text-decoration: line-through; text-decoration-color: var(--muted); }
@media (max-width: 600px) { .here-row { grid-template-columns: 1fr; row-gap: 4px; } }
/* table row buttons sit side by side (two short rows) instead of one tall column */
.data-table td .row-actions { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px; justify-content: end; }
.data-table td .row-actions .btn { white-space: nowrap; padding: 4px 8px; min-height: 28px; font-size: 12px; }
.data-table td .row-actions .btn:only-child { grid-column: 1 / -1; }
/* status picker in a page header stays the size of its text, next to its button */
.page-head .actions select.input { width: auto; min-width: 150px; flex: 0 0 auto; }
/* Staff & Assignments has many columns: long headers may use two lines so the row buttons stay in view */
.staff-tbl .data-table th { white-space: normal; }

/* Sections drawn inside a page's body wrapper get the same spacing as the page itself */
main#main > #ct-body, main#main > #ns-body, main#main > #pf-body, main#main > #map-body { display: flex; flex-direction: column; gap: inherit; min-width: 0; }
.nowrap { white-space: nowrap; }
/* number-style columns keep the normal header font */
th.mono { font-family: inherit; font-size: inherit; }
/* IDs (S-001250, CI-…, DN-…) never break at the hyphen */
.data-table td[data-label="Sale ID"], .data-table td[data-label="ID"], .data-table td[data-label="Employee ID"], .data-table td[data-label="Agency ID"] { white-space: nowrap; }
/* status badges inside big headings keep normal letter spacing (headings are tightly spaced) */
h1 .pill, h2 .pill, h3 .pill { letter-spacing: normal; vertical-align: middle; font-size: 11px; line-height: 1.4; }
/* phones: the three Customer Interaction Leads tabs keep their full names (icons dropped to make room) */
@media (max-width: 480px) { .ct-tabs button > .ui-icon { display: none; } .ct-tabs button { padding: 9px 4px; gap: 5px; } }

/* Reports: read a report on screen (Excel / PDF optional) */
.report-quick { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.report-quick .input { min-width: 0; }
.report-view-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.report-view-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
/* admin dashboard: Workspace / Sales overview / Backend desk */
.dash-views { margin-bottom: 4px; }
/* Customer Interaction Leads: insights + funnel */
.ct-insights ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ct-insights li { padding: 8px 12px 8px 14px; border-left: 3px solid var(--line); border-radius: 6px; background: rgba(127,127,127,.06); line-height: 1.45; }
.ct-insights li.ins-ok { border-left-color: var(--ok, #1f9d55); }
.ct-insights li.ins-info { border-left-color: var(--info, #2b6cb0); }
.ct-insights li.ins-warn { border-left-color: var(--warn, #c88a04); }
.ct-insights li.ins-bad { border-left-color: var(--bad, #c53030); }
.ct-insights li.ins-muted { border-left-color: var(--muted); }
.ct-insights .card-head h3 { display: flex; align-items: center; gap: 6px; }
.ct-funnel { display: grid; gap: 8px; }
.ct-fn-row { display: grid; grid-template-columns: minmax(120px, 170px) 1fr 44px minmax(0, 120px); gap: 10px; align-items: center; font-size: 13px; }
.ct-fn-row.sub > span { padding-left: 12px; color: var(--muted); }
.ct-fn-row strong { text-align: right; }
.ct-fn-row small { color: var(--muted); }
@media (max-width: 600px) { .ct-fn-row { grid-template-columns: 1fr 40px; } .ct-fn-row .bar-track { grid-column: 1 / -1; order: 3; } .ct-fn-row small { display: none; } }
.text-warn { color: var(--warn); }
/* wide reports scroll sideways in the viewer instead of squeezing every cell */
.modal #rv-tbl td, .modal #rv-tbl th { white-space: nowrap; }

/* 2026-11-24: every row opens its details; full reports can be viewed on screen */
.modal-backdrop.modal-stack { z-index: 120; }
.data-table tbody tr.clickable:hover td { background: var(--brand-tint); }
.rec-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); padding: 4px 0 8px; }
.rec-grid .field { padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.rec-grid .field strong { white-space: pre-wrap; }
.report-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.btn-primary-soft { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary-soft:hover { background: var(--brand); color: #fff; }
.btn-primary-soft svg { width: 16px; height: 16px; }
@media (max-width: 700px) {
  .bn-item > span:last-child { white-space: normal; line-height: 1.1; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.kpi.kpi-link { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpi.kpi-link:hover, .kpi.kpi-link:focus-visible { border-color: var(--brand); box-shadow: 0 4px 14px rgba(91, 41, 46, .12); }
.kpi.kpi-link .kpi-label::after { content: ' ›'; color: var(--brand); font-weight: 800; }
.cell-link { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; font: inherit; color: var(--brand); font-weight: 700; cursor: pointer; border-radius: 6px; text-decoration: underline dotted; text-underline-offset: 3px; }
.cell-link:hover, .cell-link:focus-visible { background: var(--brand-tint); text-decoration: underline; }
.summary-cell.clickable.sel { outline: 2px solid var(--brand); }
.seg.comm-switch { display: inline-grid; grid-template-columns: auto auto; min-width: 240px; }
.seg.comm-switch button { padding: 8px 14px; }
