/* Estate CRM - styles.
   Palette comes from the Costa del Sol itself: whitewashed walls (chalk), deep sea (sea),
   and bougainvillea (the single accent, used for things that need attention). */
:root {
  --chalk: #f3f5f4;
  --surface: #ffffff;
  --ink: #13232e;
  --ink-2: #4b5c68;
  --ink-3: #75858f;
  --line: #dce3e6;
  --line-2: #ebf0f2;
  --sea: #0e5a78;
  --sea-hover: #0a465d;
  --sea-deep: #0a2f44;
  --sea-tint: #e3eff4;
  --bougain: #b4306a;
  --bougain-tint: #fbe8f0;
  --ok: #2b7a57;
  --ok-tint: #e2f2ea;
  --warn: #9a5a0c;
  --warn-tint: #fbf0dc;
  --radius: 8px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overscroll-behavior-x: none; }
body { overflow-x: hidden; overscroll-behavior-x: none; margin: 0; background: var(--chalk); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font: 500 28px/1.2 var(--serif); letter-spacing: -0.01em; }
h2 { font-size: 16px; }
a { color: var(--sea); text-underline-offset: 2px; }
small { color: var(--ink-3); display: block; font-size: 12.5px; }
.muted { color: var(--ink-3); }
.tiny { font-size: 12.5px; }
.pad { padding: 24px 0; }
.icon { flex: none; vertical-align: -4px; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--sea-deep); color: #cfe0e8; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .3) transparent; }
.sidebar > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 500 21px/1 var(--serif);
  padding: 4px 10px 22px; }
