/* The CRM, the admin page and the login: one look, modelled on working tools rather than templates (Linear's
   neutral chrome and hairlines, Twenty / Attio's full-height record table, GitHub Primer's density).
   Black canvas, neutral greys, one accent: the platform's gold from the maps' wordmark, used for the current place
   and the main action only. Colour that carries meaning (stage, interest, kind, status) is always next to a word. */
:root {
  --bg: #000;
  --side: #0a0a0b;
  --raise: #0f0f11;
  --hover: #151518;
  --line: #1d1d21;
  --line-2: #2b2b30;
  --text: #ececee;
  --muted: #a0a0a8;
  --faint: #6b6b73;
  --accent: #c9ad72;
  --accent-ink: #17130a;
  --accent-soft: rgba(201, 173, 114, .12);
  --green: #74c08f; --amber: #d6a756; --red: #e07a74; --violet: #a99be3; --blue: #7fb2f0;
  --res: #4fa8ff; --com: #ff9a3c; /* the maps' colours for residential / commercial */
  --radius: 6px;
  --text-font: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --head-font: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --brand-font: "Aref Ruqaa", "IBM Plex Sans Arabic", serif;
  --side-w: 232px;
  --row: 44px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; }
body { font: 400 14px/1.55 var(--text-font); -webkit-font-smoothing: antialiased; }
bdi, .num { unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; font-family: var(--head-font); font-weight: 500; line-height: 1.35; letter-spacing: 0; }
h1 { font-size: 1.05rem; } h2 { font-size: .95rem; } h3 { font-size: .88rem; }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--muted); }
code { font: 400 .8rem/1.4 ui-monospace, "SF Mono", Menlo, monospace; direction: ltr; unicode-bidi: isolate; color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.svg-icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: .8rem; }

/* ---------------------------------------------------------------- shell ---- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side { display: flex; flex-direction: column; gap: 1px; padding: 14px 10px; background: var(--side); border-inline-end: 1px solid var(--line); overflow-y: auto; }
.brand { display: block; padding: 4px 10px 16px; text-decoration: none; color: var(--text); }
.brand__mark { display: none; }
.brand__name { font: 700 1.25rem/1.15 var(--brand-font); color: var(--accent); }
.brand__sub { font-size: .74rem; color: var(--faint); }
.nav-label { margin: 16px 10px 4px; font-size: .72rem; color: var(--faint); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius); background: none;
  color: var(--muted); font: 400 .88rem var(--text-font); text-decoration: none; cursor: pointer; text-align: start; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--hover); color: var(--text); box-shadow: inset -2px 0 0 var(--accent); }
.nav-item .count { margin-inline-start: auto; font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.side__foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.me__name { font-size: .86rem; } .me__role { font-size: .74rem; color: var(--faint); }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { flex: none; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 24px; border-bottom: 1px solid var(--line); }
.topbar__title { min-width: 0; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topbar__title p { margin: 0; color: var(--faint); font-size: .82rem; }
.topbar__actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.btn.menu-btn { display: none; }
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; display: grid; gap: 16px; align-content: start; }
.content > *, .stack > *, .card, .grid-2 > * { min-width: 0; }
/* a page whose job is one table: the table takes every pixel under the toolbar and scrolls inside */
.content.is-table { padding: 0; gap: 0; display: flex; flex-direction: column; overflow: hidden; }
.content.is-table > [data-pane]:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------------------------------------------------------- components ---- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.card__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card__head p { margin: 2px 0 0; color: var(--faint); font-size: .8rem; }
.card__head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.card__head > .kpi__icon { display: none; }
.card__body { padding: 16px; }
.card__foot { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: .82rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--raise); color: var(--text); font: 400 .85rem var(--text-font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: #3a3a40; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn--primary:hover { background: #d6bc84; border-color: #d6bc84; }
.btn--danger { color: var(--red); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn--ghost:hover { color: var(--text); background: var(--hover); border-color: transparent; }
.btn--sm { min-height: 28px; padding: 0 10px; font-size: .8rem; }
.btn--block { width: 100%; min-height: 38px; }
.icon-btn { position: relative; width: 32px; padding: 0; }
.badge { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent);
  color: var(--accent-ink); font: 500 .66rem/16px var(--text-font); text-align: center; }

.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: .76rem; color: var(--faint); }
.field small { color: var(--faint); font-size: .74rem; }
input, select, textarea { width: 100%; min-height: 32px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg);
  color: var(--text); font: 400 .86rem var(--text-font); }
