:root {
  color-scheme: light;
  --brand: #176b87;
  --brand-dark: #0f5269;
  --brand-soft: #e5f3f7;
  --ink: #1d2935;
  --muted: #667481;
  --line: #dbe2e7;
  --surface: #fff;
  --canvas: #f5f7f8;
  --sidebar: #f0f3f4;
  --hover: #e8edef;
  --success: #208661;
  --success-soft: #e6f5ee;
  --warning: #a16207;
  --warning-soft: #fff6dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --brand: #67c3dc;
  --brand-dark: #8bd2e5;
  --brand-soft: #153b46;
  --ink: #dce5ea;
  --muted: #8fa0ad;
  --line: #2b3943;
  --surface: #182129;
  --canvas: #10171d;
  --sidebar: #0c1318;
  --hover: #24313a;
  --success: #61c79d;
  --success-soft: #16372c;
  --warning: #f3c56b;
  --warning-soft: #3e321c;
  --danger: #ff8a80;
  --danger-soft: #422321;
}

* { box-sizing: border-box; }
html { min-height: 100%; font-size: 15px; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 244px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--brand);
}
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; margin-top: 42px; }
.nav-label {
  margin: 0 11px 7px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-label.spaced { margin-top: 20px; }
.sidebar .nav-link {
  padding: 10px 12px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  font-weight: 650;
}
.sidebar .nav-link:hover { color: var(--ink); background: var(--hover); }
.sidebar .nav-link.active { color: var(--brand-dark); border-left-color: var(--brand); background: var(--brand-soft); }
.nav-flyout { position: relative; }
.nav-flyout-trigger { display: flex; align-items: center; justify-content: space-between; text-decoration: none; }
.nav-flyout-menu {
  position: absolute;
  top: -10px;
  left: calc(100% + 12px);
  z-index: 30;
  display: grid;
  width: 190px;
  padding: 8px;
  visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(23, 35, 48, .16);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-flyout:hover .nav-flyout-menu, .nav-flyout:focus-within .nav-flyout-menu { visibility: visible; opacity: 1; transform: translateX(0); }
.nav-flyout-menu::before { position: absolute; top: 14px; left: -13px; width: 13px; height: 34px; content: ""; }
.nav-flyout-title { padding: 7px 9px 5px; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.nav-flyout-menu a { padding: 9px; border-radius: 5px; color: var(--ink); text-decoration: none; font-weight: 650; }
.nav-flyout-menu a:hover, .nav-flyout-menu a:focus { color: var(--brand-dark); background: var(--brand-soft); outline: none; }
.nav-count { float: right; min-width: 22px; padding: 1px 6px; border-radius: 10px; color: #fff; background: var(--brand); text-align: center; font-size: .7rem; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid var(--line); }
.sidebar-user span:last-child { display: grid; min-width: 0; }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .87rem; }
.sidebar-user small { color: var(--muted); }
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 750;
}
.avatar.small { width: 28px; height: 28px; font-size: .75rem; }
.content-shell { width: calc(100% - 244px); margin-left: 244px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-button, .account-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.icon-button { width: 36px; height: 36px; }
.notification-button { position: relative; display: grid; place-items: center; text-decoration: none; font-size: 1.15rem; }
.notification-badge { position: absolute; top: -6px; right: -7px; min-width: 19px; padding: 1px 5px; border: 2px solid var(--surface); border-radius: 10px; color: #fff; background: var(--danger); font-size: .65rem; font-weight: 750; line-height: 15px; text-align: center; }
.account-button { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; }
.page-content { max-width: 1480px; padding: 32px 34px 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 1.55rem; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .panel {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.metric-card { padding: 20px; }
.metric-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 650; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 7px; font-size: 1.65rem; }
.panel { margin-bottom: 20px; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 1rem; }
.panel-body { padding: 20px; }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.btn { border-radius: 5px; }
.btn-brand { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-brand:hover { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.form-control, .form-select {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  color: var(--muted);
  background: var(--canvas);
  font-size: .72rem;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.data-table small { display: block; color: var(--muted); }
.property-wide-table { min-width: 2450px; }
.property-wide-table th, .property-wide-table td { white-space: nowrap; }
.property-wide-table th:nth-child(3), .property-wide-table td:nth-child(3),
.property-wide-table th:nth-child(9), .property-wide-table td:nth-child(9),
.property-wide-table th:nth-child(13), .property-wide-table td:nth-child(13) { width: 260px; white-space: normal; }
.property-wide-table th:nth-child(2), .property-wide-table td:nth-child(2) { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.property-wide-table thead th:nth-child(2) { z-index: 3; }
.cell-clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.modal-dialog-scrollable .modal-content > form,
.modal-fullscreen .modal-content > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.import-preview-modal .modal-dialog {
  height: 100%;
  margin: 0;
  max-width: none;
}
.import-preview-modal .modal-content {
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
}
.import-preview-modal .modal-dialog-scrollable .modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.import-preview-modal .modal-footer {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
}
.import-preview-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.import-preview-grid .data-table { font-size: .82rem; }
.import-preview-grid th { position: sticky; top: 0; z-index: 2; background: var(--surface); white-space: nowrap; }
.import-preview-grid th:first-child, .import-preview-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 44px;
  background: var(--surface);
  text-align: center;
}
.import-preview-grid thead th:first-child { z-index: 4; }
.import-preview-grid tbody tr:hover td:first-child { background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); }
.import-preview-grid tbody tr.import-row-warning td:first-child { background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface)); }
.import-preview-grid td { max-width: 280px; white-space: nowrap; }
.property-import-preview { min-width: 2500px; }
.owner-import-preview { min-width: 1650px; }
.import-cell { width: 150px; min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: inherit; }
.import-cell:hover, .import-cell:focus { border-color: var(--brand); background: var(--surface); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 16%, transparent); }
.import-cell.is-invalid { border-color: var(--danger); background: color-mix(in srgb, var(--danger-soft) 65%, var(--surface)); }
.import-errors { min-width: 210px; white-space: normal !important; }
.import-errors small { margin-top: 4px; color: var(--danger); line-height: 1.25; }
.import-validation-help { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); }
.import-validation-help strong { color: var(--ink); }
.import-row-warning { background: color-mix(in srgb, var(--warning-soft) 55%, transparent); }
.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--hover);
  font-size: .73rem;
  font-weight: 700;
}
.status-success { color: var(--success); background: var(--success-soft); }
.status-warning { color: var(--warning); background: var(--warning-soft); }
.status-danger { color: var(--danger); background: var(--danger-soft); }
.toolbar { display: flex; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar .form-control { max-width: 360px; }
.property-filters { flex-wrap: wrap; }
.property-filters .form-control { flex: 1 1 260px; }
.property-filters .form-select { width: auto; min-width: 150px; flex: 1 1 150px; }
.empty-state { padding: 54px 20px; color: var(--muted); text-align: center; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 28px; }
.detail-grid dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.detail-grid dd { margin: 4px 0 0; font-weight: 600; }
.map-page-heading { align-items: center; }
.map-unit-count { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: .82rem; font-weight: 700; }
.map-panel { overflow: hidden; }
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.map-toolbar h2 { margin: 0 0 3px; font-size: 1rem; }
.map-toolbar small { color: var(--muted); }
.map-toolbar-actions { display: flex; align-items: center; justify-content: end; gap: 18px; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px 16px; color: var(--muted); font-size: .75rem; font-weight: 650; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.map-key { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.key-available { background: var(--success); }
.key-occupied { background: var(--brand); }
.key-review { background: var(--warning); }
.map-scroll { overflow-x: auto; padding: 30px 24px 22px; background-color: color-mix(in srgb, var(--canvas) 88%, var(--surface)); background-image: radial-gradient(color-mix(in srgb, var(--muted) 18%, transparent) 1px, transparent 1px); background-size: 18px 18px; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent; }
.map-zoom-controls { display: inline-flex; overflow: hidden; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.map-zoom-controls button { min-width: 34px; height: 32px; padding: 0 9px; border: 0; border-right: 1px solid var(--line); color: var(--ink); background: transparent; font-weight: 750; }
.map-zoom-controls button:last-child { border-right: 0; }
.map-zoom-controls button:hover:not(:disabled) { background: var(--hover); }
.map-zoom-controls button:disabled { color: var(--line); cursor: not-allowed; }
.map-zoom-controls .map-zoom-value { min-width: 58px; color: var(--muted); font-size: .72rem; }
.estate-map { display: grid; width: max-content; min-width: 100%; grid-template-columns: repeat(var(--map-columns), 74px); grid-template-rows: 230px 58px 230px; gap: 10px 4px; align-items: stretch; zoom: var(--map-scale, 1); }
.map-road { position: relative; display: flex; align-items: center; justify-content: center; margin: 3px 0; border-top: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent); border-bottom: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent); color: var(--muted); background: color-mix(in srgb, var(--line) 40%, transparent); font-size: .66rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.map-road span { padding: 3px 12px; border-radius: 999px; background: var(--canvas); }
.map-lot { position: relative; display: flex; min-width: 144px; overflow: hidden; flex-direction: column; padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--muted); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(15, 23, 42, .06); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.map-lot-button { width: auto; font: inherit; text-align: left; cursor: pointer; }
.map-lot-button:hover { z-index: 2; color: var(--ink); border-color: var(--brand); box-shadow: 0 10px 24px rgba(15, 23, 42, .13); transform: translateY(-3px); }
.map-lot-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.map-lot-heading span, .map-lot-details span { display: block; color: var(--muted); font-size: .62rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.map-lot-heading strong { font-size: 1.3rem; line-height: 1; }
.map-lot-details { display: grid; gap: 13px; min-height: 0; padding-top: 13px; }
.map-lot-details b { display: -webkit-box; overflow: hidden; margin-top: 3px; font-size: .75rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.map-lot-footer { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; font-weight: 750; }
.map-status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.map-open { margin-left: auto; font-size: .85rem; }
.map-lot.lot-available { border-top-color: var(--success); }
.map-lot.lot-available .map-status-dot { background: var(--success); }
.map-lot.lot-occupied { border-top-color: var(--brand); }
.map-lot.lot-occupied .map-status-dot { background: var(--brand); }
.map-lot.lot-sold { border-top-color: var(--danger); }
.map-lot.lot-sold .map-status-dot { background: var(--danger); }
.map-lot.lot-review { border-style: dashed; border-top-style: solid; border-top-color: var(--warning); background: color-mix(in srgb, var(--warning-soft) 40%, var(--surface)); }
.map-lot.lot-review .map-status-dot { background: var(--warning); }
.map-preview-details { display: grid; gap: 18px; margin: 0; }
.map-preview-details dt { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.map-preview-details dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.designer-toolbar { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:8px 8px 0 0; background:var(--surface); }
.designer-toolbar input { width:90px; }
.map-designer-shell { display:grid; grid-template-columns:240px minmax(400px,1fr) 240px; min-height:680px; border:1px solid var(--line); border-top:0; background:var(--surface); }
.designer-properties,.designer-inspector { padding:16px; overflow:auto; background:var(--surface); }
.designer-properties { border-right:1px solid var(--line); }.designer-inspector { border-left:1px solid var(--line); }
.designer-properties h2,.designer-inspector h2 { font-size:.9rem; }.designer-properties p { color:var(--muted);font-size:.75rem; }
.designer-property { display:grid; width:100%; grid-template-columns:1fr auto; padding:9px; margin-bottom:6px; border:1px solid var(--line); border-radius:6px; text-align:left; background:var(--surface); cursor:grab; }
.designer-property small { grid-column:1; color:var(--muted); }.designer-property span { grid-column:2;grid-row:1/3;align-self:center;font-size:.68rem;color:var(--muted);}.designer-property.placed{opacity:.5;cursor:default}
.designer-viewport { overflow:auto; padding:20px; background:#eef1f4; }
.designer-canvas { position:relative; transform-origin:top left; border:1px solid #aab4c0; background-color:#fff;background-image:linear-gradient(#edf0f3 1px,transparent 1px),linear-gradient(90deg,#edf0f3 1px,transparent 1px);background-size:20px 20px;box-shadow:0 5px 24px #0002; }
.designer-object { position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:column;overflow:hidden;border:2px solid #8493a3;border-radius:6px;background:var(--object-fill,#e7f3f6);color:#17212b;cursor:grab;user-select:none;touch-action:none;box-sizing:border-box; }
.designer-object:active { cursor:grabbing; }
.designer-object.selected { outline:3px solid var(--brand);outline-offset:2px }.designer-object small{font-size:.62rem;opacity:.65}.object-road{border-style:dashed;border-radius:2px}.object-label{border-color:transparent;background:transparent;font-weight:750}.object-area{border-style:dashed;opacity:.8}
.designer-inspector label { display:block;margin-bottom:10px;color:var(--muted);font-size:.72rem;font-weight:700}.designer-inspector label input,.designer-inspector label select{margin-top:4px}
.visual-map-scroll{overflow:auto;padding:24px;background:#eef1f4}.visual-map-canvas{position:relative;transform-origin:top left;background:#fff;background-image:linear-gradient(#edf0f3 1px,transparent 1px),linear-gradient(90deg,#edf0f3 1px,transparent 1px);background-size:20px 20px;box-shadow:0 5px 24px #0002}.visual-map-object{position:absolute;display:flex;align-items:center;justify-content:center;flex-direction:column;overflow:hidden;box-sizing:border-box;border:2px solid #8493a3;border-radius:6px;background:var(--object-fill,#e7f3f6);color:#17212b}.visual-map-object small{font-size:.65rem;color:#536273}.visual-propertylot{border-top-width:5px}.visual-road{border-style:dashed;border-radius:2px}.visual-label{border-color:transparent;background:transparent}.visual-area{border-style:dashed;opacity:.75}.visual-map-object.map-lot-button{cursor:pointer}.visual-map-object.map-lot-button:hover{outline:3px solid var(--brand);outline-offset:2px}
@media(max-width:1000px){.map-designer-shell{grid-template-columns:190px minmax(500px,1fr)}.designer-inspector{grid-column:1/-1;border-left:0;border-top:1px solid var(--line)}.designer-toolbar{align-items:flex-start;flex-direction:column}}
.auth-card { width: min(460px, calc(100% - 32px)); margin: 8vh auto; padding: 30px; }
.public-header { padding: 24px 32px; }
.public-content { min-height: calc(100vh - 82px); }
.mobile-nav { display: none; }
.validation-summary-valid { display: none; }

@media (max-width: 980px) {
  .sidebar { display: none; }
  .content-shell { width: 100%; margin: 0; }
  .mobile-nav { display: flex; gap: 5px; overflow-x: auto; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .mobile-nav a { padding: 7px 10px; color: var(--muted); text-decoration: none; white-space: nowrap; }
  .page-content { padding: 24px 18px 50px; }
  .topbar { padding: 0 18px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .map-toolbar-actions { width: 100%; align-items: flex-start; flex-direction: column; }
  .map-legend { justify-content: start; }
}

@media (max-width: 600px) {
  .metric-grid, .detail-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .account-button { font-size: 0; }
}
.property-summary-row {
    cursor: pointer;
}

.property-summary-row:hover td,
.property-summary-row:focus td {
    background: color-mix(in srgb, var(--bs-primary) 7%, transparent);
}

.editable-detail-grid dd,
.editable-popup-details dd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.parameter-edit {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: .72rem;
    line-height: 1;
    padding: .15rem;
    opacity: .55;
}

.parameter-edit:hover,
.parameter-edit:focus {
    color: var(--bs-primary);
    opacity: 1;
}

.detail-actions,
.owner-phone-actions {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.owner-phone-layout {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(360px, 1.25fr);
    gap: 1.5rem;
}

.owner-phone-layout > section + section {
    padding-left: 1.5rem;
    border-left: 1px solid var(--line);
}

.owner-phone-list {
    display: grid;
    gap: .75rem;
}

.owner-phone-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: var(--surface);
}

.owner-phone-card.is-inactive { opacity: .68; }
.owner-phone-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.owner-phone-heading small { display: block; margin-top: .15rem; color: var(--muted); }
.owner-phone-card p { margin: .65rem 0; color: var(--muted); font-size: .82rem; }
.owner-phone-actions { flex-wrap: wrap; margin-top: .75rem; }
.owner-phone-actions form { margin: 0; }

@media (max-width: 767px) {
    .owner-phone-layout { grid-template-columns: 1fr; }
    .owner-phone-layout > section + section { padding-top: 1.25rem; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
}

/* Bootstrap components inherit the portal palette in both themes. */
body {
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
}
.modal-content, .dropdown-menu, .list-group-item {
  color: var(--ink);
  background-color: var(--surface);
  border-color: var(--line);
}
.dropdown-item { color: var(--ink); }
.dropdown-item:hover, .dropdown-item:focus { color: var(--ink); background: var(--hover); }
.form-control:focus, .form-select:focus { color: var(--ink); background-color: var(--surface); }
.form-control::placeholder { color: var(--muted); opacity: 1; }
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
html[data-theme="dark"] .btn-brand { color: #10232b; }
.content-shell, .dashboard-grid > *, .detail-grid > * { min-width: 0; }
.detail-grid dd { overflow-wrap: anywhere; }
.topbar > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { flex-shrink: 0; }
@media (max-height: 700px) and (min-width: 981px) {
  .sidebar { overflow-y: auto; }
  .sidebar-nav { margin-top: 20px; }
}
@media (max-width: 600px) {
  .toolbar, .panel-header, .designer-toolbar > div { flex-wrap: wrap; }
  .map-designer-shell { grid-template-columns: minmax(0, 1fr); }
  .designer-properties { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .designer-viewport { min-width: 0; height: 480px; }
  .designer-inspector { grid-column: 1; }
  .owner-phone-heading { flex-wrap: wrap; }
}

.visual-propertylot.lot-available { border-top-color: var(--success); }
.visual-propertylot.lot-occupied { border-top-color: var(--brand); }
.visual-propertylot.lot-unknown { border-top-color: var(--muted); }
.visual-map-object[role="button"]:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