.brand-mark { width: 16px; height: 21px; background: #fff; border-radius: 8px 8px 1px 1px; position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; right: -4px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--bougain); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar a[data-nav] { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius);
  color: #cfe0e8; text-decoration: none; font-weight: 500; }
.sidebar a[data-nav]:hover { background: rgba(255, 255, 255, .07); }
.sidebar a[data-nav].active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-admin { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
.account { margin-top: auto; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit;
  padding: 8px 10px; border-radius: var(--radius); cursor: pointer; text-align: left; font: inherit; }
.account:hover { background: rgba(255, 255, 255, .07); }
.account .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.account b { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account small { color: #9fb7c4; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sea); color: #fff; display: inline-grid; place-items: center;
  font-weight: 600; flex: none; }
.main-col { min-width: 0; }
#view { padding: 28px 36px 64px; }
.view-inner { max-width: 1240px; }
.view-inner:has(.board) { max-width: none; }
.account-mobile, .tabbar { display: none; }
.offline { background: var(--bougain-tint); color: var(--bougain); padding: 8px 16px; text-align: center; font-weight: 500;
  position: sticky; top: 0; z-index: 20; }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--ink-2); }
.back:hover { background: var(--line-2); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { flex: 1 1 240px; max-width: 380px; display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; color: var(--ink-3); }
.search input { border: 0; outline: 0; background: none; flex: 1; padding: 9px 0; font: inherit; color: var(--ink); min-width: 0; }
.search:focus-within { border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-tint); }
.inline-check { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.panel h2 { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.empty { text-align: center; padding: 56px 16px; color: var(--ink-2); }
.empty h2 { font: 500 22px/1.3 var(--serif); color: var(--ink); margin-bottom: 6px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--radius); font: 500 14px/1.3 var(--sans); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--line-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn-primary:hover { background: var(--sea-hover); }
.btn-danger { background: var(--bougain); border-color: var(--bougain); color: #fff; }
.btn-danger:hover { background: #962758; }
.btn-danger-quiet { color: var(--bougain); border-color: #ecc5d6; }
.btn-danger-quiet:hover { background: var(--bougain-tint); }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.icon-btn { background: none; border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--ink-3);
  display: inline-grid; place-items: center; font-size: 22px; line-height: 1; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.link-btn { background: none; border: 0; color: var(--bougain); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0 0 0 8px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 10px; width: 100%; min-width: 0; }
.toolbar select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--sea); box-shadow: 0 0 0 3px var(--sea-tint); }
input[type=checkbox] { width: auto; accent-color: var(--sea); }
textarea { resize: vertical; }
label { font-weight: 500; color: var(--ink-2); font-size: 13.5px; }
.field { display: grid; gap: 4px; align-content: start; }
.field.check label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink); }
.hint { margin-top: 2px; }
.form-error { color: var(--bougain); background: var(--bougain-tint); padding: 8px 12px; border-radius: var(--radius); margin: 12px 0 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--sea-tint);
  color: var(--sea-hover); margin-right: 4px; white-space: nowrap; }
.badge.ok { background: var(--ok-tint); color: var(--ok); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.muted { background: var(--line-2); color: var(--ink-3); }
.badge.info { background: var(--sea-tint); color: var(--sea); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; align-items: center; }
.ref { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; margin-right: 6px; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none;
  color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.kpi:hover { border-color: var(--sea); }
.kpi b { font: 500 30px/1.1 var(--serif); }
.kpi span { color: var(--ink-2); font-size: 13.5px; }
.kpi.alert b { color: var(--bougain); }
.stage-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stage-bars a { display: grid; grid-template-columns: 110px 1fr 28px; gap: 10px; align-items: center; color: var(--ink); text-decoration: none; }
.stage-bars .bar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.stage-bars i { display: block; height: 100%; background: var(--stage); border-radius: 5px; }
.scount { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- stage colours (pipeline ramp: pale sea -> deep sea, won green, lost grey) ---------- */
.stage-new { --stage: #9cc3d5; } .stage-contacted { --stage: #6ba6c2; } .stage-viewing { --stage: #3d87ab; }
.stage-offer { --stage: #1f6e94; } .stage-reservation { --stage: #0e5a78; } .stage-won, .stage-completed, .stage-rented { --stage: #2b7a57; } .stage-application { --stage: #1f6e94; } .stage-contract { --stage: #0e5a78; } .stage-lost { --stage: #8a949b; }
.badge[class*="stage-"] { background: color-mix(in srgb, var(--stage) 22%, white); color: var(--ink); }

/* ---------- tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #f8fafb; }
.table td a { text-decoration: none; color: var(--ink); }
.table.compact td, .table.compact th { padding: 7px 12px; font-size: 13.5px; }

/* ---------- property cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.prop-card { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--sea); border-radius: 10px;
  padding: 14px 16px; text-decoration: none; color: var(--ink); }
.prop-card:hover { border-color: var(--sea); box-shadow: 0 2px 12px rgba(10, 47, 68, .08); }
.prop-card.status-reserved { border-left-color: #d29a3a; }
.prop-card.status-sold, .prop-card.status-rented, .prop-card.status-withdrawn { border-left-color: #b4bec4; }
.prop-card.status-available { border-left-color: var(--ok); }
.prop-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.prop-card h3 { font: 500 18px/1.3 var(--serif); margin-bottom: 2px; }
.prop-card .loc { margin: 0; color: var(--ink-2); }
.prop-card .price { margin: 8px 0 4px; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.prop-card .facts { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.prop-card .coop { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--warn); }
.big-price { font: 500 26px/1.2 var(--serif); margin: 4px 0 12px; }
.desc { white-space: pre-wrap; color: var(--ink-2); }

.facts-list { margin: 0; display: grid; gap: 8px; }
.facts-list > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; }
.facts-list dt { color: var(--ink-3); font-size: 13.5px; }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

/* ---------- lists in panels ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; border-top: 1px solid var(--line-2); }
.rows li:first-child { border-top: 0; }
.row-main { flex: 1; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; padding: 10px 4px;
  font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.row-main:hover { background: #f8fafb; }
.grow { flex: 1; min-width: 0; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); align-items: baseline; }
.task:first-child { border-top: 0; }
.task .check { display: flex; gap: 10px; align-items: baseline; color: var(--ink); font-size: 15px; font-weight: 400; cursor: pointer; }
.task.done .check span { text-decoration: line-through; color: var(--ink-3); }
.task .meta { display: flex; gap: 10px; color: var(--ink-3); font-size: 13px; white-space: nowrap; flex-wrap: wrap; justify-content: flex-end; }
.task.overdue .due { color: var(--bougain); font-weight: 600; }
.task .meta a { color: var(--sea); text-decoration: none; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; justify-items: start; }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notes li { border-left: 3px solid var(--line); padding-left: 12px; }
.notes p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px;
  align-items: start; scroll-snap-type: x proximity; }
.column { background: #e8eef0; border-radius: 10px; border-top: 4px solid var(--stage); scroll-snap-align: start; min-height: 120px; }
.column header { padding: 10px 12px 4px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
.column header small { grid-column: 1 / -1; min-height: 1.3em; }
.column h2 { font-size: 14.5px; }
.count { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.column-body { padding: 6px 8px 10px; display: grid; gap: 8px; min-height: 60px; border-radius: 0 0 10px 10px; }
.column-body.over { background: color-mix(in srgb, var(--stage) 18%, #e8eef0); }
.deal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px;
  cursor: grab; font-size: 14px; }
.deal:hover { border-color: var(--sea); }
.deal.dragging { opacity: .45; }
.deal .muted { font-size: 13px; }
.deal-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.deal select.move { margin-top: 6px; padding: 4px 6px; font-size: 12.5px; color: var(--ink-2); border-color: var(--line-2); }

/* ---------- dialogs ---------- */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(720px, 94vw); max-height: 92vh; color: var(--ink);
  box-shadow: 0 20px 60px rgba(10, 47, 68, .3); }
dialog.modal.small { width: min(440px, 94vw); }
dialog.modal::backdrop { background: rgba(10, 47, 68, .5); }
.modal-body { padding: 20px 24px 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { font: 500 21px/1.2 var(--serif); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.span-2 { grid-column: 1 / -1; }
.form-heading { grid-column: 1 / -1; font-size: 13.5px; color: var(--sea); margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.confirm-text { margin: 0 0 4px; font-size: 15.5px; }
.menu { display: grid; gap: 2px; margin-top: 8px; }
.menu button, .menu a { display: flex; gap: 12px; align-items: center; padding: 11px 10px; border: 0; background: none; border-radius: var(--radius);
  font: inherit; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--line-2); }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; justify-items: center; }
.toast { background: var(--sea-deep); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 500; box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
  animation: pop .18s ease-out; max-width: 90vw; }
.toast.error { background: var(--bougain); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 30px 24px;
  box-shadow: 0 10px 40px rgba(10, 47, 68, .08); }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 500 24px/1 var(--serif); color: var(--sea-deep); }
.auth-brand .brand-mark { background: var(--sea-deep); }
.tagline { color: var(--ink-3); margin: 6px 0 22px; }
.auth h1 { font-size: 22px; margin-bottom: 8px; }
.auth form { display: grid; gap: 14px; margin-top: 14px; }
.auth-lang { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--ink-3); }
.auth-lang select { width: auto; border-color: transparent; background: transparent; padding: 4px 6px; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two-col, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  html, body { max-width: 100%; touch-action: pan-y; }   /* the page may scroll up and down, never sideways or by pinching */
  .shell { display: block; }
  .sidebar { display: none; }
  #view { padding: 16px 14px 96px; }
  h1 { font-size: 24px; }
  .page-head { padding-right: 46px; }
  .account-mobile { display: flex; flex-direction: column; align-items: center; gap: 6px; position: absolute; top: 12px; right: 12px; background: none; border: 0; padding: 0; z-index: 10; cursor: pointer; }
  .account-mobile .avatar { width: 46px; height: 46px; font-size: 19px; }
  .account-logo { display: block; max-width: 78px; max-height: 34px; object-fit: contain; }
  .shell.has-logo .page-head { min-height: 96px; align-items: flex-start; }
  .page-head { padding-right: 90px; }
  .main-col { position: relative; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line);
    padding: 10px 4px calc(4px + env(safe-area-inset-bottom)); z-index: 30; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; flex: 1 0 64px; font-size: 11.5px; color: var(--ink-3);
    text-decoration: none; border-radius: var(--radius); min-width: 64px; transition: transform .12s ease; transform-origin: 50% 100%; }
  .tabbar a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .tabbar a.active { color: var(--sea); font-weight: 600; }
  #toasts { bottom: 84px; }
  .form-grid { grid-template-columns: 1fr; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .facts-list > div { grid-template-columns: 110px 1fr; }
  .board { grid-auto-flow: row; grid-auto-columns: 100%; overflow: visible; }
  .column.is-empty { min-height: 0; }
  .column.is-empty .column-body, .column.is-empty header small { display: none; }
  .column.is-empty header { padding-bottom: 10px; }
  /* tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 2px 0; display: flex; gap: 10px; }
  .table td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; min-width: 84px; flex: none; }
  .table td:first-child::before { display: none; }
  .table td:not([data-label])::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } * { scroll-behavior: auto !important; } }
@media print { .sidebar, .tabbar, .actions, .toolbar { display: none !important; } .shell { display: block; } }


/* ---------- background: Costa del Sol, kept quiet so it never competes with the work ---------- */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(243, 245, 244, var(--bg-a1, .53)), rgba(243, 245, 244, var(--bg-a2, .61))), var(--bg-img, url("/img/costa-1000.webp")) center / cover no-repeat; }
:root { --login-img: url("/img/costa-1000.webp"); }
@media (min-width: 1100px) {
  :root { --bg-img: url("/img/costa-2000.webp"); --login-img: url("/img/costa-2000.webp"); }
}
.auth-photo { position: relative; isolation: isolate; }
.auth-photo::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(rgba(10, 47, 68, .10), rgba(10, 47, 68, .38)), var(--login-img) center / cover no-repeat; }
.auth-photo .auth-card { background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); box-shadow: 0 10px 40px rgba(10, 47, 68, .28); }
.toolbar, .page-head { text-shadow: none; }
.page-head h1 { background: rgba(255, 255, 255, .72); padding: 2px 10px; border-radius: 8px; width: fit-content; flex: 0 1 auto; }
.table-wrap, .empty { background: var(--surface); }
.empty { border-radius: 10px; border: 1px solid var(--line); }

/* ---------- tabs (segmented control) ---------- */
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; padding: 7px 18px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.tabs button.on { background: var(--sea); color: #fff; }
.tabs button:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

/* ---------- reports: progress and funnel ---------- */
.progress-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.progress-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); }
.progress-card header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-card h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.metric { margin: 10px 0 12px; }
.m-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.m-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.m-top .of { color: var(--ink-3); font-weight: 400; }
.meter { height: 8px; background: var(--line-2); border-radius: 4px; overflow: hidden; margin: 5px 0 3px; }
.meter i { display: block; height: 100%; background: var(--sea); border-radius: 4px; }
.meter i.ok { background: var(--ok); }
.m-sub { font-size: 12.5px; color: var(--ink-2); }
.in-pipe { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--sea-deep); font-weight: 600; }
.tiny { font-size: 12.5px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar.tight { margin: 0; }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.funnel { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.frow { display: grid; grid-template-columns: 120px 1fr 96px 88px; gap: 10px; align-items: center; font-size: 14px; }
.frow.fhead { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.fbar { position: relative; height: 28px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.fbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--stage); border-radius: 6px; }
.fbar b { position: relative; padding-left: 10px; line-height: 28px; color: var(--ink); mix-blend-mode: normal; }
.fconv { font-weight: 600; font-variant-numeric: tabular-nums; }
.fconv.weak { color: var(--bougain); }
.fdays { color: var(--ink-3); font-size: 12.5px; }
.hint-line { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: 13px; }
.lost-box { margin-top: 16px; }
.lost-box h3 { font-size: 14px; margin-bottom: 6px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
ul.plain li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-2); padding: 3px 0; }
.pipe-block + .pipe-block { margin-top: 16px; }
.pipe-block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-bottom: 8px; }