select { cursor: pointer; }
textarea { padding: 8px 10px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: var(--faint); }
.input-icon { position: relative; } .input-icon .svg-icon { position: absolute; inset-inline-start: 10px; top: 50%; translate: 0 -50%; color: var(--faint); }
.input-icon input { padding-inline-start: 32px; }

/* words with a colour, never a colour alone */
.pill { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; font-size: .78rem; white-space: nowrap; background: rgba(255, 255, 255, .06); color: var(--muted); }
.s-جديد { color: var(--muted); }
.s-مؤهَّل { color: var(--blue); background: rgba(127, 178, 240, .1); }
.s-معاينة { color: var(--violet); background: rgba(169, 155, 227, .1); }
.s-حجز { color: var(--amber); background: rgba(214, 167, 86, .1); }
.s-مباع { color: var(--green); background: rgba(116, 192, 143, .1); }
.t-hot { color: var(--red); background: rgba(224, 122, 116, .1); } .t-warm { color: var(--amber); background: rgba(214, 167, 86, .1); } .t-cold { color: var(--faint); }
.st-available { color: var(--green); background: rgba(116, 192, 143, .1); } .st-reserved { color: var(--amber); background: rgba(214, 167, 86, .1); } .st-sold { color: var(--faint); }
.k-residential { color: var(--res); background: rgba(79, 168, 255, .1); } .k-commercial { color: var(--com); background: rgba(255, 154, 60, .1); }
.flag { color: var(--accent); background: var(--accent-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line-2); font-size: .78rem; color: var(--faint); }
.chip b { color: var(--text); font-weight: 400; }

.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--hover); color: var(--muted);
  font: 500 .74rem var(--head-font); }
.avatar--lg { width: 36px; height: 36px; font-size: .9rem; }

/* figures: a row of numbers split by hairlines (no tiles, no icons) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { display: grid; gap: 2px; padding: 12px 16px; text-align: start; background: none; border: 0; border-inline-start: 1px solid var(--line); color: var(--text); font: inherit; }
.kpi:first-child { border-inline-start: 0; }
.kpi__icon { display: none; }
.kpi__label { color: var(--faint); font-size: .78rem; }
.kpi__value { font: 500 1.35rem/1.25 var(--head-font); font-variant-numeric: tabular-nums; }
.kpi__hint { color: var(--faint); font-size: .74rem; }

/* saved views over a table: «الكل ٦ · بانتظار موظف ٢ …» */
.views { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.views button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border: 0; background: none; color: var(--muted);
  font: 400 .86rem var(--text-font); cursor: pointer; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent; }
.views button:hover { color: var(--text); }
.views button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.views .n { color: var(--faint); font-variant-numeric: tabular-nums; font-size: .8rem; }
.views__note { margin-inline-start: auto; align-self: center; color: var(--faint); font-size: .78rem; white-space: nowrap; padding-inline-start: 12px; }

/* the toolbar of a table: search, labelled filters, actions */
.toolbar { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.toolbar .input-icon { width: 260px; max-width: 100%; }
.tf { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius); height: 32px; overflow: hidden; }
.tf > span { display: grid; place-items: center; padding-inline: 10px; color: var(--faint); font-size: .78rem; white-space: nowrap; border-inline-end: 1px solid var(--line); }
.tf select { border: 0; border-radius: 0; min-height: 30px; width: auto; padding-inline: 8px; background-color: transparent; }
.tf:focus-within { border-color: var(--accent); }
.toolbar .end { margin-inline-start: auto; display: flex; gap: 6px; }

/* forms in cards (campaigns, usage) */
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; align-items: end; }
.filters__actions { display: flex; gap: 8px; align-items: end; }

