/* === CENTRALIZED THEMING SYSTEM === */
/* OPTION A (Canonical Source = JS):
  Theme color tokens are defined in window.APP_CONFIG.THEME (config.js) and
  applied at runtime by applyTheme() in utils.js, which sets the CSS custom
  properties below. The static values in :root and [data-theme="dark"] act only
  as initial fallbacks before JS runs (e.g., during very early paint / NOSCRIPT).

  To change a color:
    1. Edit the corresponding value inside APP_CONFIG.THEME.light or .dark.
    2. If you introduce a NEW variable (e.g. --border-subtle), also add a field
      to each theme object and update applyTheme() to set it with
      root.style.setProperty('--border-subtle', theme.borderSubtle).
    3. Keep variable naming consistent (kebab-case in CSS, camelCase in JS).

  Do NOT rely on these fallback literals as the source of truth; they will be
  overwritten shortly after load. This comment is here to prevent future
  confusion about where to edit theme colors. */
/* CSS Variables dynamically set by JavaScript from config.js */

:root {
  /* Minimal light fallback (JS applyTheme overwrites all themes quickly). */
  --bg: #ffffff;
  --text: #0f172a;
  --text-dim: #64748b; /* added for sort arrows */
  --muted: #64748b;
  --border: #e2e8f0;
  --border-subtle: #e2e8f0;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --sidebar-bg: #f8fafc;
  --chip: #eef2ff;
  --hover-bg: #f1f5f9;
  --pp-flat-background: #dce5f1;
  --input-bg: #ffffff;
  --input-border: #d1d5db;
  --input-focus: #2563eb;
  --input-text: #111827;
  --filter-bg: #f9fafb;
  --filter-border: #e5e7eb;
  --filter-active: #dbeafe;
  --sort-highlight: #ecfdf5; /* light: subtle green for sorted column */
  --sort-arrows: #059669; /* new shared color for sort arrows */
  --sort-text: #111827; /* dark: high contrast text for sort arrows */
  /* Newly added: shared overlay & panel backgrounds for early paint */
  --overlay-bg: rgba(0,0,0,0.45);
  --panel-bg: rgba(0,0,0,0.03);
  /* Deduplicate Manager theme tokens */
  --dedupe-winning-bg: #ecfdf5;        /* light green */
  --dedupe-winning-border: #059669;    /* emerald-600 */
  --dedupe-losing-bg: #fef2f2;         /* light red */
  --dedupe-losing-border: #dc2626;     /* red-600 */
}

/* Add static dark fallback variables so dark theme renders correctly BEFORE JS runs.
   JS still overwrites these with authoritative config values shortly after load. */
[data-theme="dark"] {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --muted: #94a3b8;
  --border: #334155;
  --border-subtle: #475569;
  --primary: #3b82f6;
  --primary-contrast: #ffffff;
  --sidebar-bg: #1e293b;
  --chip: #1e3a8a;
  --hover-bg: #475569;
  --pp-flat-background: #2d497a;
  --input-bg: #1e293b;
  --input-border: #475569;
  --input-focus: #3b82f6;
  --input-text: #f1f5f9;
  --filter-bg: #1e293b;
  --filter-border: #475569;
  --filter-active: #1e40af;
  --overlay-bg: rgba(0,0,0,0.6);
  --panel-bg: rgba(255,255,255,0.04);
  --sort-highlight: #1e3a3b; /* dark: muted green tint */
  --sort-arrows: #10b981; /* new shared color for sort arrows */
  --sort-text: #f1f5f9; /* lighter text for sort arrows in dark mode */
  /* Deduplicate Manager theme tokens (dark tuned) */
  --dedupe-winning-bg: rgba(5, 150, 105, 0.15);
  --dedupe-winning-border: #10b981;    /* emerald-500 */
  --dedupe-losing-bg: rgba(220, 38, 38, 0.18);
  --dedupe-losing-border: #ef4444;     /* red-500 */
}

/* System preference fallback (only affects first paint if no data-theme attr yet) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0f172a;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --border: #334155;
    --border-subtle: #475569;
    --primary: #3b82f6;
    --primary-contrast: #ffffff;
    --sidebar-bg: #1e293b;
    --chip: #1e3a8a;
    --hover-bg: #475569;
    --pp-flat-background: #2d497a;
    --input-bg: #1e293b;
    --input-border: #475569;
    --input-focus: #3b82f6;
    --input-text: #f1f5f9;
    --filter-bg: #1e293b;
    --filter-border: #475569;
    --filter-active: #1e40af;
    --overlay-bg: rgba(0,0,0,0.6);
    --panel-bg: rgba(255,255,255,0.04);
  }
}

/* Inline row exclude affordance (hover-only, non-intrusive)
   Note: The click target is handled in tableEngine.setupTableRowClickHandlers()
         which listens for clicks within 16px of the FIRST CELL'S LEFT or RIGHT edge.
         If you move the icon, keep padding on the same edge and JS will still work. */
#recordsTable tbody td:first-child {
  position: relative;
  padding-right: 22px; /* keep room for right-edge icon+circle */
}