/* ---------- photos ---------- */
.prop-cover { display: block; width: calc(100% + 0px); height: 150px; object-fit: cover; border-radius: 6px; margin-bottom: 10px; background: var(--line-2); }
.gallery { margin-bottom: 14px; }
.gallery-main { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: var(--line-2); }
.gallery-strip { display: flex; gap: 6px; margin-top: 6px; overflow-x: auto; padding-bottom: 4px; }
.gallery-strip button { border: 2px solid transparent; padding: 0; border-radius: 6px; background: none; cursor: pointer; flex: 0 0 auto; }
.gallery-strip button.on { border-color: var(--sea); }
.gallery-strip img { display: block; width: 84px; height: 56px; object-fit: cover; border-radius: 4px; }
.gallery-cap { margin: 4px 0 0; min-height: 1em; }
.photo-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid li { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); }
.photo-grid img { display: block; width: 100%; height: 96px; object-fit: cover; border-radius: 5px; }
.photo-grid .cap { width: 100%; margin-top: 6px; font-size: 13px; padding: 5px 7px; }
.photo-tools { display: flex; justify-content: space-between; margin-top: 4px; }
.cover-tag { position: absolute; top: 10px; left: 10px; background: var(--sea); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.highlights { margin: 10px 0; padding-left: 20px; }
.highlights li::marker { color: var(--sea); }
.static { padding: 8px 10px; background: var(--sea-tint); border-radius: 6px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.modal-actions.wrap { flex-wrap: wrap; }
.form-heading { margin-top: 6px; }
.field[hidden], .form-heading[hidden] { display: none; }

/* ---------- exposé ---------- */
.expose-controls { display: grid; grid-template-columns: 220px 1fr; gap: 14px 18px; align-items: end; margin-bottom: 18px; }
.expose-controls p { grid-column: 1 / -1; margin: 0; }
.xpages { display: grid; gap: 18px; justify-items: center; }
.xpage { container-type: inline-size; position: relative; width: min(100%, 794px); aspect-ratio: 210 / 297; background: #fff; overflow: hidden;
  box-shadow: 0 4px 24px rgba(10, 47, 68, .18); color: var(--ink); break-after: page; page-break-after: always; }
.xpage * { box-sizing: border-box; }
.xpage > * { font-size: 1.9cqw; line-height: 1.55; }
.xcover .xhero { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.xhero-empty { background: linear-gradient(135deg, #0a2f44, #1f6e94); }
.xcover-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 30, 44, .92) 0%, rgba(8, 30, 44, .55) 38%, rgba(8, 30, 44, 0) 70%); }
.xcover-text { position: absolute; left: 7cqw; right: 7cqw; bottom: 17cqw; color: #fff; }
.xkicker { margin: 0 0 2cqw; font-size: 1.7cqw; letter-spacing: .18em; text-transform: uppercase; opacity: .9; }
.xcover h1 { font: 500 6.4cqw/1.12 var(--serif); color: #fff; background: none; padding: 0; }
.xplace { margin: 1.6cqw 0 0; font-size: 2.6cqw; opacity: .95; }
.xprice { margin: 3cqw 0 0; font: 500 5.4cqw/1 var(--serif); }
.xcover-for { position: absolute; left: 7cqw; right: 7cqw; bottom: 5cqw; color: #fff; display: grid; border-top: .2cqw solid rgba(255, 255, 255, .5); padding-top: 2cqw; }
.xcover-for p { margin: 0; font-size: 1.6cqw; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.xcover-for b { font: 500 3cqw/1.3 var(--serif); }
.xcover-for small { opacity: .8; font-size: 1.6cqw; }
.xbody { padding: 8cqw 7cqw 9cqw; }
.xbody h2 { font: 500 3.4cqw/1.2 var(--serif); color: var(--sea-deep); margin: 0 0 2cqw; padding-bottom: 1.2cqw; border-bottom: .2cqw solid var(--sea); }
.xbody h2:not(:first-child) { margin-top: 5cqw; }
.xwhy { background: var(--sea-tint); border-left: .8cqw solid var(--sea); padding: 3cqw 3.5cqw; margin-bottom: 5cqw; border-radius: .8cqw; }
.xwhy h2 { border: 0; padding: 0; margin: 0 0 1.4cqw; font-size: 3cqw; }
.xwhy ul, .xhl { margin: 0; padding-left: 3cqw; }
.xwhy li::marker, .xhl li::marker { color: var(--sea); }
.xtext p { margin: 0 0 1.6cqw; }
.xband { display: block; width: 100%; height: 30cqw; object-fit: cover; border-radius: .8cqw; margin-top: 5cqw; }
.xfacts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4cqw 3cqw; }
.xfact { display: flex; justify-content: space-between; border-bottom: .15cqw solid var(--line); padding: 1.2cqw 0; }
.xfact span { color: var(--ink-2); }
.xfact.wide { grid-column: 1 / -1; font: 500 2.6cqw var(--serif); }
.xplace2 { margin: 0 0 1.5cqw; font-weight: 600; }
.xdist { margin: 0; padding-left: 3cqw; columns: 2; }
.xvideo { margin-top: 4cqw; color: var(--ink-2); word-break: break-all; }
.xgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; }
.xgrid figure { margin: 0; }
.xgrid img { display: block; width: 100%; height: 38cqw; object-fit: cover; border-radius: .8cqw; }
.xgrid figcaption { font-size: 1.5cqw; color: var(--ink-2); margin-top: .6cqw; }
.xfoot { position: absolute; left: 7cqw; right: 7cqw; bottom: 3.6cqw; display: flex; justify-content: space-between; font-size: 1.4cqw; color: var(--ink-3); border-top: .15cqw solid var(--line); padding-top: 1cqw; }
.xadvisor { font-size: 2.6cqw; }
.xadvisor b { font: 500 3.4cqw var(--serif); }
.xadvisor p { margin: .4cqw 0; }
.xcta { margin: 5cqw 0 0; font: 500 3cqw/1.4 var(--serif); color: var(--sea-deep); }
.xdisc { margin-top: 14cqw; font-size: 1.45cqw; color: var(--ink-3); line-height: 1.5; }
.xlegal { font-size: 1.4cqw; color: var(--ink-3); }

@media (max-width: 900px) {
  .progress-grid { grid-template-columns: 1fr; }
  .expose-controls { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .frow { grid-template-columns: 76px 1fr 46px; }
  .frow .fdays { display: none; }
  .frow.fhead span:nth-child(4) { display: none; }
  .tabbar a { font-size: 10.5px; padding: 6px 1px; flex-basis: 58px; min-width: 58px; }
  .kpis-3 { grid-template-columns: 1fr 1fr 1fr; }
}
@media print {
  @page { size: A4; margin: 0; }
  body::before { display: none; }
  body, .main-col, .view-inner { background: #fff !important; }
  .shell { display: block; } .main-col { margin: 0; padding: 0; }
  .page-head, .expose-controls, .offline, .account-mobile, .toast { display: none !important; }
  .view-inner { padding: 0; max-width: none; }
  .xpages { display: block; }
  .xpage { width: 210mm; height: 297mm; box-shadow: none; margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #view { padding: 0 !important; }
}

.brand-logo { max-height: 34px; max-width: 150px; object-fit: contain; flex: none; }
.auth-brand .brand-logo { max-height: 44px; max-width: 220px; }
.brand-upload { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-2); }
.brand-upload:first-of-type { border-top: 0; }
.brand-upload .preview { width: 120px; height: 64px; border: 1px dashed var(--line); border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: var(--chalk); color: var(--ink-3); font-size: 12px; }
.brand-upload .preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-upload .preview.cover img { object-fit: cover; }
.brand-upload > div:nth-child(2) { flex: 1; min-width: 200px; }
.xlogo { position: absolute; left: 7cqw; top: 6cqw; height: 8cqw; max-width: 28cqw; object-fit: contain; background: rgba(255, 255, 255, .92); padding: 1.2cqw 1.8cqw; border-radius: .9cqw; }

.brand:has(+ .sidebar-logo) { padding-bottom: 12px; }
.sidebar-logo { margin: 0 4px 18px; padding: 14px 12px; background: #fff; border-radius: 12px; display: grid; place-items: center; }
.sidebar-logo img { display: block; max-width: 100%; max-height: 96px; object-fit: contain; }
.colour-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 10px; }
.colour-field { display: grid; gap: 6px; font-size: 13.5px; }
.colour-field input[type=color] { width: 100%; height: 42px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.preset { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 12px 5px 6px; font: inherit; font-size: 13px; cursor: pointer; }
.preset:hover { border-color: var(--sea); }
.preset i { display: inline-flex; }
.preset i b { width: 14px; height: 22px; display: block; }
.preset i b:first-child { border-radius: 11px 0 0 11px; } .preset i b:last-child { border-radius: 0 11px 11px 0; }
.contrast-warn { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
@media (max-width: 760px) { .colour-grid { grid-template-columns: 1fr; } }

/* Font selection */
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 10px 0 4px; }
.font-opt { position: relative; cursor: pointer; }
.font-opt input { position: absolute; opacity: 0; inset: 0; }
.font-card { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line, #d9dde0); border-radius: 10px; background: #fff; height: 100%; }
.font-card b { font-weight: 500; font-size: 17px; line-height: 1.2; }
.font-card i { font-style: normal; font-size: 14px; color: var(--sea-deep); }
.font-card small { font-size: 12.5px; color: #5b666d; }
.font-opt input:checked + .font-card { border-color: var(--sea); box-shadow: 0 0 0 2px var(--sea); background: var(--sea-tint); }
.font-opt input:focus-visible + .font-card { outline: 2px solid var(--bougain); outline-offset: 2px; }

/* Agent photo */
.xadvisor { display: flex; gap: 3cqw; align-items: center; }
.xphoto { width: 22cqw; height: 22cqw; object-fit: cover; border-radius: 50%; flex: none; border: .5cqw solid var(--sea); }
.avatar-preview { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; margin: 10px auto; background: var(--sea); color: #fff; display: grid; place-items: center; font: 500 56px var(--serif); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Font picker: vertical list on the left, live sample on the right */
.font-picker { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 16px; margin: 10px 0 4px; align-items: start; }
.font-list { max-height: 460px; overflow-y: auto; border: 1px solid #d9dde0; border-radius: 10px; background: #fff; }
.font-row { display: block; position: relative; cursor: pointer; border-bottom: 1px solid #eef0f1; }
.font-row:last-child { border-bottom: 0; }
.font-row input { position: absolute; opacity: 0; inset: 0; }
.font-row span { display: block; padding: 10px 14px 10px 36px; position: relative; }
.font-row span::before { content: ""; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -7px; border: 2px solid #98a3a9; border-radius: 50%; }
.font-row b { font-weight: 500; font-size: 17px; }
.font-row:hover span { background: var(--sea-tint); }
.font-row input:checked + span { background: var(--sea-tint); }
.font-row input:checked + span::before { border-color: var(--sea); background: var(--sea); box-shadow: inset 0 0 0 2px #fff; }
.font-row input:focus-visible + span { outline: 2px solid var(--bougain); outline-offset: -2px; }
.font-preview { position: sticky; top: 12px; background: #fff; border: 1px solid #d9dde0; border-radius: 12px; padding: 20px 22px; font-family: var(--sans); }
.font-preview .fp-h { font: 500 30px/1.15 var(--serif); margin: 6px 0 4px; color: var(--sea-deep); }
.font-preview .fp-price { font: 500 24px/1.2 var(--serif); margin: 0 0 12px; }
.font-preview .fp-body { font: 15px/1.5 var(--sans); margin: 0 0 14px; color: #3b464c; }
.font-preview .fp-card { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: var(--sea-tint); font-family: var(--sans); }
.font-preview .fp-card b { font: 500 16px var(--serif); }
.font-preview .btn { font-family: var(--sans); }
@media (max-width: 720px) { .font-picker { grid-template-columns: 1fr; } .font-preview { position: static; order: -1; } .font-list { max-height: 300px; } }

.font-group { position: sticky; top: 0; z-index: 1; padding: 6px 14px; font: 600 11px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #5b666d; background: #f1f3f4; border-bottom: 1px solid #e3e6e8; }
.font-list { max-height: 520px; }

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-lg { width: 44px; height: 44px; font-size: 18px; flex: none; }
.team-name { display: inline-flex; align-items: center; gap: 12px; }

.crop-stage { margin: 8px auto; border-radius: 50%; overflow: hidden; touch-action: none; cursor: grab; box-shadow: 0 0 0 3px var(--sea), 0 6px 18px rgba(0,0,0,.18); }
.crop-stage canvas { display: block; }
.crop-stage:active { cursor: grabbing; }

.crop-stage.rect { border-radius: 10px; background: repeating-conic-gradient(#eef0f1 0 25%, #fff 0 50%) 0 0 / 16px 16px; box-shadow: 0 0 0 3px var(--sea); }

.row-actions { white-space: nowrap; display: flex; gap: 6px; }
.btn-danger-text { color: #b3261e; border-color: #e7b9b5; }

.deal-owner { color: var(--sea-deep); font-weight: 600; }
.overview td.num { text-align: right; white-space: nowrap; }
.overview .of, .overview small { color: #5b666d; font-weight: 400; }
.overview tr.group th { background: var(--sea-tint); color: var(--sea-deep); text-align: left; font-weight: 600; padding: 8px 12px; }
.overview tr.subtotal td { background: #f4f6f7; font-weight: 600; border-top: 1px solid #dfe3e5; }
.overview tr.grand td { background: var(--sea); color: #fff; font-weight: 700; }
.overview tr.grand .of, .overview tr.grand small { color: rgba(255,255,255,.8); }
.overview tr.inactive { opacity: .65; }
.overview .meter.mini { height: 5px; margin: 3px 0 1px; min-width: 70px; }
.overview-bar { display: flex; align-items: center; gap: 10px; }

/* expected-close reminder */
.reminder-list { display: grid; gap: 10px; margin-top: 12px; max-height: 55vh; overflow: auto; }
.reminder-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.reminder-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .reminder-row { grid-template-columns: 1fr; } }

/* live ranking */
.ranking td.num { text-align: right; white-space: nowrap; }
.ranking .of { color: #5b666d; font-weight: 400; }
.ranking td.sorted { font-weight: 700; }
.ranking tr.me td { background: var(--sea-tint); }
.ranking tr.inactive { opacity: .65; }
.ranking .rank { font-weight: 700; width: 2.2em; text-align: center; }
.ranking .rank.medal-1 { color: #b8860b; } .ranking .rank.medal-2 { color: #7a838a; } .ranking .rank.medal-3 { color: #a0522d; }
.ranking .meter.mini { height: 5px; margin: 3px 0 0 auto; min-width: 70px; max-width: 120px; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: #5b666d; margin-left: auto; }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #2e9e5b; animation: livepulse 2s infinite; }
@keyframes livepulse { 50% { opacity: .25; } }

/* spoken languages editor */
.spoken { display: grid; gap: 8px; }
.spoken-native { display: grid; grid-template-columns: 9em 1fr; gap: 8px; align-items: center; }
.spoken-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
@media (max-width: 560px) { .spoken-native { grid-template-columns: 1fr; } }

/* chips, dream-home editor, matches */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { border: 1px solid #c9d2d6; background: #fff; color: inherit; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip-toggle.s1 { background: var(--sea-tint); border-color: var(--sea); color: var(--sea-deep); }
.chip-toggle.s2 { background: var(--sea); border-color: var(--sea); color: #fff; font-weight: 600; }
.wish { display: grid; gap: 10px; }
.wish-basics { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.wish-basics .basic { display: inline-flex; align-items: center; gap: 4px; }
.wish-row { display: grid; grid-template-columns: 11em 1fr auto; gap: 8px; align-items: center; }
.wish-row.wide { align-items: start; }
.wish-row.features { grid-template-columns: 11em 1fr; }
.wish-row label { font-size: .88rem; }
.wish-row label .hint { display: block; }
.wish-row .mid { margin-left: 8px; }
.wish-grid { display: grid; gap: 8px; }
.wish-row input[type=number] { max-width: 9em; }
.wish-row:has(#w_floor_min) { grid-template-columns: 11em 6em auto 6em auto; }
.star { border: 0; background: none; font-size: 1.25rem; line-height: 1; color: #b9c3c8; cursor: pointer; padding: 2px 4px; }
.star.on { color: #d9a200; }
.match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.match { border: 1px solid #dfe3e5; border-radius: 10px; padding: 10px 12px; }
.match.weak { opacity: .8; border-style: dashed; }
.match-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.match-score { font-weight: 700; color: var(--sea-deep); white-space: nowrap; }
.match-checks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mchk { font-size: .78rem; border-radius: 999px; padding: 2px 8px; background: #eef1f2; color: #44505a; }
.mchk.ok { background: #e2f4e8; color: #17653a; } .mchk.miss { background: #fbe3e1; color: #9a2a20; }
.mchk.partial { background: #fff1d6; color: #8a5a00; } .mchk.unknown { background: #eef1f2; color: #6b7780; }
@media (max-width: 560px) { .wish-row, .wish-row.features, .wish-row:has(#w_floor_min) { grid-template-columns: 1fr auto; } .wish-row > label { grid-column: 1 / -1; } }

/* ---------- documents ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.doc-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.doc-ico { color: var(--sea); display: grid; place-items: center; }
.doc-main { min-width: 0; display: grid; gap: 2px; }
.doc-main small { overflow-wrap: anywhere; }
.doc-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.doc-title:hover { color: var(--sea); text-decoration: underline; }
.doc-notes { color: var(--ink-2); }
.doc-side { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc-tools { display: flex; gap: 2px; }
@media (max-width: 640px) { .doc-row { grid-template-columns: auto 1fr; } .doc-side, .doc-tools { grid-column: 2; justify-content: flex-start; } }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 8px; }
.tpl-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--ink); align-content: start; }
.tpl-card:hover { border-color: var(--sea); box-shadow: 0 2px 10px rgba(10, 47, 68, .10); }
.tpl-card span { color: var(--ink-2); font-size: 13px; }
.doc-forms { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 14px 0 0; }
.chip-link { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--sea); background: var(--surface); }
.chip-link:hover { border-color: var(--sea); }
.alert-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.alert-list a { color: var(--ink); text-decoration: none; } .alert-list a:hover { text-decoration: underline; }

/* printable forms: flowing white pages, black on white */
.dform { background: #fff; color: #111; width: min(100%, 794px); margin: 18px auto; padding: 14mm 16mm; box-shadow: 0 2px 16px rgba(0, 0, 0, .12); font: 14px/1.5 Georgia, "Times New Roman", serif; }
.dform h1 { font-size: 24px; margin: 14px 0 2px; } .dform .dsub { margin: 0 0 12px; color: #444; }
.dform h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 6px; border-bottom: 1px solid #999; padding-bottom: 3px; break-after: avoid; }
.dform h3 { font-size: 14px; margin: 12px 0 4px; break-after: avoid; }
.dform p { margin: 6px 0; } .dform .ddraft { font: italic 12px/1.4 sans-serif; color: #8a1c1c; border: 1px dashed #c88; padding: 5px 8px; margin: 8px 0 0; }
.dform .dnote { font-size: 12px; color: #444; }
.dhead { display: flex; gap: 12px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 8px; } .dhead img { max-height: 44px; max-width: 150px; object-fit: contain; }
.dhead b { display: block; font-size: 16px; } .dhead small { color: #444; font-size: 12px; }
.dkv { width: 100%; border-collapse: collapse; } .dkv th { text-align: left; font-weight: 400; color: #444; width: 36%; padding: 5px 8px 5px 0; vertical-align: bottom; border-bottom: 1px solid #ddd; } .dkv td { padding: 5px 0; border-bottom: 1px solid #bbb; }
.dkv tr { break-inside: avoid; }
.blank { display: inline-block; min-width: 14em; height: 1.1em; }
.dol { margin: 4px 0; padding-left: 22px; } .dol li { margin: 4px 0; break-inside: avoid; }
.dcheck { list-style: none; margin: 4px 0; padding: 0; } .dcheck li { display: flex; gap: 10px; align-items: flex-start; margin: 5px 0; break-inside: avoid; }
.cb { flex: none; width: 13px; height: 13px; border: 1.5px solid #111; margin-top: 3px; }
.dsign { display: flex; gap: 30px; margin-top: 40px; break-inside: avoid; } .dsign > div { flex: 1; } .sigline { display: block; border-bottom: 1px solid #111; height: 46px; } .dsign small { display: block; margin-top: 4px; color: #444; font: 12px sans-serif; }
@media print { .dform { width: auto; margin: 0; padding: 0; box-shadow: none; } .form-wrap .page-head, .form-wrap .expose-controls { display: none !important; } }

.task .took { color: var(--ink-3); font-size: 13px; white-space: nowrap; margin-right: auto; }
.task .took:empty { display: none; }
.task .hist{display:block;flex-basis:100%;font-size:.78rem}

/* ---------- voice / text assistant ---------- */
.voice-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sea); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(10, 47, 68, .35); }
.voice-fab.off { opacity: .55; }
.voice-fab:hover { filter: brightness(1.08); }
@media (max-width: 800px) { .voice-fab { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
@media print { .voice-fab { display: none !important; } }
.ai-sheet textarea { width: 100%; min-height: 76px; }
.ai-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; }
.ai-bar .btn-primary { margin-left: auto; }
#ai-mic.rec { background: #c0392b; color: #fff; border-color: #c0392b; }
.ai-reply { background: var(--sea-tint); border-radius: 10px; padding: 10px 12px; }
.ai-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--surface); }
.ai-card h3 { margin: 0 0 8px; font-size: 1rem; }
.ai-card label { display: block; margin: 8px 0; font-size: .85rem; color: var(--ink-3); }
.ai-card label input:not([type=checkbox]), .ai-card label textarea, .ai-card label select { display: block; width: 100%; margin-top: 3px; }
.ai-card label.check { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--ink); }
.ai-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 3px; }
.ai-att { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.ai-actions { display: flex; gap: 8px; margin-top: 10px; }
.ai-card.done { background: var(--sea-tint); }
.ai-done { margin: 0; color: var(--ink); font-weight: 600; }
.ai-bar select { width: auto; max-width: 11em; }
#ai-out { max-height: 52vh; overflow-y: auto; margin-bottom: 8px; }
.ai-you { margin: 8px 0 8px auto; max-width: 85%; background: var(--sea); color: #fff; border-radius: 12px 12px 2px 12px; padding: 8px 12px; width: fit-content; }
.ai-speak { margin: 0; font-size: .85rem; }
.ai-langrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; margin: 4px 0; }
.ai-langrow select { width: auto; }

/* ---- projects */
.proj-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: inherit; text-decoration: none; }
.proj-card:hover { border-color: var(--sea); box-shadow: 0 2px 12px rgba(10, 47, 68, .08); }
.proj-card .prop-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font: 500 19px/1.3 var(--serif); }
.proj-card .loc { margin: 2px 0 10px; color: var(--ink-2); }
.proj-card .facts { margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; }
.proj-card .price { margin: 6px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--line-2); margin: 10px 0 4px; }
.pbar .sold { background: var(--sea); }
.pbar .reserved { background: #d29a3a; }
.pbar .free { background: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.stat { background: var(--sea-tint); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12.5px; color: var(--ink-2); }
.stat b { font: 600 22px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.stock td, .stock th { padding: 8px 12px; }
.stock tr.st-sold td, .stock tr.st-withdrawn td { color: var(--ink-3); }
.unit-status { width: auto; padding: 4px 8px; }
.panel-head select { width: auto; max-width: 14em; }
.proj-card + .proj-card { margin: 0; }
.rank-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.panel[hidden] { display: none; }
.web-flag { font-size: .8rem; margin-top: 4px; color: #5b666d; }
.ai-usage-links { font-size: .85rem; }

/* ---------- running inside the iOS app (class set by native.js) ---------- */
html.native { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); }
.native body { -webkit-touch-callout: none; overscroll-behavior-y: none; }
.native input, .native select, .native textarea { font-size: 16px; }        /* iOS zooms into smaller fields */
.native body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--sat); background: var(--chalk); z-index: 60; }
.native .main-col { padding-top: var(--sat); }
.native .offline, .native .page-head { top: var(--sat); }
.native .sidebar { padding-top: calc(22px + var(--sat)); }
@media (max-width: 760px) {
  .native #view { padding-left: max(14px, var(--sal)); padding-right: max(14px, var(--sar)); }
  .native .account-mobile { top: calc(12px + var(--sat)); right: max(12px, var(--sar)); }
  .native .tabbar { padding-bottom: calc(4px + var(--sab)); padding-left: var(--sal); padding-right: var(--sar); }
  .native #toasts { bottom: calc(84px + var(--sab)); }
  .native dialog.modal .modal-body { padding-bottom: calc(22px + var(--sab)); }
  .native .voice-fab { bottom: calc(76px + var(--sab)); }
}
.applock { position: fixed; inset: 0; z-index: 1000; background: var(--sea-deep); color: #fff; display: grid; place-items: center; padding: 24px; }
.applock-box { display: grid; gap: 18px; justify-items: center; text-align: center; }
.applock-box h1 { color: #fff; font-size: 24px; }
.applock-box .brand-mark { width: 26px; height: 34px; border-radius: 13px 13px 2px 2px; }
.applock-box .brand-mark::after { width: 11px; height: 11px; right: -6px; top: -5px; }

/* ---- agenda (calendar) ---- */
.ag-bar { align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-month { min-width: 150px; text-align: center; text-transform: capitalize; font: 500 19px/1.2 var(--serif); }
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.ag-wd { background: var(--chalk); text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 6px 0; text-transform: capitalize; }
.ag-cell { background: var(--surface); border: 0; min-height: 96px; padding: 4px 5px; text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ag-cell.out { background: var(--chalk); color: var(--ink-3); }
.ag-cell:hover { background: var(--sea-tint); }
.ag-cell.sel { box-shadow: inset 0 0 0 2px var(--sea); }
.ag-num { font-size: 13px; font-weight: 600; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; }
.ag-cell.today .ag-num { background: var(--sea); color: #fff; }
.ag-chip { display: block; font-size: 11.5px; line-height: 1.3; padding: 1px 4px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--sea-tint); color: var(--sea-deep); border-left: 3px solid var(--sea); }
.ag-chip.k-viewing, .ag-item.k-viewing { --kc: var(--ok); } .ag-chip.k-meeting, .ag-item.k-meeting { --kc: var(--sea); }
.ag-chip.k-call, .ag-item.k-call { --kc: var(--warn); } .ag-chip.k-signing, .ag-item.k-signing { --kc: var(--bougain); } .ag-chip.k-other, .ag-item.k-other { --kc: var(--ink-3); }
.ag-chip { border-left-color: var(--kc, var(--sea)); }
.ag-more, .ag-tasks { font-size: 11.5px; color: var(--ink-3); }
.ag-dots { display: none; gap: 3px; flex-wrap: wrap; }
.ag-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--sea); display: block; }
.ag-dots i.k-viewing { background: var(--ok); } .ag-dots i.k-call { background: var(--warn); } .ag-dots i.k-signing { background: var(--bougain); } .ag-dots i.k-other { background: var(--ink-3); }
.ag-dayhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ag-dayhead h2 { text-transform: capitalize; }
.ag-list, .ag-tlist { list-style: none; margin: 0; padding: 0; }
.ag-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0 10px 10px; border-top: 1px solid var(--line-2); border-left: 4px solid var(--kc, var(--sea)); margin-top: 6px; }
.ag-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.ag-info small { display: block; }
.ag-act { display: flex; gap: 6px; align-items: start; }
.ag-sub { font-size: 13px; color: var(--ink-3); margin: 14px 0 4px; font-weight: 600; }
.ag-tlist li { padding: 3px 0; }
@media (max-width: 720px) {
  .ag-cell { min-height: 54px; align-items: center; padding: 3px 1px; }
  .ag-chip, .ag-more { display: none; }
  .ag-dots { display: flex; justify-content: center; }
  .ag-tasks { font-size: 10.5px; }
  .ag-item { grid-template-columns: 48px minmax(0, 1fr); }
  .ag-act { grid-column: 2; }
}

.ag-lines { list-style: none; margin: 0; padding: 0; }
.ag-line { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; padding: 7px 0 7px 10px; border-left: 4px solid var(--kc, var(--sea)); margin-top: 5px; }
.ag-line.k-viewing { --kc: var(--ok); } .ag-line.k-call { --kc: var(--warn); } .ag-line.k-signing { --kc: var(--bougain); } .ag-line.k-other { --kc: var(--ink-3); }
.ag-line .ag-time { font-weight: 600; font-size: 13.5px; }
.ag-lines.past { opacity: .7; }
.ag-task { padding: 4px 0; } .ag-task small { margin-left: 26px; }
.ag-late { color: var(--bougain); } .ag-task.late .check span { color: var(--bougain); }

.brand.logo-only { display: block; padding: 0; }
.brand.logo-only .sidebar-logo { margin: 0 4px 18px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* leads */
.lead-hint { margin: -4px 0 14px; max-width: 70ch; }
.lead-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.lead { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; display: grid; gap: 8px; }
.lead-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-name { font-weight: 600; font-size: 1.05rem; }
.lead-date { margin-left: auto; font-size: .85rem; }
.lead-msg { margin: 0; padding: 8px 12px; background: var(--line-2); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: .9rem; align-items: center; }
.lead-meta a { display: inline-flex; align-items: center; gap: 5px; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-badge { background: var(--accent, #C8923A); color: #fff; border-radius: 999px; font-size: .68rem; line-height: 1; padding: 3px 6px; margin-left: auto; font-weight: 600; }
.tabbar .nav-badge { position: absolute; top: 2px; right: 18%; margin: 0; }
.tabbar a { position: relative; }

/* MLS feeds (settings) */
.mls-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.mls-list li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.mls-list li > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.mls-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* MLS page */
.mls-grid, .mls-sources { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mls-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; }
.mls-img { aspect-ratio: 3 / 2; background: var(--line-2); }
.mls-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mls-body { padding: 12px 14px; display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.mls-price { font-weight: 600; font-size: 1.05rem; }
.mls-source { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; cursor: pointer; background: var(--surface); }
.mls-source:hover, .mls-source:focus-visible { border-color: var(--accent, #C8923A); outline: 0; }
.mls-source.on { border-color: var(--accent, #C8923A); box-shadow: inset 0 0 0 1px var(--accent, #C8923A); }
.mls-source.off { opacity: .6; }
.mls-count { font-size: 1.4rem; font-weight: 600; }
.mls-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mls-price small { display: inline; }

/* menu arranging */
.arrange { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 4px; max-height: 55vh; overflow: auto; }
.arrange li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.arrange li span { flex: 1; min-width: 0; }
.arrange .icon-btn:disabled { opacity: .3; }

/* phone menu: the entry under the finger grows a little and its full name shows above the bar */
@media (max-width: 760px) {
  .tabbar a.peek { transform: scale(1.3); color: var(--sea); background: var(--line-2); position: relative; z-index: 2; }
  #tab-peek { position: fixed; z-index: 40; bottom: calc(66px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink, #12344A); color: #fff;
    padding: 7px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
}

.arrange li input[type=checkbox] { width: 18px; height: 18px; flex: none; }