/* tables */
.table-wrap { overflow: auto; }
.table-wrap.fill { flex: 1; min-height: 0; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .86rem; }
th { position: sticky; top: 0; z-index: 1; height: 34px; padding: 0 12px; text-align: start; font-weight: 400; font-size: .76rem; color: var(--faint); background: var(--bg);
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { height: var(--row); padding: 6px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-inline-start: 20px; } th:last-child, td:last-child { padding-inline-end: 20px; }
.card th:first-child, .card td:first-child { padding-inline-start: 16px; } .card th:last-child, .card td:last-child { padding-inline-end: 16px; }
.card tbody tr:last-child td { border-bottom: 0; }
tbody tr.is-link { cursor: pointer; } tbody tr:hover td, tbody tr.is-link:focus-visible td { background: var(--raise); } tbody tr.is-link:focus-visible { outline: none; }
th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
th button:hover { color: var(--text); } th button[data-dir="asc"]::after { content: "↑"; } th button[data-dir="desc"]::after { content: "↓"; }
th button[data-dir] { color: var(--text); }
td.wrap { white-space: normal; min-width: 240px; max-width: 420px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.nowrap { white-space: nowrap; }
.person { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.person__name { color: var(--text); } .person__sub { font-size: .76rem; color: var(--faint); }
.who { margin-inline-start: .4em; font-size: .78em; font-weight: 400; color: var(--faint); white-space: nowrap; }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .76rem; color: var(--faint); }
.legend__title { color: var(--faint); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-inline-end: 6px; }

.tablefoot { flex: none; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: .8rem; }
.pager { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }

.empty { display: grid; place-items: center; gap: 6px; padding: 56px 16px; text-align: center; color: var(--faint); font-size: .86rem; }
.empty .svg-icon { width: 22px; height: 22px; }
.empty b { color: var(--muted); font-weight: 400; }

/* drawer */
.drawer { position: fixed; inset: 0; margin: 0; padding: 0; width: 100%; max-width: none; height: 100%; max-height: none; border: 0; background: transparent; color: var(--text); }
.drawer::backdrop { background: rgba(0, 0, 0, .55); }
.drawer__panel { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--side);
  border-inline-start: 1px solid var(--line-2); }
.drawer__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 1.05rem; }
.drawer__head .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px 32px; display: grid; gap: 24px; align-content: start; }
.block { display: grid; gap: 10px; }
.block__title { display: flex; align-items: center; gap: 8px; font: 500 .84rem var(--head-font); color: var(--muted); }
.block__title .svg-icon { display: none; }
.block__title small { margin-inline-start: auto; font: 400 .74rem var(--text-font); color: var(--faint); }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
.step { position: relative; height: 34px; padding: 0 4px; border: 0; border-inline-start: 1px solid var(--line-2); background: var(--bg); color: var(--faint);
  font: 400 .82rem var(--text-font); cursor: pointer; }
.step:first-child { border-inline-start: 0; }
.step.is-done { color: var(--muted); background: var(--raise); }
.step[aria-checked="true"] { color: var(--accent-ink); background: var(--accent); }
.step:hover:not(:disabled):not([aria-checked="true"]) { color: var(--text); }
.step:disabled { opacity: .4; cursor: not-allowed; }

.banner { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--raise); }
.banner > .svg-icon { color: var(--accent); }
.banner--warn { border-color: rgba(201, 173, 114, .35); }
.banner--ok > .svg-icon { color: var(--green); } .banner--bad { border-color: rgba(224, 122, 116, .45); } .banner--bad > .svg-icon { color: var(--red); }
.banner p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; } .banner .grow { flex: 1; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.facts div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.facts dt { font-size: .74rem; color: var(--faint); } .facts dd { margin: 2px 0 0; }

.note { padding: 0; } .note p { margin: 0; line-height: 1.7; } .note .next { margin-top: 6px; color: var(--muted); font-size: .84rem; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; font-size: .84rem; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 16px; height: 16px; display: grid; place-items: center; color: var(--faint); align-self: center; }
.timeline .dot .svg-icon { width: 14px; height: 14px; }
.timeline time { color: var(--faint); font-size: .74rem; white-space: nowrap; }

.chat { list-style: none; margin: 0; padding: 12px; display: grid; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  max-height: 440px; overflow-y: auto; }
.msg { max-width: 84%; display: grid; gap: 3px; }
.msg__who { font-size: .72rem; color: var(--faint); }
.msg__text { padding: 7px 11px; border-radius: 10px; white-space: pre-wrap; font-size: .86rem; line-height: 1.55; }
.msg--in { justify-self: start; } .msg--in .msg__text { background: var(--hover); }
.msg--out { justify-self: end; } .msg--out .msg__who { text-align: end; } .msg--out .msg__text { background: #1b1913; border: 1px solid #2c271b; }

/* alerts */
.popover { position: fixed; top: 48px; inset-inline-end: 16px; z-index: 20; width: min(380px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--side); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, .7); }
.popover .card__head { padding: 10px 14px; }
.popover__list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.alert-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 4px; background: none; color: var(--muted); font: inherit; font-size: .84rem;
  text-align: start; cursor: pointer; border-inline-start: 2px solid transparent; }