#recordsTable tbody tr:hover td:first-child::before {
  content: "\f070"; /* fa-eye-slash (regular) */
  font-family: "Font Awesome 6 Free";
  font-weight: 400;

  position: absolute; /* default: right-edge placement */
  right: 6px; /* if moving to left, change to left: 6px and swap padding-right to padding-left above */
  top: 50%;
  transform: translateY(-50%);

  color: var(--fg-color, #c77); /* fallback light */
  background-color: var(--bg-color, #fff); /* theme-aware circle */
  border-radius: 50%;
  font-size: 12px;
  line-height: 18px;
  width: 18px;
  height: 18px;
  text-align: center;
  opacity: 0.9;

  pointer-events:none; /* icon is visual; click captured by hit-zone JS */
}

/* Dark theme overrides */
[data-theme="dark"] #recordsTable tbody tr:hover td:first-child::before {
  color: var(--fg-color-dark, #e48);
  background-color: var(--bg-color-dark, #222);
}


/* Themed map info window buttons in map info windows
using .btn-primary parent styling first */
.btn-map-iw { flex: 1 }

/* Map InfoWindow custom wrapper to inherit theme */
/* Simplified InfoWindow (std-iw) content; relies on native Google wrapper for chrome/close */
.std-iw { font:13px system-ui,-apple-system,sans-serif; color: var(--text); max-width:340px; min-width:300px; }
.std-iw .iw-title-row { display:flex; align-items:center; gap:6px; margin:0 0 4px; }
.std-iw .iw-status-dot { width:8px; height:8px; border-radius:50%; box-shadow:0 0 0 1px rgba(0,0,0,.2); }
.std-iw .iw-title { font-size:1.2rem; font-weight:600; }
.std-iw .iw-body { display:flex; flex-direction:column; gap:0.4rem; margin:0.8rem 0; }
.std-iw .iw-row { display:flex; justify-content:space-between; gap:11px; font-size:1rem; }
.std-iw .iw-row .k { color: var(--muted); text-transform:uppercase; font-size:9px; letter-spacing:.5px; }
.std-iw .iw-row .v { color: var(--text); font-weight:500; }
.std-iw .iw-actions { display:flex; justify-content:flex-end; margin-top:4px; }
.std-iw .iw-actions.single { justify-content:center; }
.std-iw .iw-sub { font-size:12px; color: var(--muted); margin:0 0 6px; }
@media (max-width:520px){ .std-iw{max-width:280px; min-width:auto;} }
/* InfoWindow button variants (theme-aware) */
.std-iw .btn-primary { background:var(--primary); border:1px solid var(--primary); color:var(--primary-contrast); border-radius:6px; }
.std-iw .btn-primary:hover { filter:brightness(1.05); }
.std-iw .btn-outline-secondary,
.std-iw .btn-secondary { background:transparent; border:1px solid var(--border); color:var(--text); border-radius:6px; }
.std-iw .btn-outline-secondary:hover,
.std-iw .btn-secondary:hover { border-color:var(--primary); color:var(--primary); }
/* Dark mode bubble bg override minimal */
[data-theme="dark"] .gm-style .gm-style-iw-c, [data-theme="light"] .gm-style .gm-style-iw-c { background: var(--bg) !important; color: var(--text) !important; padding: 1rem !important; }
  [data-theme="dark"] .gm-style .gm-style-iw-d, [data-theme="light"] .gm-style .gm-style-iw-d { overflow: visible !important; }
[data-theme="dark"] .gm-style .gm-style-iw-t::after, [data-theme="light"] .gm-style .gm-style-iw-t::after { background: var(--bg) !important; }
[data-theme="dark"] .pac-container, [data-theme="light"] .pac-container { border:1px solid var(--border); }
[data-theme="dark"] .gm-style .gm-style-iw-tc::after, [data-theme="light"] .gm-style .gm-style-iw-tc::after { background: var(--bg) !important; }

/* Map search bar theming */
.gm-search { display:flex; align-items:center; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:4px 8px; box-shadow:0 2px 6px rgba(0,0,0,.2); }

#mapSearchBar .gm-search { background: var(--input-bg); border:1px solid var(--input-border); box-shadow:0 2px 6px rgba(0,0,0,.25); }
#mapSearchBar input { color: var(--input-text); }
#mapSearchBar input::placeholder { color: var(--muted); opacity:.7; }
[data-theme="dark"] #mapSearchBar .gm-search { box-shadow:0 2px 8px rgba(0,0,0,.6); }

/* Native PAC dropdown adapt (override earlier injected minimal styles) */
.pac-container { background: var(--input-bg); color: var(--text); border:1px solid var(--border); min-width:420px; }
.pac-item { color: var(--text); border: var(--border); white-space: normal; }
.pac-item:hover, .pac-item-selected { background: rgba(0,0,0,.05); }
[data-theme="dark"] .pac-item:hover, [data-theme="dark"] .pac-item-selected { background: rgba(255,255,255,.08); }
.pac-item-query { color: var(--text); font-weight:600; }
@media (max-width:600px){ .pac-container{ min-width:auto; width:auto; max-width:min(92vw, 420px); } }

/* Address Autocomplete (custom dropdown) */
.addr-ac-wrap { position: relative; }
.addr-ac-dropdown { position:absolute; top:100%; left:0; right:0; z-index:1600; display:none; background:var(--input-bg); color:var(--text); border:1px solid var(--border); border-radius:8px; box-shadow:0 8px 20px rgba(0,0,0,.18); margin-top:6px; max-height:320px; overflow:auto; }
.addr-ac-item { display:flex; align-items:flex-start; gap:8px; padding:8px 10px; cursor:pointer; border-bottom:1px solid var(--border-subtle); }
.addr-ac-item:last-child { border-bottom:none; }
.addr-ac-item:hover, .addr-ac-item.active { background: var(--hover-bg); }
.addr-ac-item .icon { width:16px; flex:0 0 16px; color: var(--muted); margin-top:2px; }
.addr-ac-text { display:flex; flex-direction:column; min-width:0; }
.addr-ac-main { display:flex; align-items:center; gap:6px; font-weight:600; color:var(--text); }
.addr-ac-type { display:inline-flex; align-items:center; gap:4px; font-size:11px; padding:1px 6px; border-radius:9999px; border:1px solid var(--border); background: var(--filter-bg); color: var(--muted); }
.addr-ac-type i { margin-right:4px; }
.addr-ac-sec { font-size:12px; color: var(--muted); }
/* Subtle Apartment emphasis without heavy visuals */
.addr-ac-item.apartment .icon { color: color-mix(in srgb, var(--primary) 70%, var(--muted)); }
[data-theme="dark"] .addr-ac-dropdown { box-shadow:0 10px 26px rgba(0,0,0,.6); }
[data-theme="dark"] .addr-ac-item:hover, [data-theme="dark"] .addr-ac-item.active { background: color-mix(in srgb, var(--filter-bg) 92%, transparent); }

/* Column preset buttons */
.preset-buttons { display: inline-flex; gap:4px; margin-right:8px; }
.preset-buttons .column-preset-btn { white-space:nowrap; }
.preset-buttons .column-preset-btn.active { background: transparent; color: var(--text); border-color: var(--primary); box-shadow:0 0 0 1px var(--primary); }
.user-col-presets .user-col-layout-btn.active { background: transparent; color: var(--text); border-color: var(--primary); box-shadow:0 0 0 1px var(--primary); }
.preset-buttons .user-col-layout-btn.active { background: transparent; color: var(--text); border-color: var(--primary); box-shadow:0 0 0 1px var(--primary); }

/* Column Manager Popup (centralized styles replacing inline) */
.col-popup-overlay { position:fixed; inset:0; z-index:1600; background:var(--overlay-bg); display:flex; align-items:center; justify-content:center; padding:20px; }
.col-popup-overlay:not(.open){ display:none !important; }
.col-popup-panel { opacity:0; transform:scale(.985); transition:opacity .18s ease, transform .18s ease; }
.col-popup-overlay.open .col-popup-panel { opacity:1; transform:scale(1); }
.col-popup-panel { background:var(--bg); color:var(--text); width:min(560px,92%); max-height:80vh; overflow:auto; border-radius:10px; box-shadow:0 16px 42px -8px rgba(0,0,0,.45); padding:20px 22px 24px; display:flex; flex-direction:column; gap:12px; }
.sortable-column-list { flex:1 1 auto; overflow:auto; padding:4px 2px 4px 0; display:flex; flex-direction:column; gap:4px; }
.col-popup-footer { flex:0 0 auto; display:flex; flex-direction:column; gap:12px; margin-top:4px; }
.col-popup-actions.primary-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:space-between; }
.col-popup-actions.primary-actions > button { flex:1 1 0; min-width:0; }
.col-popup-saved-layouts { display:flex; flex-direction:column; gap:6px; border-top:1px solid var(--border-subtle); padding-top:10px; }
.saved-layouts-group { display:flex; flex-direction:column; gap:6px; }
.saved-layouts-hdr { font-size:11px; font-weight:600; letter-spacing:.5px; color:var(--muted); }
.saved-layouts-hdr .sub { font-weight:400; font-size:10px; margin-left:6px; color:var(--muted); letter-spacing:0; text-transform:none; }
.saved-layouts-group.refined { background:var(--hover-bg); border:1px solid var(--border-subtle); padding:8px 10px 10px; border-radius:8px; }
.saved-layouts-list { display:flex; gap:6px; flex-wrap:wrap; }
.saved-layouts-list.pills { gap:8px; }
.saved-layout-pill { display:inline-flex; align-items:center; gap:4px; background:var(--filter-bg); border:1px solid var(--border-subtle); padding:2px 6px 2px 10px; border-radius:20px; font-size:11px; line-height:1.2; position:relative; }
.saved-layout-pill .pill-btn { background:transparent; border:none; cursor:pointer; font-size:11px; line-height:1.2; color:var(--text); padding:0; display:flex; align-items:center; }
.saved-layout-pill .pill-btn.apply { font-weight:500; }
.saved-layout-pill .pill-btn.del { width:18px; height:18px; border-radius:50%; justify-content:center; font-size:14px; color:var(--muted); }
.saved-layout-pill .pill-btn.del:hover { background:var(--hover-bg); color:var(--text); }
.saved-layout-pill:hover { background:var(--hover-bg); }
.layout-save-row.refined { margin-top:4px; }
.layout-save-row.refined input.layout-save-input { flex:1 1 auto; min-width:0; }
.layout-save-row.refined .hint { flex:0 0 auto; }
[data-theme="dark"] .saved-layouts-group.refined { background:color-mix(in srgb, var(--filter-bg) 80%, transparent); }
[data-theme="dark"] .saved-layout-pill { background:color-mix(in srgb, var(--filter-bg) 88%, transparent); }
[data-theme="dark"] .saved-layout-pill:hover { background:color-mix(in srgb, var(--filter-bg) 96%, transparent); }

/* Hidden column dim class (still visible for toggling) */
.col-hidden-dim { opacity:.55; }
.col-hidden-dim .col-label { font-style:italic; }
.saved-layout-row { display:flex; align-items:center; gap:4px; background:var(--filter-bg); border:1px solid var(--border-subtle); padding:2px 6px; border-radius:6px; }
.saved-layouts-list.list-style { display:flex; flex-direction:column; gap:4px; }
.saved-layout-row.column-item { cursor:default; grid-template-columns:1fr auto; padding:6px 10px; }
.saved-layout-row .drag-handle, .saved-layout-row input[type="checkbox"] { display:none !important; }
.saved-layout-row .saved-name { font-weight:500; flex:1 1 auto; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.saved-layout-row .saved-name:hover { text-decoration:underline; }
.saved-layout-row .saved-actions { display:inline-flex; gap:6px; align-items:center; }
.saved-layout-row .saved-actions .btn.btn-xxs { padding:2px 6px; font-size:10px; line-height:1.2; height:24px; display:inline-flex; align-items:center; }
.layout-save-row.refined, .layout-save-row { gap:8px; }
.layout-save-row.refined input.layout-save-input { height:32px; }
.layout-save-row.refined button { height:32px; display:inline-flex; align-items:center; }
.saved-rename-input { width:120px; padding:3px 6px; font-size:12px; border:1px solid var(--border); border-radius:4px; background:var(--bg); color:var(--text); }
.saved-layout-row .act.delete.confirm { background:var(--danger-bg, #b3261e); color:#fff; border-color:var(--danger-bg, #b3261e); }
[data-theme="dark"] .saved-layout-row .act.delete.confirm { background:#d64339; color:#fff; }
.saved-layout-row .act.delete.confirm:hover { filter:brightness(1.05); }
.layout-save-row { display:flex; align-items:center; gap:6px; }
.layout-save-row input.layout-save-input { flex:0 0 120px; padding:4px 6px; font-size:12px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--text); }
.layout-save-row .hint { font-size:10px; color:var(--muted); }
.btn.btn-xs { padding:2px 6px; font-size:10px; line-height:1.2; }
.col-popup-header { position:relative; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--border-subtle); padding:4px 0 12px; min-height:44px; }
.col-popup-header h5 { margin:0; font-size:16px; font-weight:600; letter-spacing:.3px; }
.col-popup-close { position:absolute; top:0; right:0; background:transparent; border:none; font-size:20px; line-height:1; cursor:pointer; color:var(--muted); border-radius:6px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; }
.col-popup-close:hover { background:var(--hover-bg); color:var(--text); }
.col-popup-sub { margin:0; font-size:12px; color:var(--muted); }
.sortable-column-list { max-height:420px; overflow:auto; display:flex; flex-direction:column; gap:6px; padding-right:4px; }
.col-section-separator { font-size:10px; letter-spacing:.5px; text-transform:uppercase; font-weight:600; color:var(--muted); margin:4px 0 2px; padding:4px 6px; border-top:1px solid var(--border-subtle); }
.column-item { background:var(--filter-bg); border:1px solid var(--border-subtle); border-radius:8px; padding:6px 10px; cursor:grab; user-select:none; font-size:12px; line-height:1.2; display:grid; grid-template-columns:22px 18px 1fr; align-items:center; gap:10px; position:relative; }
.column-item.is-hidden { opacity:.55; }
.column-item.is-hidden .col-label { font-style:italic; }
.column-item:focus-within { outline:2px solid var(--primary); outline-offset:1px; }
.column-item input[type="checkbox"] { transform:scale(1.05); cursor:pointer; margin:0; }
.column-item .drag-handle { cursor:grab; color:var(--muted); font-size:16px; line-height:1; display:flex; align-items:center; justify-content:center; width:22px; }
.column-item .drag-handle:active { cursor:grabbing; }
.column-item .drag-handle:focus-visible { outline:2px solid var(--primary); border-radius:4px; }
.column-item .col-label { font-weight:500; color:var(--text); cursor:pointer; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.column-item .col-key { font-size:10px; color:var(--muted); letter-spacing:.25px; text-align:right; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; padding-left:8px; }
.column-item:hover { background:var(--hover-bg); }
.column-item:active { cursor:grabbing; }
.column-item:focus-within { box-shadow:0 0 0 1px var(--primary) inset; }
@media (hover:hover){ .column-item { transition:background .15s, border-color .15s, box-shadow .18s; } }
[data-theme="dark"] .column-item { background:color-mix(in srgb, var(--filter-bg) 78%, transparent); color:var(--text); }
[data-theme="dark"] .column-item .col-label { color:var(--text); }
[data-theme="dark"] .column-item:hover { background:color-mix(in srgb, var(--filter-bg) 90%, transparent); }
[data-theme="dark"] .col-hidden-dim .col-label { color:color-mix(in srgb, var(--text) 55%, var(--muted)); }
.col-no-results { padding:14px 10px; text-align:center; font-size:12px; color:var(--muted); border:1px dashed var(--border-subtle); border-radius:8px; }

/* Streamlined Saved Layouts (override pill approach) */
.saved-layouts-group.refined .saved-layouts-list { flex-direction:column; width:100%; gap:4px; }
.saved-layouts-group.refined .saved-layout-pill { width:100%; justify-content:space-between; border-radius:6px; padding:4px 8px; background:var(--bg); }
.saved-layouts-group.refined .saved-layout-pill .pill-btn.apply { justify-content:flex-start; }
.saved-layouts-group.refined .saved-layout-pill .pill-btn.del { background:var(--filter-bg); }
.saved-layouts-group.refined .saved-layout-pill .pill-btn.del:hover { background:var(--hover-bg); }
[data-theme="dark"] .saved-layouts-group.refined .saved-layout-pill { background:color-mix(in srgb, var(--filter-bg) 90%, transparent); }

[data-theme="dark"] .col-section-separator { border-top-color:var(--border); }
.column-item.sortable-ghost { background:var(--primary); color:var(--primary-contrast); opacity:.25; }
.col-popup-actions { display:flex; gap:10px; padding-top:14px; border-top:1px solid var(--border-subtle); }
.col-popup-actions .btn-primary { background:var(--primary); border-color:var(--primary); color:var(--primary-contrast); }
.col-popup-actions .btn-primary:hover { filter:brightness(1.05); }
.col-popup-actions .btn-outline-secondary { background:transparent; border:1px solid var(--border); color:var(--text); }
.col-popup-actions .btn-outline-secondary:hover { border-color:var(--primary); color:var(--primary); }
.col-popup-actions #saveColumnOrder.dirty { box-shadow:none; }
.sortable-ghost { opacity:.45; }
[data-theme="dark"] .column-item { background:rgba(255,255,255,0.04); }
[data-theme="dark"] .column-item:hover { background:rgba(255,255,255,0.08); }
[data-theme="dark"] .col-popup-overlay { background:rgba(0,0,0,0.55); }
[data-theme="dark"] .col-popup-panel { box-shadow:0 16px 48px -8px rgba(0,0,0,0.7); }

/* ------------------------------------------------------------
  Deduplicate Manager Styles (migrated from JS)
  Colors use existing theme variables to support light/dark automatically
  ------------------------------------------------------------ */
.dedupe-records-flex{display:flex;gap:14px;align-items:flex-start;overflow-x:auto}
.dedupe-record-card{border:1px solid var(--border);margin-bottom:12px;border-radius:6px;min-width:300px;flex:1 0 0;background:var(--bg);box-shadow:0 1px 2px rgba(0,0,0,.04)}
.dedupe-record-card.primary-selected{border:2px solid var(--dedupe-winning-border, #059669)}
.dedupe-record-card .card-header{display:flex;justify-content:space-between;align-items:center;background:var(--filter-bg, #f9fafb);padding:6px 10px;border-bottom:1px solid var(--border, #e2e8f0)}
.dedupe-record-card .record-title strong{font-size:13px}
.dedupe-record-card .record-id{font-size:11px;color:var(--muted);margin-left:6px}
.dedupe-record-card .fields-grid{display:flex;flex-direction:column;gap:1px;padding:6px 8px 10px}
.dedupe-record-card .field-divider{margin:8px 0 4px;font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);font-weight:600;border-top:1px solid var(--border);padding-top:6px}
/* Field row refinements */
.dedupe-record-card .field-row{display:flex;align-items:center;padding:2px 6px;border-left:3px solid transparent;border-radius:4px;font-size:11px;line-height:1.25;background:var(--bg);gap:6px;min-height:22px}
.dedupe-record-card .field-row.field-neutral{background:var(--hover-bg, #f1f5f9)}
.dedupe-record-card .field-row.field-empty{background:transparent}
.dedupe-record-card .field-row.field-winning{background:var(--dedupe-winning-bg, #ecfdf5);border-left-color:var(--dedupe-winning-border, #059669)}
.dedupe-record-card .field-row.field-losing{background:var(--dedupe-losing-bg, #fef2f2);border-left-color:var(--dedupe-losing-border, #dc2626)}
.dedupe-record-card .field-row.field-derived{background:var(--bg);border-left-color:transparent;opacity:.95}
/* Horizontal layout inside each row */
.dedupe-record-card .field-row-inner{flex:1 1 auto;display:flex !important;flex-direction:row;align-items:center;gap:8px;min-width:0}
.dedupe-record-card .field-label{flex:0 0 120px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;margin:0;font-size:10.5px;color:var(--text);text-align:left}
.dedupe-record-card .field-value-text{flex:1 1 auto;word-break:break-word;min-width:0}
.field-pick-toggle{flex:0 0 22px;display:flex;align-items:center;justify-content:center;border:0;background:transparent;cursor:pointer;color:var(--muted);padding:0;height:100%;margin:0}
.field-pick-toggle.disabled{cursor:default;opacity:.3}
.field-pick-toggle:not(.disabled):hover{color:var(--primary)}
.field-pick-placeholder{display:inline-block;width:14px;height:14px}
.radio-label{display:flex;align-items:center;gap:4px;font-size:11px}
.radio-label input{cursor:pointer}
.completion-summary,.archived-records{padding:12px 4px;font-size:12px}
.archived-records ul{margin:8px 0 0;padding-left:16px}
.archived-records li{margin:2px 0}

/* Dark theme enhancement retained from old duplicate block */
[data-theme="dark"] .dedupe-modal { box-shadow:0 10px 30px rgba(0,0,0,0.6); }

/* Responsive adjustments (flex version) */
@media (max-width:768px){
  .dedupe-records-flex{flex-direction:column;}
  .dedupe-record-card{min-width:0;width:100%;}
}

/* Excluded pills section styling */
.excluded-pills-section{ border:1px solid var(--border-subtle); background:var(--filter-bg); border-radius:8px; padding:8px 10px; margin-bottom:10px; }
.excluded-pills-section .compact-filter-label{ font-weight:600; }

html, body { 
  height: 100%; 
  margin: 0; 
  padding: 0; 
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body{ 
  background: var(--bg); 
  color: var(--text); 
}

/* Auth/Landing overlay subtle transitions */
#authOverlay { opacity: 1; transition: opacity .28s ease; z-index: 2147483646; position: fixed; inset: 0; }
#authOverlay.fade-out { opacity: 0; pointer-events: none; }
#authOverlay .landing-witty { margin-top: .5rem; color: #cbd5e1; font-size: 16px; font-weight: 600; min-height: 1.6em; opacity: 0; transform: translateY(6px); transition: opacity .28s ease, transform .28s ease; }
#authOverlay .landing-witty.show { opacity: 1; transform: translateY(0); }

/* Subtle logo pulse glow */
#authOverlay .landing-logo { color: #e5e7eb; text-shadow: 0 0 0 rgba(37,99,235,0); animation: comperLogoPulse 1600ms ease-in-out infinite; }
@keyframes comperLogoPulse {
  0%   { transform: scale(1);   text-shadow: 0 0 0 rgba(37,99,235,0); }
  50%  { transform: scale(1.05); text-shadow: 0 0 18px rgba(37,99,235,0.3); }
  100% { transform: scale(1);   text-shadow: 0 0 0 rgba(37,99,235,0); }
}

/* Layout - Stable HTML structure */
.app {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.sidebar {
  width: 360px;
  min-width: 320px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  font-size: 13px;
}

/* Ensure filters section itself can scroll if content grows (mobile / nested layouts) */
.filters-section { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }
/* Sticky header & inner scroll separation */
.filters-sticky-header { position:sticky; top:0; z-index:30; background:var(--sidebar-bg); padding:0 0 .35rem 0; }
.filters-scroll-area { flex:1 1 auto; min-height:0; overflow-y:auto; padding-top:.4rem; }
.filters-scroll-area::-webkit-scrollbar { width:10px; }
.filters-scroll-area::-webkit-scrollbar-thumb { background:var(--border); border-radius:6px; }
.filters-scroll-area::-webkit-scrollbar-thumb:hover { background:var(--border-hover, #4b5563); }
.filters-scroll-area.scrolled + .filters-sticky-header { box-shadow:0 2px 4px -2px rgba(0,0,0,0.35); }

/* Results row styling (ensure consistent spacing inside sticky header) */
#filterResults.filter-results-top { padding:.25rem 0 .15rem 0; font-size:12px; color:var(--muted); border-top:1px solid var(--border); }
#filterResults.filter-results-top strong { font-size:13px; color:var(--text); }

/* App shell container semantics */
#appShell { height:100vh; display:flex; width:100%; flex-direction:row; flex:1 1 auto; }

/* Filter skeleton shimmer */
.filter-skeleton-wrapper { padding:.25rem 0 .5rem 0; }
.filter-skeleton { position:relative; overflow:hidden; background:color-mix(in srgb,var(--sidebar-bg) 92%, #888); border-radius:6px; height:48px; margin-bottom:.6rem; }
.filter-skeleton::after { content:""; position:absolute; inset:0; background:linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.18) 55%, transparent 70%); animation:filterShimmer 1.15s linear infinite; }
@keyframes filterShimmer { from { transform:translateX(-60%); } to { transform:translateX(120%); } }

/* === Presence / Filters Header === */
.filters-top-bar { display:flex; align-items:center; justify-content:space-between; gap:.75rem; padding:0 0 .25rem 0; margin-bottom:.25rem; }
.filters-presence-row { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:0 0 .5rem 0; border-bottom:1px solid var(--border); margin-bottom:.65rem; }
.filters-top-bar .app-identity { display:flex; align-items:center; gap:.6rem; min-height:34px; }
.app-name { font-weight:600; font-size:15px; letter-spacing:.5px; color:var(--text); }
.presence-avatars { display:flex; align-items:center; gap:4px; flex-wrap:wrap; max-width:180px; }
.presence-avatar { position:relative; width:28px; height:28px; border-radius:50%; background:linear-gradient(135deg,var(--primary) 0%, color-mix(in srgb,var(--primary) 65%,#000) 100%); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; color:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.25); overflow:visible; }
.presence-avatar img { width:100%; height:100%; object-fit:cover; display:block; border-radius:50%; }
.presence-avatar .avatar-initials { letter-spacing:.5px; }
.presence-avatar .badge { position:absolute; bottom:-2px; right:-2px; width:13px; height:13px; border:2px solid var(--sidebar-bg); border-radius:50%; background:#16a34a; box-shadow:0 0 0 1px rgba(0,0,0,0.15); z-index:2; }
.presence-avatar .name-label { position:absolute; bottom:-14px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:500; color:var(--muted); pointer-events:none; white-space:nowrap; line-height:1; }
.filters-presence-row { position:relative; }
.presence-avatars { padding-bottom:12px; }
.presence-avatar.idle .badge { background:#f59e0b; }
.presence-avatar.idle { opacity:.55; transition:opacity .25s; }
.presence-avatar.idle:hover { opacity:.85; }
.presence-empty { font-size:10px; color:var(--muted); }
@media (max-width:640px){ .presence-avatars { max-width:120px; } }

.sidebar .sidebar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* .search-section, .filters-section {
  margin-bottom: 1rem;
}

.search-section h4, .filters-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.search-section input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
} */

.sidebar-footer {
/* .sidebar-footer trimmed: refresh button removed; retains layout for logout/theme buttons */
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer .button-row {
  display: flex;
  gap: 0.5rem;
}

.btn-refresh {
  flex: 1;
  padding: 0.5rem;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 13px;
  min-width: 0;
}

.btn-refresh:hover {
  background: #1d4ed8;
}

.btn-refresh i {
  margin-right: 0.25rem;
}

/* What's New button - similar to btn-refresh but with distinct styling */
.btn-whats-new {
  flex: 1;
  padding: 0.5rem;
  background: var(--filter-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn-whats-new:hover {
  background: var(--hover-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-whats-new .fa-sparkles {
  font-size: 12px;
}

.main-content {
  flex: 1 1 0;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.right-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.map-panel {
  flex: 1 1 auto;
  min-height: 200px;
  overflow: hidden;
  position: relative;
}

.map {
  width: 100%;
  height: 100%;
}

/* Terra Draw interactivity is handled via mode only; no global pointer-events overrides. */

.table-panel {
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  flex: 0 0 40%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Drag resize handle (improved hit area) */
.table-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px; /* generous grip */
  cursor: row-resize;
  z-index: 5;
}
.table-panel.dragging-resize::before {
  background: linear-gradient(to bottom, var(--accentSoft, rgba(100,150,250,0.25)), transparent);
}

/* When table panel has explicit height, don't use flex basis */
.table-panel[style*="height"] {
  flex: 0 0 auto !important;
}

.table-panel.dragging-resize {
  flex: 0 0 auto !important;
  transition: none !important;
}

.map-panel.map-hidden {
  display: none;
}

/* Attribute-based fallback (stronger) for map hide/show; guards against other scripts overwriting inline display */
.map-panel[data-visible="false"],
#mapPanel[data-visible="false"] {
  display: none !important;
}

.table-panel.collapsed {
  flex: 0 0 40px;
}

.table-panel.expanded {
  flex: 1 1 100%;
}

.table-panel-fullscreen {
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  flex: 1 1 100% !important;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Table Controls Bar Styling - Clean without drag functionality */
.table-controls-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: var(--sidebar-bg) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.5rem 1rem !important; /* Reduced from 0.75rem to 0.5rem for thinner header */
  margin: 0 !important;
  min-height: 44px !important; /* Set a specific minimum height */
}

.table-controls-bar .left-controls {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
}

.table-controls-bar .right-controls {
  flex-shrink: 0 !important;
  gap: 1rem !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
}

/* Search Input Styling */
.table-controls-bar .dataTables_filter {
  margin: 0 !important;
}

.table-controls-bar .dataTables_filter label {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: var(--text) !important;
  gap: 0.5rem !important;
}

/* .table-controls-bar .dataTables_filter label::before {
  content: 'Search:' !important;
  font-size: 13px !important;
  color: var(--text) !important;
  font-weight: 600 !important;
} */

.table-controls-bar .dataTables_filter input {
  border: 1px solid var(--border) !important;
  border-radius: 3px !important;
  padding: 0.25rem 0.375rem !important;
  font-size: 11px !important;
  min-width: 160px !important; /* Reduced from 180px to fit better with compact design */
  background: var(--bg) !important;
  color: var(--text) !important;
  transition: border-color 0.15s !important;
  height: 28px !important; /* Match button height */
}

.table-controls-bar .dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

.table-controls-bar .dataTables_filter input::placeholder {
  color: var(--muted) !important;
  font-size: 10px !important;
}

/* Subtle Button Styling for all control buttons */
.table-controls-bar .control-buttons {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-shrink: 0 !important;
}

.table-controls-bar .control-buttons .btn {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  padding: 0.25rem 0.5rem !important; /* Reduced padding for more compact buttons */
  font-size: 11px !important; /* Slightly smaller font */
  font-weight: 500 !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important; /* Reduced gap between icon and text */
  white-space: nowrap !important;
  height: 28px !important; /* Set consistent height */
}

.table-controls-bar .control-buttons .btn i {
  font-size: 10px !important;
  line-height: 1 !important;
}

.table-controls-bar .control-buttons .btn:hover {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
  background: rgba(37, 99, 235, 0.04) !important;
}

.table-controls-bar .control-buttons .btn:active {
  background: rgba(37, 99, 235, 0.08) !important;
  transform: translateY(1px) !important;
}

/* Add Property Button Styling */
.table-controls-bar .add-property-btn {
  background: var(--primary) !important;
  border: 1px solid var(--primary) !important;
  color: white !important;
  padding: 0.25rem 0.75rem !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.375rem !important;
  white-space: nowrap !important;
  height: 28px !important;
  margin-right: 0.5rem !important;
}

/* =========================
  GLOBAL HISTORY (Recent Changes Panel)
  Centralized styles for global history log UI, moved from inline JS injection.
  Adjust variables for theming rather than hard-coded colors where possible.
  ========================= */
/* === Simplified Global History Items (clean minimal) === */
@keyframes ghFadeIn { 0% { opacity:0; transform:translateY(-2px);} 100% { opacity:1; transform:translateY(0);} }
.gh-item { display:flex; gap:10px; padding:8px 10px; background:var(--bg); border:1px solid var(--border-subtle); border-radius:6px; font-size:12px; line-height:1.3; cursor:pointer; }
/* Unseen items: keep border subtle, add gentle accent ring */
.gh-item.gh-unseen { border-color: var(--border-subtle); box-shadow:0 0 0 1px var(--primary); }
.gh-item.gh-new { animation: ghFadeIn .35s ease; }
.gh-avatar { width:24px; height:24px; border-radius:50%; background:var(--primary); color:var(--primary-contrast); display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:600; flex-shrink:0; }
.gh-avatar img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.gh-content { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.gh-top { display:flex; align-items:center; gap:8px; }
.gh-title { font-size:12px; font-weight:600; color:var(--text); flex:1; }
.gh-age { font-size:11px; color:var(--muted); white-space:nowrap; }
.gh-fields { display:flex; flex-direction:column; gap:2px; font-size:11px; }
.gh-fields strong { font-weight:600; }
.gh-fields em { font-style:italic; color:var(--muted); font-size:10px; }
/* End Global History styles */

/* =========================
  HISTORY OVERLAYS / PANELS (migrated from inline styles in history.js)
  ========================= */
/* Record history overlay simplified: no dim/backdrop; non-blocking outside modal */
.record-history-overlay { position:fixed; inset:0; z-index:1200; background:transparent; backdrop-filter:none; align-items:flex-start; justify-content:center; padding:60px 16px; display:flex; pointer-events:none; }
.record-history-modal { pointer-events:auto; background:var(--bg); color:var(--text); width:min(500px,95%); max-height:80vh; overflow:auto; border-radius:10px; box-shadow:0 8px 28px -6px rgba(0,0,0,.45); padding:16px 20px; font:13px system-ui,-apple-system,sans-serif; display:flex; flex-direction:column; }
.record-history-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.record-history-title { font-size:15px; }
.record-history-count { margin-left:auto; font-size:11px; color:var(--muted); }
.record-history-close { border:none; background:transparent; font-size:18px; line-height:1; cursor:pointer; color:var(--muted); }
.record-history-list { display:flex; flex-direction:column; gap:10px; }

.global-history-panel { position:fixed; top:0; right:-420px; width:400px; max-width:90%; height:100vh; z-index:1190; background:var(--bg); color:var(--text); box-shadow:-4px 0 18px -4px rgba(0,0,0,.35); display:flex; flex-direction:column; transition:right .28s ease; font:13px system-ui,-apple-system,sans-serif; }
.global-history-header { padding:12px 16px; display:flex; align-items:flex-start; gap:8px; border-bottom:1px solid var(--border-subtle); }
/* Title flexes, buttons align to right naturally */
.global-history-title { font-size:15px; margin-right:auto; }
.global-history-badge { background:var(--primary); color:var(--primary-contrast); font-size:11px; padding:2px 6px; border-radius:12px; }
.global-history-header .global-history-btn, .global-history-header .global-history-close { display:flex; align-items:center; justify-content:center; height:30px; }
.global-history-header .global-history-btn { background:var(--filter-bg); border:1px solid var(--border-subtle); }
.global-history-header .global-history-btn.mark { border-color:var(--border-subtle); }
.global-history-btn { border:none; font-size:11px; padding:4px 8px; border-radius:6px; cursor:pointer; background:var(--hover-bg); color:var(--text); }
.global-history-btn.refresh { background:#f1f5f9; color:#334155; }
.global-history-btn.mark { background:#eff6ff; color:var(--primary); }
[data-theme="dark"] .global-history-btn.refresh { background:rgba(255,255,255,.08); color:var(--text); }
[data-theme="dark"] .global-history-btn.mark { background:rgba(37,99,235,.25); color:var(--primary-contrast); }
.global-history-close { border:none; background:transparent; font-size:18px; line-height:1; cursor:pointer; color:var(--muted); }
.global-history-list { flex:1; overflow:auto; padding:12px 16px; display:flex; flex-direction:column; gap:10px; }
.open-global-history-btn { position:fixed; bottom:18px; right:18px; z-index:1180; background:var(--primary); color:var(--primary-contrast); border:none; border-radius:50%; width:46px; height:46px; display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 4px 14px -2px rgba(0,0,0,.4); }
.open-global-history-btn:hover { filter:brightness(1.05); }
.open-global-history-btn:active { transform:translateY(1px); }
.open-global-history-btn .ogh-badge { position:absolute; top:-4px; right:-4px; background:var(--primary); color:var(--primary-contrast); min-width:20px; height:20px; padding:0 6px; border-radius:20px; font-size:11px; font-weight:600; display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 2px var(--bg); }
.open-global-history-btn.ogh-muted { background:var(--btn-bg-secondary, var(--border)); color:var(--muted); }
.open-global-history-btn.ogh-muted .ogh-badge { display:none !important; }
[data-theme="dark"] .open-global-history-btn.ogh-muted { background:var(--bg-alt,#1e293b); color:var(--muted); }
/* End History Overlays */

.table-controls-bar .add-property-btn i {
  font-size: 10px !important;
  line-height: 1 !important;
}

.table-controls-bar .add-property-btn:hover {
  background: color-mix(in srgb, var(--primary) 85%, black) !important;
  border-color: color-mix(in srgb, var(--primary) 85%, black) !important;
  color: white !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.table-controls-bar .add-property-btn:active {
  background: color-mix(in srgb, var(--primary) 70%, black) !important;
  transform: translateY(0) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Address Validation Button Styling */
.edit-form-field {
  position: relative;
}

/* Address autocomplete styling */
/* Refined address autocomplete dropdown (tight + theme-aware) */
.address-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 18px -4px rgba(0,0,0,0.25);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.25;
  scrollbar-width: thin;
}

.address-autocomplete-dropdown::-webkit-scrollbar { width: 6px; }
.address-autocomplete-dropdown::-webkit-scrollbar-track { background: transparent; }
.address-autocomplete-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
[data-theme="dark"] .address-autocomplete-dropdown::-webkit-scrollbar-thumb { background: #475569; }

/* Individual prediction items tightened */
.address-prediction-item {
  padding: 4px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
  color: var(--text);
  white-space: nowrap;
}

/* Hover / keyboard highlight */
.address-prediction-item:hover,
.address-prediction-item.highlighted {
  background: var(--filter-active);
}
[data-theme="dark"] .address-prediction-item:hover,
[data-theme="dark"] .address-prediction-item.highlighted {
  background: rgba(255,255,255,0.06);
}

/* Searchable field dropdown styling (property panel edit/add forms) */
/* Type-to-search dropdowns for fields with searchable:true */
.pp-searchable-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1800;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  font-family: system-ui;
  display: none;
}

.pp-searchable-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  transition: background-color 0.15s ease;
  color: var(--text);
}

.pp-searchable-item:hover {
  background-color: var(--hover-bg);
}

.pp-searchable-item:last-child {
  border-bottom: none;
}

.address-prediction-item:last-child { border-bottom: none; }

/* Icon hidden to keep list lean; retain markup compatibility */
.address-prediction-item i { display:none; }

/* Truncate long addresses to single line */
.address-prediction-item span {
  flex:1;
  color: var(--text);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-theme="dark"] .address-prediction-item span { color: var(--text); }

.address-validation-status {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 8px;
  background: var(--muted-bg, #f8f9fa);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
}

/* === Unified Autocomplete (addr-ac-*) — theme-aware and apartment-emphasis === */
/* Wrapper ensures absolute dropdown positions correctly relative to input container */
.addr-ac-wrap { position: relative; }

/* Dropdown container */
.addr-ac-dropdown {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 1800;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 18px -4px rgba(0,0,0,0.25);
  max-height: 240px;
  overflow: auto;
  font: 12px system-ui, -apple-system, sans-serif;
  display: none;
}

/* Prediction row */
.addr-ac-item {
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background-color .15s ease, color .15s ease;
}
.addr-ac-item:last-child { border-bottom: none; }
.addr-ac-item.active,
.addr-ac-item:hover { background: var(--filter-active); }

/* Icon + text regions */
.addr-ac-item .icon { color: var(--primary); width: 14px; text-align: center; flex: 0 0 14px; }
.addr-ac-text { flex: 1; min-width: 0; }
.addr-ac-main { font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-ac-sec { color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Type badge */
.addr-ac-type {
  margin-left: 8px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text);
  background: var(--chip, var(--filter-bg));
  border: 1px solid var(--border-subtle, var(--border));
  border-radius: 999px;
  white-space: nowrap;
}

/* Apartment emphasis uses theme primary for a subtle accent */
.addr-ac-item.apartment .icon { color: var(--primary); }
.addr-ac-item.apartment .addr-ac-type {
  background: color-mix(in srgb, var(--primary) 16%, var(--chip, var(--filter-bg)) 84%);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

/* Dark theme refinements */
[data-theme="dark"] .addr-ac-dropdown { box-shadow: 0 6px 22px -6px rgba(0,0,0,0.6); }
[data-theme="dark"] .addr-ac-item:hover,
[data-theme="dark"] .addr-ac-item.active { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .addr-ac-type { color: var(--text); }
[data-theme="dark"] .addr-ac-item.apartment .addr-ac-type {
  background: color-mix(in srgb, var(--primary) 22%, var(--chip, var(--filter-bg)) 78%);
  color: var(--primary-contrast);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}



.table-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* inner wrapper will scroll */
  padding: 0;
  position: relative;
  border-top: 4px solid var(--border);
  transition: border-color 0.2s ease;
}

/* Only show drag cursor on the top border area */
.table-container::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  right: 0;
  height: 8px; /* 4px above + 4px below the border */
  cursor: grab;
  z-index: 10;
}

.table-container:hover {
  border-top-color: var(--primary);
}

.table-container:hover::before {
  cursor: grab;
}

.table-container.dragging {
  border-top-color: #9ca3af;
}

.table-container.dragging::before {
  cursor: grabbing;
}

/* DataTables customization */
.table-container table {
  margin: 0 !important;
  font-size: 12px;
  width: 100% !important;
  table-layout: auto !important;
  background: var(--bg) !important;
  color: var(--text) !important;
}

/* Pure CSS sticky layout: controls bar sits above scrollable wrapper */
.table-container .table-controls-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--sidebar-bg) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.table-container .table-scroll { flex:1 1 auto; overflow:auto; }
.table-container .table-scroll table thead th { position: sticky !important; top:0; z-index: 55; }

/* ColReorder drop indicator (blue vertical pipe) */
[data-theme] #recordsTable thead { position: relative; }
.DTCR_pointer {
  position: absolute;
  width: 4px;
  background: var(--primary) !important;
  top: 0 !important;
  z-index: 2000;
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--primary) 65%,#000);
  border-radius: 2px;
  height: 100% !important; /* now relative to thead */
  transform: translateX(-2px); /* center over boundary */
  opacity: 0.9;
}
[data-theme="dark"] .DTCR_pointer {
  box-shadow: 0 0 0 1px color-mix(in srgb,var(--primary) 40%,#fff);
}

/* While dragging a header, add subtle style */
th.DTCR_cloned, .DTCR_cloned th {
  background: color-mix(in srgb, var(--primary) 25%, var(--filter-bg)) !important;
  color: var(--text) !important;
  border: 1px solid var(--primary) !important;
  opacity: 0.95;
}
th.DTCR_cloned {
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Origin header while it's being dragged */
#recordsTable thead th.col-dragging-origin {
  background: color-mix(in srgb, var(--primary) 20%, var(--filter-bg)) !important;
  position: relative;
  transition: background .15s ease;
}
#recordsTable thead th.col-dragging-origin::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 -3px 0 var(--primary);
  pointer-events: none;
}
[data-theme="dark"] #recordsTable thead th.col-dragging-origin {
  background: color-mix(in srgb, var(--primary) 30%, var(--filter-bg)) !important;
}

/* Table headers - light and dark theme support */
.table-container table thead th { /* (non-sticky baseline; sticky version overrides above) */
  background: var(--filter-bg) !important;
  color: var(--text) !important;
  border-bottom: 2px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px -1px rgba(0,0,0,0.16);
}
/* Highlight active sort column header */
.dataTable thead th.sorting_asc,
.dataTable thead th.sorting_desc {
  background-color: var(--sort-highlight) !important; /* light green shade */
  color: var(--sort-text) !important; /* keep text readable */
}

/* Table body styling */
.table-container table tbody td {
  background: var(--bg) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
}

/* Auto-adjust column widths for better distribution */
.table-container table th,
.table-container table td {
  width: auto !important;
  min-width: 80px !important;
  max-width: 80px !important; /* Default max-width for better column distribution */
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Column width classes for different field types */
.table-container table th.col-text-long,
.table-container table td.col-text-long {
  max-width: 80px !important; /* Text fields like Name, Address */
}

.table-container table th.col-numeric,
.table-container table td.col-numeric {
  max-width: 80px !important; /* Numeric fields like prices, units */
  text-align: center !important;
}

.table-container table th.col-status,
.table-container table td.col-status {
  max-width: 80px !important; /* Status columns */
}

.table-container table th.col-location,
.table-container table td.col-location {
  max-width: 80px !important; /* Location fields */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .table-container table th,
  .table-container table td {
    max-width: 120px !important; /* Tighter constraints on smaller screens */
  }
  
  .table-container table th.col-text-long,
  .table-container table td.col-text-long {
    max-width: 120px !important;
  }
  
  .table-container table th.col-numeric,
  .table-container table td.col-numeric {
    max-width: 100px !important;
  }
}

@media (max-width: 480px) {
  .table-container table th,
  .table-container table td {
    max-width: 120px !important; /* Even tighter on mobile */
  }
  
  .table-container table th.col-text-long,
  .table-container table td.col-text-long {
    max-width: 140px !important;
  }
  
  .table-container table th.col-numeric,
  .table-container table td.col-numeric {
    max-width: 80px !important;
  }
}

/* Allow some columns to expand more */
.table-container table th:first-child,
.table-container table td:first-child {
  min-width: 80px !important;
}

/* Make sure visible columns spread across full width */
.table-container table.dataTable {
  margin-top: 0 !important;
  width: 100% !important;
}

.table-container .dataTables_wrapper {
  font-size: 12px;
}

.table-container .dataTables_filter input {
  font-size: 12px;
  padding: 0.25rem;
  margin: 0; 
}

.table-container .dataTables_info {
  font-size: 11px;
  text-align: center !important;
  padding: 0.75rem !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--border) !important;
  background: var(--filter-bg) !important;
  margin: 0 !important;
}

.table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s;
  background: var(--bg) !important;
}

.table tbody tr:hover {
  background-color: var(--filter-active) !important;
}

/* Dark theme support for table row hover */
[data-theme="dark"] .table tbody tr:hover {
  background-color: var(--filter-active) !important;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  padding: 0.5rem 0.25rem !important;
  background: #f8f9fa;
}

.table td {
  padding: 0.375rem 0.25rem !important;
  font-size: 11px;
  vertical-align: middle;
}

/* Generic .btn block removed; unified contextual button styles are defined per component */

/* Loading state */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
}

.loading-overlay > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-overlay p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 200px;
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .map-panel {
    flex: 1 1 50%;
  }
  
  .table-panel {
    flex: 0 0 50%;
  }
}

.result-list{ list-style:none; padding-left:0; margin:0; }
.result-item{ border:1px solid var(--border); border-radius:6px; padding:0.5rem; margin:0.5rem 0; background:var(--bg); }
[data-theme="dark"] .result-item { background:color-mix(in srgb,var(--bg) 92%, #000); }
.result-item header{ display:flex; justify-content:space-between; align-items:center; gap:0.5rem; }
.result-item .meta{ color:var(--muted); font-size: 12px; }
.result-item .desc{ color:var(--muted); margin:0.25rem 0 0.5rem; font-size: 12px; }

/* Compact numeric filters */
.compact-filter-row { display:flex; align-items:center; gap:0.4rem; position: relative; }

.compact-filter-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  margin: 0;
  min-width: 75px;
  flex-shrink: 0;
}

.compact-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  justify-content: flex-end; /* Align inputs to the right */
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.compact-range-input { flex:1; max-width:70px; padding:0.25rem 0.4rem; border:1px solid var(--input-border); border-radius:3px; font-size:11px; background:var(--input-bg); color:var(--input-text); transition:border-color .15s; height:26px; text-align:right; }

.compact-range-input:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.compact-range-input::placeholder {
  color: var(--muted);
  font-size: 10px;
}

/* Date filter text inputs */
.date-filter-input { text-align:left; }

/* Checkbox category filters */
.filter-checkbox-list { display:flex; flex-direction:column; gap:2px; max-height:160px; overflow-y:auto; margin-top:2px; }
.filter-checkbox-item { display:flex; align-items:center; gap:6px; font-size:11px; line-height:1.2; padding:2px 4px; border-radius:4px; }
.filter-checkbox-item:hover { background: var(--hover-bg); }
.filter-checkbox-item input[type="checkbox"] { width:14px; height:14px; margin:0; cursor:pointer; }
.filter-checkbox-item .checkbox-label { flex:1; cursor:pointer; }
.filter-checkbox-item .checkbox-label.status { position:relative; padding:2px 6px 2px 18px; border-radius:12px; font-weight:500; background:rgba(0,0,0,0.05); }
.filter-checkbox-item .checkbox-label.status::before { content:''; position:absolute; left:6px; top:50%; transform:translateY(-50%); width:8px; height:8px; border-radius:50%; background:var(--status-color,#999); }
.checkbox-filter-search { width:100%; padding:0.25rem 0.4rem; border:1px solid var(--input-border); border-radius:3px; font-size:11px; background:var(--input-bg); color:var(--input-text); margin-bottom:4px; height:26px; }
.checkbox-filter-search:focus { outline:none; border-color:var(--input-focus); box-shadow:0 0 0 1px rgba(37,99,235,0.1); }
/* Compact row alignment when placed inline */
.compact-filter-row .checkbox-filter-search { width:auto; flex:1; margin-bottom:0; }

/* Select filter compact styling */
.filter-select { width:100%; padding:0.25rem 0.4rem; border:1px solid var(--input-border); border-radius:3px; font-size:11px; background:var(--input-bg); color:var(--input-text); height:26px; }
.compact-filter-row .filter-select { width:auto; flex:1; }
.filter-select:focus { outline:none; border-color:var(--input-focus); box-shadow:0 0 0 1px rgba(37,99,235,0.1); }

/* Re-added minimal searchable input for City only */
.searchable-inline { position:relative; margin-top:4px; }
.searchable-inline input[type="text"] { width:100%; padding:4px 6px; border:1px solid var(--border); border-radius:4px; font-size:11px; background:var(--bg); color:var(--text); }
.searchable-inline input[type="text"]:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 1px rgba(37,99,235,0.15); }
.inline-pills { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.inline-pill { background:var(--primary); color:#fff; font-size:10px; padding:2px 6px; border-radius:12px; display:inline-flex; align-items:center; gap:4px; }
.inline-pill button { background:none; border:none; color:#fff; cursor:pointer; font-size:12px; line-height:1; padding:0; }
.inline-pill button:hover { opacity:0.7; }
.age-presets { display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
/* Base pill */
.age-presets .age-preset {
  background: var(--chip, var(--filter-bg));
  color: var(--text);
  border: 1px solid var(--border-subtle, var(--border));
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 14px;
  cursor: pointer;
  line-height: 1.1;
  letter-spacing: .25px;
  display:inline-flex;
  align-items:center;
  gap:2px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
/* Hover (non-active) */
.age-presets .age-preset:not(.active):hover { background: var(--hover-bg, rgba(0,0,0,0.06)); }
[data-theme="dark"] .age-presets .age-preset:not(.active):hover { background: rgba(255,255,255,0.08); }
/* Active */
.age-presets .age-preset.active {
  background: var(--primary);
  color: var(--primary-contrast, #fff);
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
}
.age-presets .age-preset.active:hover { background: var(--primary); filter: brightness(1.05); }
/* Pressed feedback */
.age-presets .age-preset:active { transform: translateY(1px); }
/* Focus accessibility */
.age-presets .age-preset:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Dark theme base tweak for better contrast */
[data-theme="dark"] .age-presets .age-preset { background: color-mix(in srgb, var(--chip, #1e293b) 88%, #000); border-color: #334155; }
[data-theme="dark"] .age-presets .age-preset.active { box-shadow: 0 0 0 1px rgba(59,130,246,0.55); }
.inline-suggestions { position:absolute; top:100%; margin-top: -18px; left:0; right:0; background:var(--bg); border:1px solid var(--border); z-index:20; max-height:160px; overflow:auto; border-top:none; }
  .active .inline-suggestions { margin-top: -36px; }
.inline-suggestions div { padding:4px 6px; font-size:11px; cursor:pointer; }
.inline-suggestions div:hover, .inline-suggestions div.active { background:var(--hover-bg); }
/* Saved filter sets UI (bottom) */
.saved-filters-container { margin-top:12px; padding-top:10px; border-top:1px solid var(--border); }
.saved-filters-actions { display:flex; gap:6px; align-items:center; }
.saved-filter-name { flex:1; margin-bottom: 0 !important; padding:0.55rem 0.65rem; font-size:12px; border:1px solid var(--border); border-radius:4px; background:var(--bg); line-height:1.1; height:38px; display:flex; align-items:center; box-sizing:border-box; }
.saved-filter-name:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 1px rgba(37,99,235,0.15); }
.saved-filter-name.error { border-color:#dc2626; background:rgba(220,38,38,0.05); }
.saved-filters-list { margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.saved-filter-item { display:flex; align-items:center; justify-content:space-between; background:var(--panel-bg,rgba(0,0,0,0.03)); padding:4px 6px; border-radius:4px; font-size:11px; }
.saved-filter-item .buttons { display:flex; gap:4px; }
.saved-filter-item button { font-size:10px; padding:2px 6px; border:1px solid var(--border); background:var(--bg); border-radius:4px; cursor:pointer; }
.saved-filter-item button.load { background:var(--primary); color:#fff; border:none; }
.saved-filter-item button.load:hover { filter:brightness(1.1); }
.saved-filter-item button.star { background:var(--bg); color:#ae146c; border:1px solid #ae146c; }
.saved-filter-item button.star:hover { background:#ae146c; color:#fff; }
[data-theme] .saved-filter-item button.star.active { background:#ae146c; color:#fff; }
[data-theme] .saved-filter-item button.star.active:hover { filter:brightness(1.05); }
[data-theme="dark"] .saved-filter-item button.star { background:#1e293b; color:#ae146c; border-color:#ae146c; }
[data-theme="dark"] .saved-filter-item button.star:hover { background:#ae146c; color:#000; }
[data-theme="dark"] .saved-filter-item button.star.active { background:#ae146c; color:#000; border-color:#ae146c; }
[data-theme="dark"] .saved-filter-item button.star.active:hover { filter:brightness(1.1); }
.saved-filter-item button.del { background:var(--bg); color:#dc2626; }
[data-theme="dark"] .saved-filter-item button.del { background:color-mix(in srgb,var(--bg) 85%, #000); }
[data-theme="dark"] .saved-filter-item button.del { background:#1e293b; }
.saved-filter-item button.del.confirm { background:#dc2626; color:#fff; }
.saved-filter-item button.del.confirm::after { content:' Confirm'; font-weight:600; }
.saved-filter-item button.del:hover { filter:brightness(0.95); }

/* Filter summary line */
.filter-summary-line { margin-top:2px; font-size:11px; color:var(--text-secondary,#555); line-height:1.2; font-style:italic; }
[data-theme="dark"] .filter-summary-line { color:#94a3b8; }

/* Active filtered column header highlight */
.table th.filtered-active { background:var(--primary-soft,#e0f2fe) !important; }
[data-theme="dark"] .table th.filtered-active { background:rgba(59,130,246,0.25) !important; }
/* th.filtered-active::after { content:''; position:absolute; left:0; bottom:0; height:3px; width:100%; background:var(--primary); opacity:0.6; } */

/* Filter section label styling */
.filter-section > label, .filter-section .compact-filter-row > label { 
  margin-bottom:0.5rem; font-size:12px; color:var(--text); transition:color 0.15s ease; text-align:left; display:block;
}

.filter-section.active label {
  color: var(--primary);
  font-weight: 600;
}

/* Subtle active filter background + outline (restored) */
.filter-section { border:1px solid transparent; border-radius:6px; padding:0.5rem; margin:0.5rem 0; transition:background .15s,border-color .15s; }
.filter-section.active { background:rgba(59,130,246,0.06); border-color:rgba(59,130,246,0.25); }
[data-theme="dark"] .filter-section.active { background:rgba(59,130,246,0.12); border-color:rgba(59,130,246,0.4); }

/* Unified button styling (match .btn-refresh). Use as primary action buttons. */
.reset-filters-btn, .btn-save-filter { flex:1; padding:0.55rem 0.75rem; background:var(--primary); color:var(--primary-contrast); border:none; border-radius:4px; cursor:pointer; transition:background-color .2s, box-shadow .2s; font-size:13px; min-width:0; display:block; font-weight:500; line-height:1.1; }
.reset-filters-btn:hover, .btn-save-filter:hover { background:#1d4ed8; box-shadow:0 2px 4px rgba(0,0,0,0.1); }
.reset-filters-btn:active, .btn-save-filter:active { background:#1e46c4; box-shadow:0 1px 2px rgba(0,0,0,0.15); }
.reset-filters-btn:disabled, .btn-save-filter:disabled { opacity:.6; cursor:not-allowed; box-shadow:none; }
/* Header reset button should not stretch full width */
.sidebar-header .reset-filters-btn { flex:0 0 auto; padding:0.4rem 0.85rem; font-size:12px; line-height:1.2; }
.sidebar-header { align-items:center; }
/* Align saved filter name input height to primary button */
.saved-filters-actions { justify-content:space-between; }
/* .saved-filter-name consolidated above */
.btn-save-filter { height:38px; display:flex; align-items:center; justify-content:center; }
.saved-filter-item button.load { padding:4px 8px; }
.saved-filter-item button.del { padding:4px 6px; }

/* Top results counter */
.filter-results-top { font-size:11px; color:var(--text); margin:0 0 6px 0; padding:4px 6px; background:var(--panel-bg,rgba(0,0,0,0.03)); border:1px solid var(--border); border-radius:4px; }
.filter-results-top strong { color:var(--primary); }

.filter-range-display {
  font-weight: normal;
  color: var(--muted);
  font-size: 11px;
}

/* Deprecated dual range slider styles removed */

/* INPUT-BASED NUMERIC FILTER STYLES */
.numeric-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.range-inputs-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.range-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg);
  /* Dark theme automatically adapts via var(--bg); ensure contrast if needed */
  color: var(--text);
  min-width: 0;
  box-sizing: border-box;
}

.range-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.25);
}

.range-separator {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
  font-size: 12px;
}

.range-display {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
}

/* SEARCH FILTER STYLES */
.search-filter-container {
  position: relative;
  width: 100%;
}

.search-filter-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text);
  box-sizing: border-box;
}

.search-filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.25);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 150px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-dropdown-option {
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text);
}

.search-dropdown-option:hover {
  background-color: var(--hover);
}

.search-dropdown-option:last-child {
  border-bottom: none;
}

/* Removed obsolete .filter-pills-container / .filter-pill styles (superseded) */

/* Removed unused .range-min / .range-max helpers */

.left-controls, .right-controls {
  gap: 0.5rem !important;
}

.left-controls .form-select {
  font-size: 12px;
  padding: 0.25rem 0.5rem;
  min-width: 80px;
}

.right-controls input[type="search"] {
  font-size: 12px;
  padding: 0.25rem 0.5rem;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

.right-controls input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.custom-cols-btn, .custom-map-btn {
  display: inline-block;
}

/* Column Visibility Popup */
.column-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.column-popup {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.popup-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--filter-bg);
}

.popup-header h6 {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  color: var(--text);
}

.popup-body {
  padding: 1rem;
  max-height: 50vh;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}

.column-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sortable-list {
  min-height: 200px;
}

.column-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: grab;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

/* Earlier .column-item:hover removed (later enhanced override retained) */

.column-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  cursor: grabbing;
  z-index: 1000;
}

.column-item[draggable="true"] {
  cursor: grab;
}

.column-item[draggable="true"]:active {
  cursor: grabbing;
}

.drag-handle {
  color: var(--muted);
  font-size: 12px;
  cursor: grab;
  writing-mode: vertical-lr;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s ease;
}

.drag-handle:hover {
  color: #4b5563 !important;
}

.column-item:active .drag-handle {
  cursor: grabbing;
}

.column-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex: 1;
  font-size: 13px;
  margin: 0;
  transition: color 0.2s ease;
}

.column-checkbox:hover {
  color: var(--primary);
}

.column-checkbox input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.checkmark {
  position: relative;
}

.popup-section {
  margin-bottom: 1rem;
}

.popup-section p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px 0;
  font-style: italic;
}

.popup-section .instructions {
  background: var(--filter-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.popup-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--filter-bg);
}

.popup-footer .btn {
  flex: 1;
  min-width: 80px;
  font-size: 12px;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-footer .btn:hover {
  background: var(--border);
  border-color: var(--primary);
  color: var(--primary);
}

.popup-footer .btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

.popup-footer .btn-primary:hover {
  background: #0056b3;
  border-color: #0056b3;
  color: white;
}

/* Table Panel Enhancements */
.main-content .right-panel {
  position: relative;
}

#tablePanel {
  position: relative;
  transition: height 0.3s ease;
  min-height: 200px;
}

#mapPanel.map-hidden {
  display: none;
}

/* Responsive Table Controls */
@media (max-width: 768px) {
  .table-controls-bar {
    flex-direction: column !important;
    gap: 0.5rem !important;
    padding: 0.5rem 0.75rem !important;
  }
  
  .table-controls-bar .left-controls {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .table-controls-bar .right-controls {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .table-controls-bar .control-buttons {
    gap: 0.75rem !important;
  }
  
  .table-controls-bar .dataTables_filter input {
    min-width: 200px !important;
  }
  
  .column-popup {
    width: 95%;
    max-width: none;
  }
}

/* Exclude Empty Value Options */
.exclude-empty-option {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
}

.exclude-empty-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  color: var(--text); /* Changed from muted to text for better visibility */
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.exclude-empty-checkbox:hover {
  color: var(--primary);
}

.exclude-empty-input {
  margin: 0;
  width: auto;
  cursor: pointer;
}

.checkmark-small {
  width: 14px; /* Increased from 12px */
  height: 14px;
  border: 2px solid var(--border); /* Increased border thickness */
  border-radius: 3px;
  background: var(--bg);
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.exclude-empty-input:checked + .checkmark-small {
  background: var(--primary);
  border-color: var(--primary);
}

.exclude-empty-input:checked + .checkmark-small::after {
  content: '✓';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 10px; /* Increased from 8px */
  font-weight: bold;
}

.exclude-empty-input {
  display: none; /* Hide the default checkbox */
}

.exclude-empty-label {
  line-height: 1.3;
  flex: 1;
  font-weight: 500; /* Make text slightly bolder */
}

/* Active state for filter sections with exclude empty checked */
.filter-section.active .exclude-empty-checkbox {
  color: var(--primary);
  font-weight: 600;
}

/* Filter Results Counter */
.filter-results {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
  font-size: 14px;
  color: var(--text);
}

.filter-results strong {
  color: var(--primary);
  font-weight: 600;
}

/* Map marker styling overrides to prevent blue backgrounds */
gmp-advanced-marker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.GMAMP-maps-pin-view {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.gm-pin-label{position:absolute;left:50%;top:50%;transform:translate(-50%,calc(-50% - 30px));background:rgba(17,24,39,.85);color:#f8fafc;font:500 11px/1.3 system-ui,-apple-system,sans-serif;padding:4px 8px;border-radius:10px;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.4);transition:background .18s,box-shadow .18s;white-space:pre;/* preserve manual newlines only */text-align:center;}
[data-theme='light'] .gm-pin-label{background:rgba(255,255,255,.9);color:#111827;border:1px solid rgba(0,0,0,.15);}
.gm-pin-label:hover{background:rgba(99,102,241,.95);box-shadow:0 3px 12px rgba(0,0,0,.5);} 
.adv-pin-wrap{overflow:visible !important;}
.pin-field-selector{position:fixed;top:20px;right:20px;background:var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 32px rgba(0,0,0,.25);padding:16px;max-width:300px;z-index:1500;font:14px system-ui;color:var(--text);}
.pin-field-selector h4{margin:0 0 12px 0;font-size:16px;font-weight:600;display:flex;justify-content:space-between;align-items:center;}
.pin-field-selector .close-btn{background:none;border:none;font-size:18px;cursor:pointer;color:var(--muted);padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center;}
.pin-field-selector .close-btn:hover{color:var(--text);}
.pin-field-list{display:grid;gap:8px;max-height:300px;overflow-y:auto;}
.pin-field-item{display:flex;align-items:center;gap:8px;padding:6px;border-radius:6px;cursor:pointer;transition:background .15s;}
.pin-field-item:hover{background:var(--filter-bg);}
.pin-field-item input[type="checkbox"]{margin:0;cursor:pointer;}
.pin-field-item label{cursor:pointer;flex:1;margin:0;font-size:13px;}

/* Map container styling */
.map {
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Map marker hover effects */
gmp-advanced-marker:hover {
  z-index: 999;
  transform: scale(1.1);
  transition: transform 0.2s ease;
}

/* Enhanced Column Management Overlay */
.column-item:hover {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
}

.column-item:active {
  cursor: grabbing !important;
}

.sortable-ghost {
  opacity: 0.4;
  background: #ddd6fe !important;
  border-color: #8b5cf6 !important;
}

.drag-handle:hover {
  color: #4b5563 !important;
}

/* Smooth transitions for popup */
#columnVisibilityPopup {
  transition: all 0.2s ease;
}

/* Button styling for column manager */
.btn-outline-secondary {
  border: 1px solid #d1d5db;
  color: #6b7280;
  background: transparent;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-outline-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* === DATATABLES BUTTONS AND MODALS DARK THEME === */

/* DataTables buttons */
.dt-button,
.dt-btn,
.btn {
  background: var(--filter-bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  margin: 0 2px !important;
}

.dt-button:hover,
.dt-btn:hover,
.btn:hover {
  background: var(--filter-active) !important;
  border-color: var(--primary) !important;
  color: var(--text) !important;
}

.dt-button:active,
.dt-button.active,
.dt-btn:active,
.btn:active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-contrast) !important;
}

/* All DataTables popup containers and overlays */
.dt-button-collection,
.dt-button-background,
.dataTables_wrapper .dt-button-collection,
.DTCR_clonedTable,
.modal,
.modal-dialog,
.modal-content,
.dropdown-menu,
.popover,
.tooltip {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  color: var(--text) !important;
}

/* Specific targeting for Export and Column visibility popups */
[data-theme="dark"] .dt-button-collection,
[data-theme="dark"] .dt-button-background,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu {
  background: var(--bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

/* DataTables popup menu items */
.dt-button-collection .dt-button,
.dt-button-collection .dt-btn,
.modal-body .form-check,
.dropdown-item {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  width: 100% !important;
  text-align: left !important;
  padding: 8px 16px !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.dt-button-collection .dt-button:hover,
.dt-button-collection .dt-btn:hover,
.dropdown-item:hover {
  background: var(--filter-active) !important;
  color: var(--text) !important;
}

/* Form controls in popups */
[data-theme="dark"] input[type="radio"],
[data-theme="dark"] input[type="checkbox"],
.dt-button-collection input[type="radio"],
.dt-button-collection input[type="checkbox"],
.modal input[type="radio"],
.modal input[type="checkbox"] {
  accent-color: var(--primary) !important;
  margin-right: 8px !important;
}

/* Modal headers and footers */
[data-theme="dark"] .modal-header,
.dt-button-collection .modal-header {
  background: var(--filter-bg) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .modal-footer,
.dt-button-collection .modal-footer {
  background: var(--filter-bg) !important;
  border-top: 1px solid var(--border) !important;
}

[data-theme="dark"] .modal-title,
.dt-button-collection .modal-title {
  color: var(--text) !important;
}

/* Text and labels in popups */
[data-theme="dark"] .form-check-label,
[data-theme="dark"] .form-label,
.dt-button-collection label,
.modal label {
  color: var(--text) !important;
}

/* Overlay background for any dropdowns */
.dt-button-background,
.modal-backdrop {
  background: rgba(0, 0, 0, 0.3) !important;
}

/* Close buttons */
[data-theme="dark"] .btn-close,
.dt-button-collection .btn-close {
  color: var(--muted) !important;
  background: none !important;
  border: none !important;
}

[data-theme="dark"] .btn-close:hover,
.dt-button-collection .btn-close:hover {
  color: var(--text) !important;
}

/* === EDIT MODAL STYLING === */

.edit-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-modal {
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.edit-modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--filter-bg);
}

.edit-modal-header h3 {
  margin: 0;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}

.edit-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-modal-close:hover {
  color: var(--text);
}

.edit-modal-body {
  padding: 1.1rem 1.15rem; /* denser */
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}

.edit-form-grid {
  display: grid;
  gap: 0.75rem; /* denser */
  margin-bottom: 1rem; /* denser */
}

/* Default edit mode - 2 column grid */
.edit-form-grid.edit-mode {
  grid-template-columns: 1fr 1fr;
}

/* Add mode - single column with groups */
.edit-form-grid.add-mode {
  grid-template-columns: 1fr;
}

.edit-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem; /* denser */
}

/* Full width fields */
.edit-form-field.full-width {
  grid-column: 1 / -1;
}

/* Field groups for add mode */
.edit-form-field-group {
  display: grid;
  gap: 0.75rem; /* denser */
  grid-column: 1 / -1;
}

.edit-form-field-group.two-cols {
  grid-template-columns: 1fr 1fr;
}

.edit-form-field-group.three-cols {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Field groups contain individual form fields */
.edit-form-field-group .edit-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.edit-form-field label {
  font-weight: 600;
  font-size: 12px; /* slightly smaller */
  color: var(--text);
  margin: 0;
  line-height: 1.15;
}

.edit-form-field input,
.edit-form-field select,
.edit-form-field textarea {
  padding: 0.4rem 0.55rem; /* denser */
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px; /* denser */
  background: var(--input-bg);
  color: var(--input-text);
  transition: border-color 0.15s, background-color 0.2s;
  line-height: 1.2;
}
/* Group headers in unified add/edit engine */
/* .group-header { grid-column:1 / -1; margin:0.75rem 0 0.25rem; }
.group-header h4 { margin:0; font-size:13px; font-weight:600; color:var(--text); letter-spacing:.5px; text-transform:uppercase; opacity:.85; }
.group-fields { display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); } */
/* Promoted (status-relevant / auto-set) field highlight – subtle, no fill */
.promoted-field { 
  position: relative;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: transparent;
  /* soft ring via box-shadow instead of fill */
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 32%, transparent);
  transition: border-color .35s ease, box-shadow .5s ease, opacity .4s ease;
}
/* Badge for promoted fields (optional visual) */
/* .promoted-field:after { content:''; position:absolute; top:4px; right:4px; width:6px; height:6px; background:var(--primary); border-radius:50%; box-shadow:0 0 0 2px var(--bg); opacity:.9; } */
/* (animation removed for calmer UI; respects reduced motion implicitly) */
/* Subtle auto-set hint */
/* .auto-date-hint removed (status flare messaging deprecated) */
[data-theme="dark"] .promoted-field { 
  background: transparent;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent);
}
/* removed pulse keyframes (kept name unused) */
.status-required input:not([readonly]), .status-required select, .status-required textarea { border-color: var(--primary); box-shadow:0 0 0 1px rgba(59,130,246,0.25); }
.status-required label { color: var(--primary); }

/* Status change focus (auto-date applied / status differs from original) */
.status-focus { background: var(--filter-active); border:1px solid var(--primary); border-radius:6px; padding:4px 6px 6px; margin:-2px -2px 6px; transition: background .25s, border-color .25s; }
[data-theme="dark"] .status-focus { background: rgba(59,130,246,0.18); }
.status-focus label { color: var(--primary); }

/* Layout Engine Enhancements */
.layout-divider { 
  margin: 24px 0 12px; 
  position:relative;
  font-size:11px;
  font-weight:600;
  letter-spacing:.5px;
  text-transform:uppercase;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
}
/* .layout-divider:before, .layout-divider:after { content:''; flex:1; height:1px; background:var(--border); }
.layout-divider span { flex:0 0 auto; padding:2px 6px; background:var(--filter-bg); border:1px solid var(--border); border-radius:12px; font-weight:500; } */
.layout-divider.surfaced span { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
/* Dark mode refinements for layout elements */
[data-theme="dark"] .layout-divider span { background: color-mix(in srgb, var(--filter-bg) 70%, var(--bg)); }
/* (previous gradient background removed for subtlety) */

/* Optional density toggle class (apply .dense on .edit-modal or body to force tighter spacing further) */
.dense .edit-form-grid { gap:0.6rem; }
.dense .edit-form-field { gap:0.3rem; }
.dense .edit-form-field input,
.dense .edit-form-field select,
.dense .edit-form-field textarea { padding:0.35rem 0.5rem; font-size:11px; }
.dense .layout-divider { margin:8px 0 2px; }

/* Compact inline label/field for normal width (label left, input right) */
.edit-form-field:not(.full-width) { display:flex; flex-direction:column; }
@media (min-width: 900px) {
  .edit-form-field:not(.full-width) > label { font-size:11px; margin-bottom:2px; }
}

/* duplicate .promoted-field rule removed */

/* Readonly fields (like City/State/Zip after address autofill) - subtle background so text is legible */
.edit-form-field input[readonly] {
  background: color-mix(in srgb, var(--filter-bg) 92%, var(--bg));
  color: var(--input-text);
  cursor: not-allowed;
  opacity: 0.95;
}
[data-theme="dark"] .edit-form-field input[readonly] {
  background: color-mix(in srgb, var(--filter-bg) 70%, var(--bg));
  opacity: 0.9;
}

/* Auto-filled (address-derived) highlight state */
.edit-form-field input.autofilled,
.edit-form-field select.autofilled,
.edit-form-field textarea.autofilled {
  background: #f0f9ff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.25);
  transition: background 1s ease, border-color .4s ease, box-shadow .4s ease;
}
[data-theme="dark"] .edit-form-field input.autofilled,
[data-theme="dark"] .edit-form-field select.autofilled,
[data-theme="dark"] .edit-form-field textarea.autofilled {
  background: rgba(59,130,246,0.18) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
}

/* Fade-out helper class once we remove highlight (optional future use) */
.autofilled-fade {
  transition: background 1.5s ease;
}

.edit-form-field input:focus,
.edit-form-field select:focus,
.edit-form-field textarea:focus {
  outline: none;
  border-color: var(--input-focus);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.edit-form-field textarea {
  resize: vertical;
  min-height: 80px;
  grid-column: 1 / -1; /* Full width for textarea */
}

.edit-form-field:nth-child(n+8) {
  grid-column: 1 / -1; /* Full width for description and URL */
}

.edit-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.edit-form-actions .btn {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-form-actions .btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.edit-form-actions .btn-secondary:hover {
  background: var(--filter-bg);
  border-color: var(--primary);
}

.edit-form-actions .btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: var(--primary-contrast);
}

.edit-form-actions .btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.edit-form-actions .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive design for edit modal */
@media (max-width: 768px) {
  .edit-modal {
    width: 95%;
    max-width: none;
  }
  
  .edit-form-grid {
    grid-template-columns: 1fr;
  }
  
  .edit-form-field textarea,
  .edit-form-field:nth-child(n+8) {
    grid-column: 1;
  }
}

/* === MODERN NOTIFICATION SYSTEM (single top-center) === */
.notification-container { position:fixed; top:16px; left:0; right:0; width:100%; z-index:10000; pointer-events:none; display:flex; flex-direction:column; gap:12px; align-items:center; }
.notification { background:var(--bg); border:1px solid var(--border); border-radius:8px; box-shadow:0 10px 25px rgba(0,0,0,.12); min-width:300px; max-width:min(640px,90vw); width:auto; opacity:0; transform:translateY(-14px); transition:all .32s cubic-bezier(.16,.8,.3,1); pointer-events:auto; }
.notification-show { opacity:1; transform:translateY(0); }
@media (max-width:640px){ .notification { min-width:260px; } }

.notification-content { display:flex; align-items:center; padding:14px 16px; gap:12px; }

.notification-icon {
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.notification-message {
  flex: 1;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

/* Avatar variant for history toasts */
.notification-with-avatar .notification-content { align-items:flex-start; }
.notification-with-avatar .notification-avatar { width:32px; height:32px; border-radius:50%; object-fit:cover; flex-shrink:0; box-shadow:0 0 0 1px var(--border); }
.notification-with-avatar .notification-avatar-fallback { width:32px; height:32px; border-radius:50%; background:var(--chip); color:var(--primary); display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; flex-shrink:0; }
.notification-with-avatar .notification-message { font-size:13px; line-height:1.35; }
.notification-history-inline-fields { display:inline; color:var(--muted); }
.notification-history-inline-fields strong { color:var(--text); font-weight:500; }

.notification-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background: var(--filter-bg);
  color: var(--text);
}

/* Success notification */
.notification-success {
  border-left: 4px solid #22c55e;
}

.notification-success .notification-icon {
  background: #dcfce7;
  color: #16a34a;
}

/* Error notification */
.notification-error {
  border-left: 4px solid #ef4444;
}

.notification-error .notification-icon {
  background: #fef2f2;
  color: #dc2626;
}

/* Info notification */
.notification-info {
  border-left: 4px solid var(--primary);
}

.notification-info .notification-icon {
  background: var(--chip);
  color: var(--primary);
}

/* Dark theme adjustments for notifications */
[data-theme="dark"] .notification-success .notification-icon {
  background: #14532d;
  color: #22c55e;
}

[data-theme="dark"] .notification-error .notification-icon {
  background: #7f1d1d;
  color: #ef4444;
}

[data-theme="dark"] .notification-info .notification-icon {
  background: #1e3a8a;
  color: #3b82f6;
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
  .notification-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .notification {
    min-width: auto;
    max-width: none;
  }
}

/* Global History: Load More button */
.global-history-load-more { margin:10px auto 14px; display:block; background:var(--btn-bg,#2563eb); color:var(--btn-text,#fff); border:none; padding:6px 14px; font-size:12px; border-radius:4px; cursor:pointer; box-shadow:0 2px 4px rgba(0,0,0,.1); }
.global-history-load-more:hover { background:var(--btn-bg-hover,#1d4ed8); }
[data-theme="dark"] .global-history-load-more { background:var(--btn-bg,#1d4ed8); }
[data-theme="dark"] .global-history-load-more:hover { background:var(--btn-bg-hover,#2563eb); }
.gh-all-caught-up { margin:12px 8px 4px; padding:6px 10px; font-size:11px; color:var(--muted); background:var(--bg-alt,#f1f5f9); border:1px solid var(--border-subtle,var(--border)); border-radius:4px; text-align:center; }
[data-theme="dark"] .gh-all-caught-up { background:var(--bg-alt,#1e293b); }

/* === PROPERTY PANEL (Flyout) ================================================= */
#propertyPanel.property-panel { position:fixed; top:0; right:-520px; width:500px; max-width:95%; height:100vh; z-index:1300; background:var(--bg); color:var(--text); box-shadow:-4px 0 18px -4px rgba(0,0,0,.4); display:flex; flex-direction:column; transition:right .3s ease; font:13px system-ui,-apple-system,sans-serif; }
@media (max-width:900px){ #propertyPanel.property-panel { width:420px; } }
@media (max-width:640px){ #propertyPanel.property-panel { width:100%; right:-100%; } }

/* Add quick notes */
.pp-add-note-actions { display: flex; justify-content: space-between; }
/* #propPanelAddNoteContainer  */
.pp-add-note-temp { padding: 8px; }

.pp-section { margin-bottom:14px; }
.pp-sec-h { font-weight:600; font-size:12px; margin:2px 0 6px; display:flex; align-items:center; gap:6px; }
.pp-row-grid { display:grid; gap:10px; }
.pp-row-grid.edit-row { gap:12px; }
.pp-row-grid.cols-2 { grid-template-columns:repeat(2,1fr); }
.pp-row-grid.cols-3 { grid-template-columns:repeat(3,1fr); }
.pp-row-grid.cols-4 { grid-template-columns:repeat(4,1fr); }
.pp-field-col-wrap { display:flex; flex-wrap:wrap; gap:12px; }
.pp-edit-col { display:flex; flex-direction:column; flex:1 1 calc(50% - 12px); }
.pp-edit-col.pp-full { flex:1 1 100%; }
.pp-edit-row { display:flex; flex-direction:column; gap:2px; margin-bottom:6px; }
.pp-edit-label { font-size:11px; color:var(--muted-strong); text-transform:uppercase; letter-spacing:.5px; }
.pp-req-asterisk { color:#dc2626; margin-left:2px; }
.pp-input { padding:6px 8px; border:1px solid var(--border); border-radius:4px; font-size:12px; background:var(--input-bg); color:var(--input-text); }
.pp-input:disabled { background:var(--disabled-bg,#f1f5f9); color:var(--muted); cursor:not-allowed; }
.pp-textarea { resize:vertical; }
.pp-no-notes { color:var(--muted); font-size:12px; }
.pp-note-item { padding:6px 8px; border-width: 0 0 1px 0; border-style:solid; border-color:var(--border-subtle); }
  .pp-note-item:first-child { border-top: 1px solid var(--border-subtle); }
/* (Removed earlier duplicate accordion styles; canonical definitions live in panel section near file end) */
.pp-hist-loading, .pp-hist-empty, .pp-hist-error { margin-top:12px; font-size:12px; color:var(--muted); }
.pp-hist-error { color:#b91c1c; }
.pp-history-controls { display:flex; align-items:center; gap:8px; margin:20px 0 8px; }
.pp-history-title { font-weight:600; font-size:12px; }
.pp-history-spacer { flex:1 1 auto; }
.pp-hist-ctrl-btn { background:var(--btn-bg-secondary,#e2e8f0); color:var(--btn-text-secondary,#334155); border:none; padding:4px 8px; border-radius:4px; font-size:11px; cursor:pointer; }
.pp-hist-header { display:flex; gap:6px; align-items:center; font-size:11px; padding:6px 8px; cursor:pointer; }
.pp-hist-action { font-weight:600; color:var(--text); }
.pp-hist-user { color:var(--muted); }
.pp-hist-age { margin-left:auto; color:var(--muted-strong,#475569); }
.pp-hist-header i { font-size:10px; color:var(--muted); transition:transform .18s ease; }
.pp-hist-body { display:none; padding:6px 8px; border-top:1px solid var(--border); }
.pp-hist-diff { width:100%; border-collapse:collapse; font-size:11px; }
.pp-hist-diff td { padding:2px 4px; border:1px solid var(--border-subtle); }
.pp-hist-diff td.key { color:var(--muted); background:var(--bg); }
.pp-hist-diff td.before { color:#b91c1c; background:#fef2f2; }
.pp-hist-diff td.after { color:#166534; background:#f0fdf4; }
.pp-hist-no-diff { font-size:11px; color:var(--muted); }
.pp-hist-diff td.note-addition { color:#166534; background:#f0fdf4; font-style:italic; }
.pp-inline-label { font-size:9px; letter-spacing:.6px; text-transform:uppercase; color:var(--muted); }
.pp-inline-editor-actions { display:flex; gap:6px; margin-top:4px; }
.pp-inline-editor-actions button { background:var(--btn-bg,#2563eb); color:var(--btn-text,#fff); border:none; padding:2px 8px; border-radius:4px; font-size:11px; cursor:pointer; }
.pp-micro-input { padding:4px 6px; font-size:12px; }
.pp-pill-dirty { box-shadow:0 0 0 2px rgba(37,99,235,.25); }
.pp-pill-empty { opacity:.5; }
.pp-field-empty { min-height:34px; display:flex; flex-direction:column; }
.pp-field-empty-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; }
.pp-field-empty-val { font-size:12px; color:var(--muted); }
.is-hidden { display:none !important; }
[data-theme="dark"] .pp-hist-diff td.before { background:#3b1f1f; color:#fca5a5; }
[data-theme="dark"] .pp-hist-diff td.after { background:#1f3b24; color:#86efac; }
[data-theme="dark"] .pp-hist-diff td.note-addition { background:#1f3b24; color:#86efac; }
[data-theme="dark"] .pp-inline-label { color:var(--muted); }
[data-theme="dark"] .pp-acc-body { background:var(--bg-alt,#1e293b); }

#propertyPanel .pp-header { padding:14px 16px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--border); }
#propertyPanel .pp-title { font-size:16px; font-weight:600; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#propertyPanel .pp-mode-btns { display:flex; gap:6px; }
#propertyPanel .pp-close-btn { background:transparent; color:var(--muted); border:none; font-size:20px; line-height:1; cursor:pointer; }
#propertyPanel .pp-close-btn:hover { color:var(--text); }

#propertyPanel .pp-body { flex:1; overflow:auto; padding:12px 18px; display:flex; flex-direction:column; gap:14px; }

/* Meta section */
#propertyPanel .pp-meta { display:flex; flex-direction:column; gap:4px; }
#propertyPanel .pp-meta-title { font-size:14px; font-weight:600; }
#propertyPanel .pp-meta-id { color:var(--muted); font-size:12px; }
#propertyPanel .pp-meta-address { color:var(--text); font-size:12px; opacity:.8; }

/* Sections */
#propertyPanel .pp-section { margin-bottom:14px; }
#propertyPanel .pp-sec-h { font-weight:600; font-size:12px; margin:2px 0 6px; display:flex; align-items:center; gap:6px; text-transform:none; }

/* Grid / columns */
#propertyPanel .pp-field-col-wrap { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-start; }
#propertyPanel .pp-edit-col { min-width:180px; flex:1 1 calc(50% - 12px); }
#propertyPanel .pp-edit-col.pp-full { flex:1 1 100%; }
#propertyPanel .pp-row-grid { width:100%; }
@media (max-width:900px){
  #propertyPanel .pp-field-col-wrap { gap:12px; }
  #propertyPanel .pp-edit-col { flex:1 1 calc(50% - 12px); }
  #propertyPanel .pp-row-grid { grid-template-columns:repeat(auto-fill,minmax(160px,1fr)) !important; }
}
@media (max-width:640px){
  #propertyPanel .pp-field-col-wrap { flex-direction:column; }
  #propertyPanel .pp-edit-col { flex:1 1 100% !important; }
  #propertyPanel .pp-row-grid { grid-template-columns:1fr !important; }
}

/* Edit rows */
#propertyPanel .pp-edit-row { display:flex; flex-direction:column; gap:2px; margin-bottom:0px; }
#propertyPanel .pp-edit-row label { font-size:11px; color:var(--text); text-transform:uppercase; letter-spacing:.5px; }
#propertyPanel .pp-edit-row.pp-required label:after { content:' *'; color:#dc2626; }
#propertyPanel .pp-edit-row.pp-error input,
#propertyPanel .pp-edit-row.pp-error select,
#propertyPanel .pp-edit-row.pp-error textarea { border-color:#dc2626 !important; background:#fef2f2; }

#propertyPanel input[type=text],
#propertyPanel input[type=date],
#propertyPanel input[type=url],
#propertyPanel select,
#propertyPanel textarea { padding:6px 8px; border:1px solid var(--border); background:var(--input-bg); color:var(--input-text); border-radius:4px; font-size:12px; }
#propertyPanel input[type=date] { position:relative; }
#propertyPanel input[type=date]::-webkit-calendar-picker-indicator { opacity:1; cursor:pointer; }
/* Ensure flat inputs fill available cell */
#propPanelInlineForm .pp-flat-input { width:100%; }

/* Custom date input wrapper */
#propPanelInlineForm .pp-date-wrap { position:relative; display:flex; align-items:center; width:100%; }
#propPanelInlineForm .pp-date-wrap input[type=date] { padding-left:34px; width:100%; }
#propPanelInlineForm .pp-date-wrap input[type=date] { padding-left:36px !important; }
#propPanelInlineForm .pp-date-wrap input[type=date]::-webkit-calendar-picker-indicator { opacity:0; pointer-events:none; }
#propPanelInlineForm .pp-date-wrap .pp-date-btn { position:absolute; left:4px; top:50%; transform:translateY(-50%); background:transparent; border:0; color:var(--muted); display:flex; align-items:center; justify-content:center; width:26px; height:26px; cursor:pointer; border-radius:4px; }
#propPanelInlineForm .pp-date-wrap .pp-date-btn:hover { color:var(--text); background:var(--hover-bg, rgba(0,0,0,0.06)); }
#propPanelInlineForm .pp-date-wrap .pp-date-btn:focus-visible { outline:2px solid var(--primary); }
#propertyPanel textarea { resize:vertical; }

/* Pills (display mode) */
/* Flat panel layout (view + edit) */
#propPanelInlineForm.pp-flat .pp-flat-field-list { width:100%; display:flex; flex-direction:column; gap:0; }
#propPanelInlineForm .pp-flat-row { display:grid; grid-template-columns: 190px 1fr; align-items:center; padding:4px 0; border-bottom:1px solid var(--border-subtle); font-size:13px; line-height:1.3; }
#propPanelInlineForm .pp-flat-row:last-child { border-bottom:none; }
#propPanelInlineForm .pp-flat-label { font-weight:500; color:var(--text); font-size:13px; }
#propPanelInlineForm .pp-flat-label.calc .pp-calc-tip { margin-left:4px; font-size:11px; color:var(--muted); }
#propPanelInlineForm .pp-flat-value { color:var(--text); min-height:20px; }
#propPanelInlineForm .pp-flat-empty { opacity:.55; }

/* Compact inputs in edit mode */
#propPanelInlineForm .pp-flat-input-wrap { display:flex; align-items:center; }
#propPanelInlineForm .pp-flat-input, #propPanelInlineForm .pp-flat-input-wrap .pp-input { color:var(--text); background:var(--pp-flat-background) !important; width:100%; max-width:320px; padding:2px !important; margin: 0; height: 1.5rem; font-size:13px; line-height:1.25; }
#propPanelInlineForm .pp-flat-row.pp-required .pp-flat-label { position:relative; }
#propPanelInlineForm .pp-flat-row.pp-required .pp-flat-label .pp-req-asterisk { color:#dc2626; margin-left:4px; }

/* Error state reuse */
#propPanelInlineForm .pp-edit-row.pp-error input,
#propPanelInlineForm .pp-edit-row.pp-error select,
#propPanelInlineForm .pp-edit-row.pp-error textarea { border-color:#dc2626 !important; background:#fef2f2; }
#propPanelInlineForm .pp-pill:hover .pp-pill-pencil { opacity:1; }
#propPanelInlineForm .pp-pill.editing .pp-pill-pencil { display:none; }
#propPanelInlineForm .pp-pill-label { font-size:9px; letter-spacing:.6px; text-transform:uppercase; color:var(--muted); }
#propPanelInlineForm .pp-pill-value { font-size:12px; color:var(--text); }
#propPanelInlineForm .pp-pill-tip { position:absolute; top:4px; right:6px; color:var(--muted); font-size:10px; }
#propPanelInlineForm .pp-pill-dirty { border-color:#f59e0b !important; }
#propPanelInlineForm .pp-pill-required:after { content:'*'; color:#dc2626; margin-left:4px; font-weight:600; }

/* Inline editor */
#propPanelInlineForm .pp-inline-editor { display:flex; flex-direction:column; gap:4px; }
#propPanelInlineForm .pp-inline-editor-actions { display:flex; gap:6px; margin-top:2px; }

/* Notes feed */

/* Accordion */
.pp-accordion-group { display:flex; flex-direction:column; gap:8px; }
.pp-notes-accordion { margin-top:8px; }
.pp-accordion-item { border:1px solid var(--border); border-radius:6px; background:var(--bg); }
.pp-acc-head { display:flex; align-items:center; gap:6px; padding:6px 8px; cursor:pointer; }
.pp-acc-head i { font-size:10px; color:var(--muted); }
.pp-acc-head span { font-size:11px; font-weight:600; color:var(--text); }
.pp-acc-body { display:none; padding:6px 8px; font-size:12px; line-height:1.3; white-space:pre-wrap; }
/* Open state (restored after dedupe) */
.pp-accordion-item.open .pp-acc-body { display:block; }
.pp-accordion-item.open .pp-acc-head i { transform:rotate(90deg); transition:transform .18s ease; }

/* History */
.pp-hist-item { border:1px solid var(--border); border-radius:6px; background:var(--bg); }
.pp-hist-header { display:flex; gap:6px; align-items:center; font-size:11px; padding:6px 8px; cursor:pointer; }
.pp-hist-header i { font-size:10px; color:var(--muted); }
.pp-hist-body { display:none; padding:6px 8px; border-top:1px solid var(--border); }

/* Toast styles removed (deprecated) */

/* Buttons inside panel (leveraging existing .btn-primary for main actions) */
.pp-btn { background:#334155; color:#fff; border:none; padding:6px 10px; border-radius:6px; font-size:12px; cursor:pointer; display:flex; align-items:center; gap:4px; }
.pp-btn.note { background:var(--primary); }
.pp-btn.add { background:#16a34a; }
.pp-btn.save { background:var(--primary); padding:6px 12px; }
.pp-btn.cancel { background:var(--filter-bg); color:var(--text); }
.pp-btn:hover { filter:brightness(.95); }

/* Utility */
.pp-field-empty { min-height:34px; }

/* Dark mode refinements */
[data-theme="dark"] #propertyPanel .pp-pill:hover { background:rgba(255,255,255,0.05); }
[data-theme="dark"] .pp-note-item { background:#1e293b; }
[data-theme="dark"] .pp-acc-head i { color:var(--muted); }
/* Dark variant toast removed */

/* Notes accordion tweaks */
.pp-notes-acc .pp-acc-body { padding:4px 8px 6px; }
.pp-notes-acc .pp-acc-body #propPanelNotesList { display:flex; flex-direction:column; align-items:stretch; gap:0; }
.pp-notes-acc .pp-note-item { margin:0; }
.pp-notes-acc .pp-note-item:last-child { border-bottom:0; }
#propPanelNotes, .pp-notes-acc { align-self:stretch; }
.pp-notes-acc .pp-no-notes { padding:2px 0; }
/* Prevent template indentation from creating vertical gaps inside notes */
.pp-notes-acc .pp-acc-body { white-space:normal; }

/* === Geo Boundary Row (new UI) === */
/* Use .filter-section base spacing; .geo-boundary-block adds layout hooks */
.geo-boundary-block { font-size:12px; display:flex; flex-direction:column; gap:6px; }
.geo-boundary-block.state-active { background:rgba(59,130,246,0.06); border-color:rgba(59,130,246,0.25); }
[data-theme="dark"] .geo-boundary-block.state-active { background:rgba(59,130,246,0.12); border-color:rgba(59,130,246,0.4); }
.geo-boundary-block.state-pending, .geo-boundary-block.state-editing { border-color:#f59e0b; background:rgba(245,158,11,0.10); }
[data-theme="dark"] .geo-boundary-block.state-pending, [data-theme="dark"] .geo-boundary-block.state-editing { background:rgba(245,158,11,0.20); }
.geo-boundary-block.state-waiting { border-color:#3b82f6; background:rgba(59,130,246,0.10); }
[data-theme="dark"] .geo-boundary-block.state-waiting { background:rgba(59,130,246,0.20); }
.geo-boundary-actions { display:flex; align-items:center; gap:4px; flex-wrap:wrap; margin-left:auto; }
.geo-boundary-row .label, .compact-filter-label + .geo-inline-radius { display:flex; align-items:center; gap:6px; }
.geo-inline-radius { font-weight:500; color:var(--text); background:var(--hover-bg); padding:2px 6px; border-radius:4px; font-size:11px; }
.geo-boundary-meta { order:3; margin-left:auto; font-size:11px; color: var(--muted); display:flex; gap:6px; align-items:center; }
.geo-boundary-meta .status { font-weight:500; }
.geo-boundary-meta .pts { opacity:.75; }

/* Instruction text and radius input for waiting states */
.geo-instruction { 
  font-size: 11px; 
  color: var(--text); 
  font-weight: 500; 
  text-align: center; 
  padding: 3px 6px; 
  background: rgba(59,130,246,0.15); 
  border-radius: 4px; 
  margin: 0 4px;
  white-space: nowrap;
}
[data-theme="dark"] .geo-instruction { background: rgba(59,130,246,0.25); }

.geo-radius-input-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
}

.geo-radius-input-container.compact {
  margin: 0 2px;
  gap: 2px;
}

.geo-radius-input-container label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

.geo-radius-input-container.compact label {
  font-size: 10px;
}

.geo-radius-input {
  width: 50px;
  padding: 2px 4px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 11px;
  text-align: center;
}

.geo-radius-input-container.compact .geo-radius-input {
  width: 40px;
  padding: 1px 3px;
  font-size: 10px;
}

.geo-radius-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

[data-theme="dark"] .geo-radius-input {
  background: var(--input-bg);
  border-color: var(--border);
}

/* Icon/Text buttons */
.geo-icon-btn, .geo-text-btn { border:1px solid var(--border); background:var(--bg); color:var(--text); padding:4px 6px; border-radius:4px; font-size:11px; line-height:1; cursor:pointer; display:inline-flex; align-items:center; gap:4px; font-weight:500; min-height:26px; }
.geo-icon-btn { width:30px; justify-content:center; padding:4px; }
.geo-icon-btn i { font-size:13px; }
.geo-text-btn i { font-size:12px; }
.geo-icon-btn:hover, .geo-text-btn:hover { background: var(--hover-bg); }
.geo-icon-btn:disabled, .geo-text-btn:disabled { opacity:.45; cursor:not-allowed; }

/* State accents */
.geo-icon-btn.active { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.geo-text-btn.apply, .geo-text-btn.edit, .geo-text-btn.save { background:var(--primary); border-color:color-mix(in srgb, var(--primary) 85%, #000); color:var(--primary-contrast); }
.geo-text-btn.apply:hover, .geo-text-btn.edit:hover, .geo-text-btn.save:hover { filter:brightness(0.95); }
.geo-text-btn.clear { background:#dc2626; border-color:#b91c1c; color:#fff; }
.geo-text-btn.clear:hover { background:#b91c1c; }
.geo-icon-btn.danger { background:#dc2626; border-color:#b91c1c; color:#fff; }
.geo-icon-btn.danger:hover { background:#b91c1c; }
[data-theme="dark"] .geo-icon-btn, [data-theme="dark"] .geo-text-btn { background: var(--input-bg); border-color: var(--border); }
[data-theme="dark"] .geo-icon-btn.active { background: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .geo-text-btn.apply, [data-theme="dark"] .geo-text-btn.edit, [data-theme="dark"] .geo-text-btn.save { background:var(--primary); border-color:color-mix(in srgb, var(--primary) 85%, #000); }
[data-theme="dark"] .geo-text-btn.clear { background:#b91c1c; border-color:#991b1b; }
[data-theme="dark"] .geo-icon-btn.danger { background:#b91c1c; border-color:#991b1b; }

/* Transition tweaks */
.geo-boundary-block, .geo-icon-btn, .geo-text-btn { transition: background-color .18s, border-color .18s, color .18s; }

/* === Property Panel History (migrated from injected JS) === */
.pp-hist-item { border:1px solid var(--border); border-radius:6px; margin-bottom:6px; background:var(--bg); }
.pp-hist-header { display:flex; align-items:center; gap:8px; padding:6px 8px; cursor:pointer; }
.pp-hist-avatar { width:26px; height:26px; border-radius:50%; object-fit:cover; background:var(--primary); color:var(--primary-contrast); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:600; }
.pp-hist-avatar.initials { box-shadow:0 0 0 1px var(--primary) inset; }
.pp-hist-head-top { display:flex; gap:6px; align-items:center; font-size:11px; flex-wrap:wrap; }
.pp-hist-action { font-weight:600; text-transform:uppercase; font-size:10px; color:var(--text); opacity:.85; }
.pp-hist-user { font-weight:500; color:var(--text); }
.pp-hist-time { color:var(--muted); }
.pp-hist-age { color:var(--muted); margin-left:auto; }
.pp-hist-body { display:none; padding:6px 8px 10px; background:var(--filter-bg); }
.pp-hist-body.open { display:block; }
.pp-hist-diff { width:100%; border-collapse:collapse; font-size:11px; }
.pp-hist-diff td { border:1px solid var(--border-subtle); padding:2px 4px; vertical-align:top; }
.pp-hist-diff td.key { background:var(--filter-bg); color:var(--text); font-weight:600; }
.pp-hist-diff td.before { background:#fef2f2; color:#b91c1c; }
.pp-hist-diff td.after { background:#f0fdf4; color:#166534; }
[data-theme="dark"] .pp-hist-diff td.before { background:#3b1f1f; color:#fca5a5; }
[data-theme="dark"] .pp-hist-diff td.after { background:#1f3b24; color:#86efac; }

/* === DEDUPLICATE MODAL STYLES === */
#deduplicateModal.modal-overlay { /* scoped to dedupe modal so generic overlay (edit modal) unaffected */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  z-index: 10000;
  display: none; /* start hidden */
  align-items: center;
  justify-content: center;
}
#deduplicateModal.modal-overlay.dedupe-open { display: flex; }

/* === DATA TOOLS LAUNCHER MODAL === */
#dataToolsModal.modal-overlay, #dataToolsModal.data-tools-overlay {
  position: fixed;
  top:0; left:0; width:100%; height:100%;
  background: var(--overlay-bg);
  z-index: 10000; display:none; align-items:center; justify-content:center;
}
#dataToolsModal.modal-overlay.open { display:flex; }
.data-tools-modal { width:520px; max-width:95vw; background:var(--panel-bg,#fff); display:flex; flex-direction:column; max-height:90vh; }
.data-tools-modal .modal-header { padding:1rem 1.25rem; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:flex-start; }
.data-tools-modal .modal-body { padding:1rem 1.25rem; overflow-y:auto; }
.data-tools-modal .modal-footer { padding:0.75rem 1.25rem; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }
.data-tools-grid { display:flex; flex-direction:column; gap:12px; }
.data-tool-btn { text-align:left; background:var(--hover-bg,#f1f5f9); border:1px solid var(--border-subtle,#e2e8f0); padding:12px 14px; border-radius:6px; cursor:pointer; display:flex; flex-direction:column; gap:4px; transition:background .15s,border-color .15s; }
.data-tool-btn .icon { font-size:18px; color:var(--text); }
.data-tool-btn .title { font-weight:600; font-size:14px; color:var(--text); }
.data-tool-btn .desc { font-size:12px; color:var(--muted); line-height:1.3; }
.data-tool-btn:hover { background:var(--filter-bg,#f8fafc); border-color:var(--border,#cbd5e1); }
[data-theme="dark"] .data-tool-btn { background:var(--hover-bg,#1e293b); border-color:var(--border-subtle,#334155); }
[data-theme="dark"] .data-tool-btn:hover { background:var(--filter-bg,#243044); border-color:var(--border,#475569); }

/* === FIELD VALUE CLEANUP MODAL === */
#fieldCleanupModal.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: var(--overlay-bg);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
#fieldCleanupModal.modal-overlay.open { display: flex; }

.field-cleanup-modal {
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  background: var(--bg);
  border-radius: 10px;
  box-shadow: 0 16px 42px -8px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.field-cleanup-modal .modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

.field-cleanup-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.field-cleanup-modal .modal-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field-cleanup-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.field-cleanup-panels {
  display: flex;
  height: 100%;
}

/* Left Panel - Field Selection */
.field-panel {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.field-panel h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-item {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.field-item:hover {
  background: var(--hover-bg);
  border-color: var(--border);
}

.field-item.active {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
}

.field-item .field-name {
  font-weight: 500;
  font-size: 13px;
}

.field-item .field-count {
  font-size: 11px;
  opacity: 0.8;
}

/* Global Mode Styling */
/* .field-item.global-option {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;
}

.field-item.global-option:hover {
  background: var(--hover-bg);
  border-color: var(--border);
}

.field-item.global-option.active {
  background: var(--primary);
  color: var(--primary-contrast);
  border-color: var(--primary);
} */

.field-separator {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

/* .value-item.global-value {
  background: var(--panel-bg);
  border-left: 3px solid var(--primary);
} */

.field-breakdown {
  margin-top: 4px;
  padding-left: 24px;
}

.field-breakdown small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Right Panel - Value Management */
.value-panel {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.value-panel-header {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.value-panel h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

#valueSearchInput {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 13px;
}

.value-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg);
}

.value-item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.15s ease;
}

.value-item:last-child {
  border-bottom: none;
}

.value-item:hover {
  background: var(--hover-bg);
}

.value-item.selected {
  background: var(--filter-active);
}

.value-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.value-checkbox input[type="checkbox"] {
  margin: 0;
}

.value-text {
  flex: 1;
  font-weight: 500;
}

.value-count {
  color: var(--muted);
  font-size: 11px;
}

/* Final Value Section */
.final-value-section {
  margin-bottom: 20px;
  flex-shrink: 0;
  background: var(--filter-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.final-value-section:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.final-value-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.final-value-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#finalValueInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#finalValueInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  outline: none;
}

#finalValueInput.auto-updated {
  background: var(--filter-active);
  border-color: var(--primary);
  animation: finalValuePulse 0.3s ease;
}

@keyframes finalValuePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.final-value-help {
  margin-top: 8px;
}

.final-value-help small {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.3;
}

[data-theme="dark"] .final-value-section {
  background: color-mix(in srgb, var(--filter-bg) 85%, transparent);
  border-color: var(--border-subtle);
}

[data-theme="dark"] #finalValueInput.auto-updated {
  background: var(--filter-active);
}

/* Cleanup Options */
.cleanup-options {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

/* Cleanup Actions */
.cleanup-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

#fieldCleanupUpdateBtn {
  flex: 1;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

#fieldCleanupUpdateBtn:hover:not(:disabled) {
  filter: brightness(1.05);
}

#fieldCleanupUpdateBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#fieldCleanupCancelBtn {
  padding: 10px 16px;
  background: var(--filter-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

#fieldCleanupCancelBtn:hover {
  background: var(--hover-bg);
}

/* Inline Confirmation Panel */
.confirmation-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--filter-bg);
  border: 2px solid #f59e0b;
  border-radius: 8px;
  animation: confirmationSlideIn 0.3s ease;
}

@keyframes confirmationSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.confirmation-message {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.confirmation-message i {
  color: #f59e0b;
  font-size: 16px;
}

.confirmation-actions {
  display: flex;
  gap: 12px;
}

#confirmUpdateBtn {
  flex: 1;
  padding: 10px 16px;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease;
}

#confirmUpdateBtn:hover {
  background: #15803d;
}

#cancelConfirmBtn {
  padding: 10px 16px;
  background: var(--filter-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

#cancelConfirmBtn:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .confirmation-panel {
  background: color-mix(in srgb, var(--filter-bg) 90%, transparent);
  border-color: #d97706;
}

[data-theme="dark"] .confirmation-message i {
  color: #fbbf24;
}

/* Streamlined Inline Confirmation */
.inline-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--filter-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 16px;
  font-size: 14px;
}

.confirmation-summary {
  flex: 1;
}

.confirmation-text {
  color: var(--text);
  font-weight: 500;
}

.confirmation-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Processing State */
.processing-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--filter-bg);
  border: 1px solid var(--primary);
  border-radius: 6px;
  margin-top: 16px;
}

.processing-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 500;
}

.processing-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success State */
.success-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f0f9f0;
  border: 1px solid #28a745;
  border-radius: 6px;
  margin-top: 16px;
  animation: successSlideIn 0.3s ease;
}

@keyframes successSlideIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

.success-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #28a745;
  font-weight: 500;
}

.success-content i {
  font-size: 18px;
}

/* Error State */
.error-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #fdf2f2;
  border: 1px solid #dc3545;
  border-radius: 6px;
  margin-top: 16px;
}

.error-content {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dc3545;
  font-weight: 500;
}

.error-content i {
  font-size: 18px;
}

/* Dark theme adjustments */
[data-theme="dark"] .success-state {
  background: rgba(40, 167, 69, 0.1);
}

[data-theme="dark"] .error-state {
  background: rgba(220, 53, 69, 0.1);
}

/* Empty State */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .field-cleanup-modal {
  box-shadow: 0 16px 48px -8px rgba(0,0,0,0.7);
}

[data-theme="dark"] .value-item.selected {
  background: var(--filter-active);
}

/* Responsive Design */
@media (max-width: 900px) {
  .field-cleanup-modal {
    width: 95vw;
    height: 90vh;
  }
  
  .field-panel {
    width: 240px;
  }
}

@media (max-width: 700px) {
  .field-cleanup-panels {
    flex-direction: column;
  }
  
  .field-panel {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .field-list {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  
  .field-item {
    flex-shrink: 0;
    min-width: 140px;
  }
}

/* Archived Records refined list */
.archived-records-list { list-style:none; margin:12px 0 0 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.archived-record-item { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:10px 12px; background:var(--hover-bg,#f1f5f9); border:1px solid var(--border-subtle,#e2e8f0); border-radius:6px; }
.archived-record-item:hover { background:var(--filter-bg,#f8fafc); }
.arch-rec-info { flex:1 1 auto; min-width:0; }
.arch-rec-info .name-line { color: var(--text); display:flex; gap:8px; flex-wrap:wrap; align-items:center; font-size:13px; }
.arch-rec-info .name-line strong { font-size:13px; }
.arch-rec-info .name-line .uid { font-size:11px; color:var(--muted); }
.arch-rec-info .addr-line { font-size:11.5px; color:var(--muted); margin-top:2px; }
.arch-rec-actions { flex:0 0 auto; display:flex; align-items:center; gap:6px; }
[data-theme="dark"] .archived-record-item { background:var(--hover-bg,#1e293b); border-color:var(--border-subtle,#334155); }
[data-theme="dark"] .archived-record-item:hover { background:var(--filter-bg,#243044); }

/* Clickable info region */
.arch-rec-info { background:none; border:none; padding:0; margin:0; text-align:left; cursor:pointer; width:100%; }
.arch-rec-info:focus { outline:2px solid var(--border); outline-offset:2px; border-radius:4px; }

/* Archived record details */
.archived-record-details { padding:6px 2px; }
.arch-details-actions { display:flex; justify-content:flex-end; margin-bottom:8px; }
.arch-details-table { width:100%; border-collapse:collapse; font-size:12px; }
.arch-details-table td { border:1px solid var(--border-subtle); padding:4px 6px; vertical-align:top; }
.arch-details-table td.key { width:220px; font-weight:600; background:var(--filter-bg); }


.dedupe-modal {
  max-width: 95vw;
  max-height: 100%;
  width: 1200px;
  display: flex;
  flex-direction: column;
}

.dedupe-modal .modal-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center; /* center-align header content vertically */
  flex-shrink: 0;
}

.dedupe-modal .modal-header h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.dedupe-modal .modal-header p {
  margin: 0.25rem 0;
  color: var(--muted);
}

/* Dedupe header navigation alignment and spacing */
.dedupe-modal .modal-header #dedupeModalHeader {
  flex: 1 1 auto; /* let title block take remaining space */
  min-width: 0;
}
.dedupe-modal .modal-header .dedupe-nav {
  margin-left: auto; /* push nav to the right */
  margin-right: 6px; /* breathing room before close button */
  display: flex;
  align-items: center;
  gap: 8px; /* space between header actions */
  flex-wrap: wrap;
}
.dedupe-modal .modal-header .dedupe-nav .btn {
  height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.dedupe-modal .modal-header .dedupe-nav .btn.btn-primary {
  padding-left: 12px;
  padding-right: 12px;
}

.dedupe-modal .btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  line-height: 1;
}

.dedupe-modal .btn-close:hover {
  color: var(--text);
}

.dedupe-modal .modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.dedupe-modal .modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* Deduplicate Records Container */
.dedupe-record-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 1rem;
  background: var(--bg);
}

.dedupe-record-card .card-header {
  padding: 0.75rem 1rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dedupe-record-card .record-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.dedupe-record-card .radio-label,
.dedupe-record-card .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  cursor: pointer;
  margin: 0;
}

.dedupe-record-card .radio-text,
.dedupe-record-card .checkbox-text {
  font-weight: 500;
  color: var(--text);
}