.alert-item b { color: var(--text); font-weight: 400; }
.alert-item:hover { background: var(--hover); }
.alert-item.is-new { border-inline-start-color: var(--accent); }
.alert-item .kpi__icon { display: none; }
.alert-item time { display: block; color: var(--faint); font-size: .72rem; }

/* dialog */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); width: min(460px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0, 0, 0, .6); }
.modal .card { background: var(--side); border-color: var(--line-2); }
.modal .card__body { display: grid; gap: 12px; }
.pick { list-style: none; margin: 0; padding: 0; display: grid; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.pick:empty { display: none; }
.pick li + li { border-top: 1px solid var(--line); }
.pick button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.pick button:hover { background: var(--hover); }

.toast { position: fixed; inset-inline: 0; bottom: 20px; z-index: 30; width: fit-content; max-width: calc(100vw - 32px); margin: auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius); background: var(--text); color: #000; font-size: .86rem;
  opacity: 0; translate: 0 6px; transition: opacity .15s, translate .15s; pointer-events: none; }
.toast.is-on { opacity: 1; translate: 0 0; }

.err { margin: 0; min-height: 1.3em; color: var(--red); font-size: .82rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.out-box { display: grid; gap: 4px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); }
.out-box > span { font-size: .74rem; color: var(--faint); }
.out-box pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: .86rem; }

.funnel { display: flex; height: 6px; width: 100%; min-width: 120px; border-radius: 3px; overflow: hidden; background: var(--hover); }
.funnel span { height: 100%; }
.f1 { background: #4a4a52; } .f2 { background: var(--blue); } .f3 { background: var(--violet); } .f4 { background: var(--green); }

.chart svg { width: 100%; height: 220px; display: block; }
.chart text { fill: var(--faint); font: 400 11px var(--text-font); }
.chart .grid line { stroke: var(--line); }
.chart rect.bar { fill: var(--accent); opacity: .85; } .chart rect.bar:hover { opacity: 1; }

.status-select { width: auto; min-width: 110px; padding-inline-start: 26px; background-repeat: no-repeat; }
.status-select[data-status] { background-image: radial-gradient(circle, var(--dot) 0 3.5px, transparent 4.5px); background-size: 12px 12px; background-position: right 9px center; }
.status-select[data-status="available"] { --dot: var(--green); } .status-select[data-status="reserved"] { --dot: var(--amber); } .status-select[data-status="sold"] { --dot: var(--faint); }
tr.is-saving { opacity: .5; }

.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); flex-wrap: wrap; }
.seg button { min-height: 26px; padding: 0 10px; border: 0; border-radius: 4px; background: none; color: var(--muted); font: 400 .8rem var(--text-font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--text); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); background: var(--side); }
.login .card__body { display: grid; gap: 16px; padding: 28px; }
.login .brand { padding: 0; }

/* ---------------------------------------------------------------- phones ---- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 25; width: min(280px, 86vw); translate: 100% 0; transition: translate .2s; }
  .app.is-menu-open .side { translate: 0 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .6); }
  .btn.menu-btn { display: inline-flex; }
  .topbar { padding: 8px 16px; } .content { padding: 16px 16px 40px; }
  .views, .toolbar, .tablefoot { padding-inline: 16px; } th:first-child, td:first-child { padding-inline-start: 16px; } th:last-child, td:last-child { padding-inline-end: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; } .filters .field--search { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .topbar__title p { display: none; }
  .btn .label-wide { display: none; }
  .views__note { display: none; }
  .toolbar .input-icon { width: 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(odd) { border-inline-start: 0; } .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .facts { grid-template-columns: 1fr; }
  /* the leads table becomes a list */
  .cards-on-phone thead { display: none; }
  .cards-on-phone tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .cards-on-phone td { height: auto; padding: 0 !important; border: 0; }
  .cards-on-phone td[data-col="name"] { grid-column: 1; } .cards-on-phone td[data-col="stage"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .cards-on-phone td[data-col]:not([data-col="name"]):not([data-col="stage"]) { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
  .cards-on-phone td[data-col]::before { content: attr(data-label) ": "; color: var(--faint); }
  .cards-on-phone td[data-col="name"]::before, .cards-on-phone td[data-col="stage"]::before { content: none; }
  .cards-on-phone td[data-col="note"], .cards-on-phone td[data-col="code"] { display: none; }
  .step { font-size: .74rem; }
}
