:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --accent-gold: #c59b27;
  --accent-gold-dark: #a17b18;
  --accent-gold-light: rgba(197, 155, 39, 0.12);
  --accent-emerald: #059669;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg-main);
  background-image: radial-gradient(at 0% 0%, rgba(241, 245, 249, 0.8) 0px, transparent 50%),
                    radial-gradient(at 100% 0%, rgba(254, 243, 199, 0.3) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 275px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.35);
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.brand-text p {
  font-size: 11px;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-item button {
  width: 100%;
  padding: 11px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item button:hover {
  background: rgba(241, 245, 249, 0.9);
  color: var(--text-main);
}

.nav-item.active button {
  background: var(--accent-gold-light);
  color: var(--accent-gold-dark);
  border-left: 4px solid var(--accent-gold);
  font-weight: 700;
}

.nav-item button i {
  font-size: 18px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

/* Main Content Area */
.main-wrapper {
  margin-left: 275px;
  width: calc(100% - 275px);
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* Header */
.top-header {
  height: 72px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 275px;
  right: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.content-area {
  margin-top: 72px;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  background: #fff;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logged-in-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 6px 10px 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: #dc2626;
  font-size: 16px;
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 12px;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(220, 38, 38, 0.1);
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #0b1220, #111827);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.35);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.login-card .form-group {
  text-align: left;
  margin-bottom: 14px;
}

.login-error {
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 16px;
  margin-bottom: 8px;
}

.login-footnote {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f8fafc;
  color: #334155;
  border: 1px solid var(--border-color, #e2e8f0);
  padding: 10px 16px;
  border-radius: var(--radius-sm, 8px);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition, 0.2s ease);
}

.btn-secondary:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.avatar-initials {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent-gold);
  background: linear-gradient(135deg, #d4af37, #997415);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info h4 {
  font-size: 13px;
  font-weight: 700;
}

.user-info p {
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 700;
}

/* Main Content */
.content-area {
  padding: 32px;
  /* CRITICAL: this must NOT be a flex item that sizes itself from content
     (flex: 1 with flex-basis: auto/0% still lets a very wide descendant —
     like a data table forced to min-width: 1400px — inflate this box
     before shrink/max-width ever gets applied). Using a fixed block width
     tied directly to the viewport avoids that entirely: no flex sizing
     ambiguity, this box is always exactly "100% of available space minus
     the sidebar", full stop, and anything wider inside must scroll on its
     own via overflow-x. */
  width: calc(100vw - 275px);
  max-width: calc(100vw - 275px);
  box-sizing: border-box;
  overflow-x: hidden;
}

.page-section {
  display: none;
  animation: fadeIn 0.3s ease;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.page-section.active {
  display: block;
}

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

.page-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.page-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.page-header .btn-primary {
  flex-shrink: 0;
  margin-right: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.gold { background: var(--accent-gold-light); color: var(--accent-gold-dark); }
.stat-icon.emerald { background: rgba(5, 150, 105, 0.12); color: var(--accent-emerald); }
.stat-icon.blue { background: rgba(37, 99, 235, 0.12); color: var(--accent-blue); }
.stat-icon.purple { background: rgba(124, 58, 237, 0.12); color: var(--accent-purple); }

.stat-info h3 { font-size: 22px; font-weight: 800; }
.stat-info p { font-size: 12px; color: var(--text-muted); }

.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-box h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mc-stat {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}

.mc-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.mc-stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

/* Charts Wrapper */
.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Property Cards */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ─── Property Toolbar (search & filters bar) ───────────────────────── */
.prop-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.prop-toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  flex: 1 1 220px;
  min-width: 200px;
}

.prop-toolbar-search i {
  color: var(--text-muted);
  font-size: 16px;
}

.prop-toolbar-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
}

.prop-toolbar-select {
  width: auto;
  min-width: 130px;
  padding: 9px 12px;
  font-size: 13px;
}

.btn-reset-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-reset-filters:hover { background: #fee2e2; }

/* Saved Searches */
.saved-search-wrap { position: relative; display: flex; gap: 8px; }

.btn-save-filter, .btn-saved-searches {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-save-filter:hover, .btn-saved-searches:hover { border-color: var(--accent-gold); }
.btn-save-filter.is-saved { background: var(--accent-gold-light); border-color: var(--accent-gold); color: var(--accent-gold-dark); }

.saved-searches-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 600;
}

.saved-searches-menu.active { display: block; }

.saved-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

.saved-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.saved-search-item:last-child { border-bottom: none; }
.saved-search-item:hover { background: var(--bg-main); }

.saved-search-item-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-gold-light);
  color: var(--accent-gold-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.saved-search-item-text { flex: 1; min-width: 0; }
.saved-search-item-name { font-size: 13px; font-weight: 700; color: var(--text-main); }
.saved-search-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.saved-search-item-delete {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
  padding: 4px;
}

.saved-search-item-delete:hover { color: #dc2626; }

.prop-view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-left: auto;
}

.prop-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.prop-view-btn:hover { color: var(--text-main); background: rgba(15,23,42,0.05); }

.prop-view-btn.active {
  background: var(--text-main);
  color: #fff;
}

.prop-results-count {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ─── Property Layout: List / Split / Map ───────────────────────────── */
.prop-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  min-height: 640px;
}

.prop-list-pane {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  max-height: 78vh;
  padding-right: 6px;
}

.prop-collapse-handle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  align-self: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  margin: 0 8px;
  transition: var(--transition);
}

.prop-collapse-handle:hover { color: var(--text-main); border-color: var(--accent-gold); }

.prop-map-pane {
  display: none;
  flex: 1 1 55%;
  min-width: 0;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.prop-map {
  width: 100%;
  height: 100%;
  min-height: 640px;
  background: #e2e8f0;
}

/* Map geocode search overlay — sits directly below the Map/Satellite switcher */
.prop-map-search {
  position: absolute;
  top: 62px;
  left: 14px;
  z-index: 500;
  width: 240px;
  max-width: calc(100% - 90px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
}

.prop-map-search i { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }

.prop-map-search input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  color: var(--text-main);
}

.prop-map-search-clear {
  display: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  flex-shrink: 0;
}

.prop-map-search.has-value .prop-map-search-clear { display: block; }

.prop-map-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  overflow: hidden;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.prop-map-search-results.active { display: block; }

.map-geocode-result {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-geocode-result:last-child { border-bottom: none; }
.map-geocode-result:hover { background: var(--bg-main); }
.map-geocode-result i { color: var(--text-muted); font-size: 15px; flex-shrink: 0; }

.prop-map-radius-banner {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--text-main);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  white-space: nowrap;
}

.prop-map-radius-banner i { color: var(--accent-gold); }

.prop-map-radius-banner button {
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
}

.prop-map-radius-banner button:hover { background: rgba(255,255,255,0.28); }

.prop-map-ctrl-btn.active { background: var(--text-main); color: #fff; }

.prop-map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 500;
}

.prop-map-ctrl-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  background: #fff;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.prop-map-ctrl-btn:hover { background: var(--accent-gold-light); color: var(--accent-gold-dark); }

/* Mode: list (default) */
.prop-layout[data-mode="list"] .prop-map-pane,
.prop-layout[data-mode="list"] .prop-collapse-handle { display: none; }
.prop-layout[data-mode="list"] .prop-list-pane { max-height: none; }

/* Mode: split */
.prop-layout[data-mode="split"] .prop-list-pane { flex: 1 1 42%; max-width: 46%; }
.prop-layout[data-mode="split"] .prop-map-pane { display: block; }
.prop-layout[data-mode="split"] .prop-collapse-handle { display: flex; }
.prop-layout[data-mode="split"].list-collapsed .prop-list-pane { flex: 0 0 0; max-width: 0; padding: 0; overflow: hidden; border: none; }
.prop-layout[data-mode="split"].list-collapsed .prop-collapse-handle i { transform: rotate(180deg); }

/* Mode: map only */
.prop-layout[data-mode="map"] .prop-list-pane { display: none; }
.prop-layout[data-mode="map"] .prop-collapse-handle { display: none; }
.prop-layout[data-mode="map"] .prop-map-pane { display: block; flex: 1 1 100%; }

/* ─── Filter Pills (toolbar) ─────────────────────────────────────────── */
.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.filter-pill:hover { border-color: var(--accent-gold); }
.filter-pill.has-active { background: var(--text-main); color: #fff; border-color: var(--text-main); }
.filter-pill i { font-size: 15px; }

/* ─── Filter Bottom Sheet ────────────────────────────────────────────── */
.filter-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 3000;
  align-items: flex-end;
  justify-content: center;
}

.filter-sheet-overlay.active { display: flex; }

.filter-sheet {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 82vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 10px 22px 22px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
  animation: sheetSlideUp 0.25s ease;
}

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

/* Desktop: center as a modal card instead of a bottom sheet */
@media (min-width: 640px) {
  .filter-sheet-overlay { align-items: center; }
  .filter-sheet { border-radius: 16px; max-height: 76vh; }
}

.filter-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-color);
  border-radius: 4px;
  margin: 8px auto 16px;
}

.filter-sheet-panel { display: none; }
.filter-sheet-panel.active { display: block; }

.filter-sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.filter-sheet-title-row h3 { font-size: 19px; font-weight: 800; color: var(--text-main); margin: 0; }

.link-reset {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.link-reset:hover { color: var(--text-main); }

.filter-sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.btn-sheet-primary, .btn-sheet-secondary {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.btn-sheet-primary { background: var(--text-main); color: #fff; }
.btn-sheet-primary:hover { background: #000; }
.btn-sheet-secondary { background: var(--bg-main); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-sheet-secondary:hover { background: #eef1f5; }

/* Company panel */
.filter-sheet-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 14px;
  margin-bottom: 4px;
}

.filter-sheet-search i { color: var(--text-muted); }
.filter-sheet-search input { border: none; outline: none; background: transparent; width: 100%; font-family: inherit; font-size: 14px; }

.filter-sheet-list { max-height: 320px; overflow-y: auto; margin-top: 8px; }

.company-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.company-row:last-child { border-bottom: none; }

.company-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--text-main); flex-shrink: 0; }

.company-row-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.company-row-logo img { width: 100%; height: 100%; object-fit: contain; }
.company-row-logo .fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; }

.company-row-text { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text-main); }
.company-row-tag { font-size: 11px; color: var(--text-muted); }

/* Price panel */
.price-unit-tabs {
  display: flex;
  background: var(--bg-main);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}

.price-unit-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.price-unit-tab.active { background: #fff; color: var(--text-main); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

.price-range-row { display: flex; gap: 12px; margin-bottom: 18px; }
.price-range-col { flex: 1; }
.price-range-col label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

.price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 12px;
  position: relative;
}

.price-input-wrap input { border: none; outline: none; font-family: inherit; font-size: 13.5px; width: 100%; }
.price-input-wrap span { font-size: 11px; color: var(--text-muted); font-weight: 700; }
.price-input-clear { border: none; background: transparent; color: var(--border-color); cursor: pointer; font-size: 15px; display: none; padding: 0; }

.price-quick-lists { display: flex; gap: 12px; }
.price-quick-col { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.price-quick-item {
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  background: transparent;
  border: none;
  font-family: inherit;
}

.price-quick-item:hover { background: var(--bg-main); }

/* Payments panel */
.payment-slider-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.payment-slider-min { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.payment-slider-bubble {
  background: var(--text-main);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
}

.payment-slider {
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--text-main) 0%, var(--text-main) 100%, var(--border-color) 100%);
  appearance: none;
  outline: none;
  margin: 10px 0 24px;
  cursor: pointer;
}

.payment-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--text-main);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

.payment-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--text-main);
  cursor: pointer;
}

.payment-fields-row { display: flex; gap: 12px; margin-bottom: 20px; }
.payment-fields-row > div { flex: 1; }
.payment-fields-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

.payment-field-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 12px;
}

.payment-field-input input { border: none; outline: none; width: 100%; font-family: inherit; font-size: 13.5px; }
.payment-field-input input[readonly] { color: var(--text-muted); background: transparent; }
.payment-field-input span { font-size: 11px; color: var(--text-muted); font-weight: 700; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-color); border-radius: 22px; transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--text-main); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Handover panel */
.handover-field { margin-bottom: 16px; }
.handover-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }

/* Chips (unit type / emirate) */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; }

.chip-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.chip-btn:hover { border-color: var(--accent-gold); }
.chip-btn.active { background: var(--text-main); color: #fff; border-color: var(--text-main); }

/* Status dot list */
.status-dot-group { display: flex; flex-direction: column; gap: 4px; }

.status-dot-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  background: transparent;
  padding: 13px 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
  border-radius: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.status-dot-btn:last-child { border-bottom: none; }
.status-dot-btn:hover { background: var(--bg-main); }
.status-dot-btn.active { background: var(--accent-gold-light); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

/* Map style switcher (Map / Satellite toggle) */
.map-style-switcher {
  display: flex;
  gap: 2px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 3px;
  margin: 10px;
}

.map-style-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.map-style-btn i { font-size: 14px; }
.map-style-btn:hover { background: rgba(15,23,42,0.06); }
.map-style-btn.active { background: var(--text-main); color: #fff; }

/* Belt-and-suspenders: the real fix is attributionControl.setPrefix() in
   app.js (Leaflet's documented way to replace the default prefix, which is
   what actually bundles a Ukrainian flag SVG since v1.9). This CSS is just a
   defensive backup in case any other Leaflet instance on the page is ever
   created without that call. */
.leaflet-control-attribution svg {
  display: none !important;
}

/* Leaflet popup styling to match CRM theme */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.map-popup-card { width: 220px; font-family: inherit; }
.map-popup-card:hover .map-popup-title { text-decoration: underline; }
.map-popup-img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px 8px 0 0; display: block; }
.map-popup-body { padding: 10px 4px 2px; }
.map-popup-price { font-size: 15px; font-weight: 800; color: var(--text-main); }
.map-popup-title { font-size: 12.5px; font-weight: 700; color: var(--text-main); margin: 2px 0; }
.map-popup-loc { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.map-popup-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.map-popup-badges span { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }

.map-marker-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  border: 3px solid #fbbf24;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.map-marker-logo:hover { transform: scale(1.12); z-index: 1000 !important; }

.map-marker-logo.ready { border-color: #34d399; }
.map-marker-logo.offplan { border-color: #fbbf24; }

/* Selected-property glow — pulses neon gold on/off so one marker stands out
   clearly among a dense cluster of pins. */
.map-marker-logo.map-marker-selected {
  border-color: #ffd700;
  animation: markerGlowPulse 1.1s ease-in-out infinite;
  z-index: 1001 !important;
}
@keyframes markerGlowPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 6px 2px rgba(255, 215, 0, 0.55);
  }
  50% {
    box-shadow: 0 2px 8px rgba(0,0,0,0.35), 0 0 18px 8px rgba(255, 215, 0, 0.95);
  }
}

.map-marker-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 5px;
  box-sizing: border-box;
}

.map-marker-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.marker-cluster-custom {
  background: var(--text-main);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.prop-pin-picker {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

@media (max-width: 900px) {
  .prop-layout[data-mode="split"] .prop-list-pane { max-width: 100%; flex: 1 1 100%; max-height: 40vh; }
  .prop-layout[data-mode="split"] .prop-map-pane { flex: 1 1 100%; }
  .prop-layout[data-mode="split"] { flex-direction: column; }
  .prop-layout[data-mode="split"] .prop-collapse-handle { display: none; }
  .prop-map { min-height: 360px; }
  .prop-view-toggle { margin-left: 0; }
  .prop-map-search { width: 200px; top: 58px; }
}

.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-gold);
}

.property-img {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: #e2e8f0;
}

.property-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-emirate {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-offplan { background: #fef3c7; color: #92400e; }
.badge-ready { background: #d1fae5; color: #065f46; }
.badge-golden { position: absolute; top: 12px; right: 12px; background: linear-gradient(135deg, #d4af37, #997415); color: #fff; font-size: 10px; padding: 4px 10px; border-radius: 20px; font-weight: 800; }

.property-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.property-price {
  font-size: 21px;
  font-weight: 800;
  color: var(--accent-gold-dark);
  margin-bottom: 4px;
}

.property-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.property-location {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.property-specs {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.spec-item i {
  color: var(--accent-gold);
}

.property-meta-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

.property-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.prop-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.prop-action-btn:hover { border-color: var(--accent-gold); background: var(--accent-gold-light); }
.prop-action-btn.danger:hover { border-color: #dc2626; background: #fef2f2; color: #dc2626; }

/* ═══ PROPERTY DETAIL PAGE ═══════════════════════════════════════════ */
.prop-detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: #fff;
  overflow-y: auto;
}

.prop-detail-overlay.active { display: block; }

.prop-detail-panel {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  background: #fff;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

.prop-detail-back {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.prop-detail-gallery { position: relative; }

.prop-detail-gallery-main {
  width: 100%;
  height: 320px;
  background-size: cover;
  background-position: center;
  background-color: #e2e8f0;
  transition: background-image 0.2s ease;
  position: relative;
}

.prop-detail-gallery-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(15,23,42,0.55) 100%);
  pointer-events: none;
}

.prop-detail-gallery-overlay-info {
  position: absolute;
  bottom: 88px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 2;
}

.prop-detail-updated {
  background: rgba(15,23,42,0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prop-detail-counter {
  background: rgba(15,23,42,0.75);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  margin-left: auto;
}

.prop-detail-gallery-tabs {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 2px;
  padding: 0 2px;
  z-index: 3;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.08);
}

.prop-detail-gallery-tab {
  flex: 1;
  height: 56px;
  background-size: cover;
  background-position: center;
  background-color: #cbd5e1;
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
}

.prop-detail-gallery-tab.active { border-color: var(--accent-gold); }

.prop-detail-gallery-tab-label {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.45);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.prop-detail-body { padding: 20px 20px 40px; }

.prop-detail-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.prop-detail-title { font-size: 24px; font-weight: 800; color: var(--text-main); margin: 0 0 16px; }

.prop-detail-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.prop-detail-progress-row strong { color: var(--text-main); }

.prop-detail-progress-track {
  height: 6px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 24px;
}

.prop-detail-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #6366f1);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.prop-detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.prop-detail-stat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.prop-detail-stat i { font-size: 18px; color: var(--accent-gold); margin-top: 2px; }
.prop-detail-stat span { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.prop-detail-stat strong { font-size: 14px; color: var(--text-main); font-weight: 800; }

.prop-detail-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.btn-detail-secondary, .btn-detail-primary {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  transition: var(--transition);
}

.btn-detail-secondary { background: var(--text-main); color: #fff; }
.btn-detail-secondary:hover { background: #000; }
.btn-detail-primary { background: linear-gradient(90deg, #6366f1, #4f46e5); color: #fff; position: relative; }
.btn-detail-primary:hover { filter: brightness(1.08); }

.new-tag {
  background: #fbbf24;
  color: #78350f;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 20px;
  margin-left: 2px;
}

.prop-detail-section-title { font-size: 19px; font-weight: 800; color: var(--text-main); margin: 0 0 4px; }
.prop-detail-section-label { font-size: 12px; color: var(--text-muted); font-weight: 700; margin: 0 0 8px; }
.prop-detail-description { font-size: 13.5px; line-height: 1.7; color: var(--text-main); margin-bottom: 24px; white-space: pre-line; }

.prop-detail-table { margin-bottom: 24px; }

.prop-detail-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
}

.prop-detail-table-row:last-child { border-bottom: none; }
.prop-detail-table-row span:first-child { color: var(--text-muted); font-weight: 600; }
.prop-detail-table-row span:last-child { color: var(--text-main); font-weight: 800; }

.prop-detail-footer-actions { margin-top: 8px; }

.prop-detail-similar-section { margin-bottom: 24px; }

.prop-detail-similar-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.prop-detail-similar-card {
  flex: 0 0 190px;
  scroll-snap-align: start;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
}

.prop-detail-similar-card:hover { border-color: var(--accent-gold); box-shadow: var(--shadow-sm); }

.prop-detail-similar-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #e2e8f0;
}

.prop-detail-similar-body { padding: 10px 12px; }
.prop-detail-similar-price { font-size: 13.5px; font-weight: 800; color: var(--text-main); }
.prop-detail-similar-title { font-size: 12px; font-weight: 700; color: var(--text-main); margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-detail-similar-loc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prop-detail-resales-section { margin-bottom: 24px; }

.prop-detail-resales-list { display: flex; flex-direction: column; gap: 10px; }

.resale-listing-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
}

.resale-listing-info { flex: 1; min-width: 0; }

.resale-listing-price { font-size: 15px; font-weight: 800; color: var(--text-main); }

.resale-listing-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.resale-listing-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.resale-listing-badge.available { background: #d1fae5; color: #065f46; }
.resale-listing-badge.under-offer { background: #fef3c7; color: #92400e; }
.resale-listing-badge.sold { background: #f1f5f9; color: #475569; }

.resale-listing-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.resale-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.resale-icon-btn:hover { border-color: var(--accent-gold); background: var(--accent-gold-light); }
.resale-icon-btn.danger:hover { border-color: #dc2626; background: #fef2f2; color: #dc2626; }

/* ─── Commission Split Parties (Deal modal) ──────────────────────────── */
.split-parties-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.split-party-row {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg-main);
}

.split-party-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.split-party-type-toggle {
  display: flex;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  flex-shrink: 0;
}

.split-party-type-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.split-party-type-btn.active { background: var(--text-main); color: #fff; }

.split-party-remove {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-party-remove:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }

.split-party-fields {
  display: flex;
  gap: 8px;
  align-items: center;
}

.split-party-fields select,
.split-party-fields input {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: inherit;
  background: #fff;
}

.split-party-fields .party-name-field { flex: 1.4; min-width: 0; }
.split-party-fields .party-value-field { width: 90px; flex-shrink: 0; }
.split-party-fields .party-unit-toggle { flex-shrink: 0; display: flex; background: #fff; border: 1px solid var(--border-color); border-radius: 8px; padding: 2px; }
.split-party-fields .party-unit-btn { padding: 6px 9px; border-radius: 6px; font-size: 10px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.split-party-fields .party-unit-btn.active { background: var(--text-main); color: #fff; }

.split-party-sponsor-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
  display: none;
}

.split-party-sponsor-row.visible { display: flex; align-items: center; gap: 8px; }
.split-party-sponsor-row label { font-size: 10.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.split-party-sponsor-row select { flex: 1; border: 1px solid var(--border-color); border-radius: 8px; padding: 7px 10px; font-size: 12px; font-family: inherit; }

.btn-add-split-party {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  width: 100%;
  justify-content: center;
  font-family: inherit;
}

.btn-add-split-party:hover { border-color: var(--accent-gold); background: var(--accent-gold-light); }

.split-total-row {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.split-total-row.balanced { background: #d1fae5; color: #065f46; }
.split-total-row.over { background: #fef2f2; color: #991b1b; }
.split-total-row.under { background: #fef3c7; color: #92400e; }

.split-party-chip {
  font-size: 11.5px;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.5;
}

.split-party-chip:last-child { margin-bottom: 0; }

.split-outside-tag {
  display: inline-block;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}


@media (max-width: 640px) {
  .prop-detail-gallery-main { height: 260px; }
  .prop-detail-stats-grid { grid-template-columns: 1fr; }
}

/* ═══ BULK EDIT MODAL ═════════════════════════════════════════════════ */
.bulk-edit-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4500;
  background: rgba(15,23,42,0.55);
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.bulk-edit-overlay.active { display: flex; }

.bulk-edit-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1400px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,0.35);
}

.bulk-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.bulk-edit-header h2 { font-size: 19px; font-weight: 800; color: var(--text-main); margin: 0; }
.bulk-edit-header p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }

.bulk-edit-changed-count {
  font-size: 12px;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.bulk-edit-table-wrap { overflow: auto; flex: 1; }

.bulk-edit-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}

.bulk-edit-table th {
  position: sticky;
  top: 0;
  background: var(--bg-main);
  border-bottom: 2px solid var(--border-color);
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  z-index: 2;
}

.bulk-edit-table td {
  border-bottom: 1px solid var(--border-color);
  padding: 6px 8px;
  white-space: nowrap;
}

.bulk-edit-table td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  font-weight: 700;
  color: var(--text-main);
  z-index: 1;
  max-width: 200px;
  white-space: normal;
}

.bulk-edit-table input, .bulk-edit-table select {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: inherit;
  width: 100%;
  min-width: 90px;
  color: var(--text-main);
}

.bulk-edit-table input:hover, .bulk-edit-table select:hover { border-color: var(--border-color); background: var(--bg-main); }
.bulk-edit-table input:focus, .bulk-edit-table select:focus { border-color: var(--accent-gold); background: #fff; outline: none; }
.bulk-edit-table input.cell-dirty, .bulk-edit-table select.cell-dirty { background: #fef9c3; border-color: #eab308; }

/* File Upload Zone */
.file-upload-box {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
}

.file-upload-box:hover {
  border-color: var(--accent-gold);
  background: #fff;
}

.file-upload-box i {
  font-size: 32px;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.prop-photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.prop-photo-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
}

.prop-photo-preview-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.prop-photo-preview-item.cover::before {
  content: 'Cover';
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent-gold);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  z-index: 2;
}

.prop-photo-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(15,23,42,0.75);
  color: #fff;
  border: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.prop-photo-preview-remove:hover { background: #dc2626; }

.prop-photo-preview-label {
  width: 100%;
  border: none;
  background: rgba(255,255,255,0.95);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
  padding: 4px 6px;
  font-family: inherit;
  border-top: 1px solid var(--border-color);
  cursor: pointer;
}

/* Data Table */
.data-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  /* CRITICAL: without an explicit width, this div's box grows to fit its
     widest child (the table, min-width: 1400px) instead of being capped
     at its parent's width — which defeats overflow-x:auto entirely and
     pushes the whole page sideways instead of scrolling internally. */
  width: 100%;
  max-width: 100%;
  /* The native browser scrollbar is intentionally hidden below — the
     always-visible custom scrollbar row (with arrow buttons) underneath
     each table is the only scroll control shown, so there's exactly one
     obvious way to scroll instead of two overlapping/duplicate bars. */
  scrollbar-width: none;
}

.page-section {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.data-table-container.dragging {
  cursor: grabbing;
  user-select: none;
}

.data-table-container::-webkit-scrollbar {
  display: none;
}

.data-table {
  width: 100%;
  min-width: 1400px;
  border-collapse: collapse;
  text-align: left;
}

/* Custom always-visible horizontal scrollbar, placed directly under each
   table, with clickable arrow buttons on each end — matches a familiar
   native-scrollbar look so it's unmistakable and easy to grab precisely. */
.custom-scrollbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #eef1f5;
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  margin-bottom: 20px;
}

.custom-scrollbar-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  user-select: none;
}

.custom-scrollbar-arrow:hover {
  background: #f8fafc;
  color: var(--accent-gold);
  border-color: var(--accent-gold);
}

.custom-scrollbar-arrow:active {
  background: #f1f5f9;
}

.custom-scrollbar-track {
  flex: 1;
  height: 18px;
  background: #dde3ea;
  border-radius: 9px;
  position: relative;
  cursor: pointer;
}

.custom-scrollbar-thumb {
  position: absolute;
  top: 2px;
  height: 14px;
  background: #94a3b8;
  border-radius: 9px;
  cursor: grab;
  min-width: 40px;
  transition: background 0.15s ease;
}

.custom-scrollbar-thumb:hover,
.custom-scrollbar-thumb:active {
  background: #64748b;
  cursor: grabbing;
}

.data-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

/* Actions column: force every button/link inside it onto a single row
   instead of wrapping — the column itself is narrow, so a handful of
   inline icon buttons with left-margins were breaking onto 2-3 lines. */
.data-table td:last-child {
  white-space: nowrap;
}

.data-table td:last-child button,
.data-table td:last-child a {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.data-table tr:hover { background: #f1f5f9; }

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.contact-pill-call {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.contact-pill-call:hover {
  background: rgba(37, 99, 235, 0.18);
}

.contact-pill-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  color: #1a9c4a;
}

.contact-pill-whatsapp:hover {
  background: rgba(37, 211, 102, 0.2);
}

.stage-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.stage-new { background: #dbeafe; color: #1e40af; }
.stage-contacted { background: #fef3c7; color: #92400e; }
.stage-viewing { background: #f3e8ff; color: #6b21a8; }
.stage-closed { background: #d1fae5; color: #065f46; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.form-control:focus {
  background: #fff;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(197, 155, 39, 0.15);
}

textarea.form-control { resize: vertical; min-height: 90px; }

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.active { display: flex; }

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.resale-modal-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -12px 0 18px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
}

.admin-only-badge {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.role-hidden {
  display: none !important;
}

/* Neon status indicator — used to show whether SMTP/Zoom credentials are
   actively saved and configured (green, gently pulsing) or not (dim gray,
   static). */
.status-neon-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-neon-dot.status-neon-off {
  background-color: #cbd5e1;
  box-shadow: none;
}

.status-neon-dot.status-neon-on {
  background-color: #22c55e;
  box-shadow: 0 0 6px 2px rgba(34, 197, 94, 0.7);
  animation: neonPulse 1.8s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow: 0 0 6px 2px rgba(34, 197, 94, 0.7);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 3px 1px rgba(34, 197, 94, 0.35);
    opacity: 0.55;
  }
}

@media (max-width: 1024px) {
  .sidebar { width: 80px; }
  .brand-text, .nav-item button span:not(#tasksDueBadge), .sidebar-footer { display: none; }
  .nav-item button #tasksDueBadge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
  }
  .nav-item { position: relative; }
  .main-wrapper { margin-left: 80px; }
  .top-header { left: 80px; }
  .content-area { width: calc(100vw - 80px); max-width: calc(100vw - 80px); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .top-header { padding: 0 16px; }
  .content-area { padding: 16px; }
}

/* ─── TRUE MOBILE LAYOUT (phones) ────────────────────────────────────── */
.btn-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-main);
  cursor: pointer;
  padding: 4px 8px;
  margin-right: 4px;
}

.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 150;
}

.mobile-sidebar-backdrop.active {
  display: block;
}

@media (max-width: 640px) {
  .btn-hamburger { display: inline-flex; align-items: center; }

  /* Sidebar becomes an off-canvas drawer instead of a permanent column */
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .brand-text, .nav-item button span:not(#tasksDueBadge), .sidebar-footer {
    display: flex !important;
  }
  .nav-item button #tasksDueBadge {
    position: static !important;
    display: inline-flex !important;
    margin-left: auto;
  }

  .main-wrapper, .top-header {
    margin-left: 0 !important;
    left: 0 !important;
  }
  .content-area {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  /* Header becomes part of normal page flow on mobile (not fixed) since
     it wraps to two rows — fixed positioning would need a variable-height
     offset that's fragile across devices. */
  .top-header {
    position: static;
  }
  .content-area {
    margin-top: 0 !important;
  }

  /* Header: one tidy row — hamburger, search (fills remaining space),
     avatar. Everything else (currency badge, install app, add-property,
     new-lead) moves into a compact toolbar row underneath so nothing
     gets crushed or wraps unpredictably. */
  .top-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .btn-hamburger { order: 1; flex-shrink: 0; }
  .search-box { order: 2; flex: 1; min-width: 0; width: auto; }
  .search-box input { width: 100%; }
  .header-actions {
    order: 3;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }
  .header-actions .currency-badge,
  .header-actions #btnInstallApp {
    display: none;
  }
  .header-actions #btnQuickAddProperty span,
  .header-actions #btnQuickAddLead span { display: none; }
  .header-actions #btnQuickAddProperty,
  .header-actions #btnQuickAddLead {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
  }
  .user-profile { padding-left: 6px; gap: 6px; }
  .user-profile .user-info { display: none; }
  .content-area { padding: 14px; }

  /* Page headers: stack title and action button */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
  }
  .page-header .btn-primary { width: 100%; justify-content: center; }

  /* Properties page header has multiple action buttons (Bulk Edit, Export,
     Import, Add) — keep them as a compact icon-only row instead of stacking
     each one full-width, or they'd take up half the screen before you even
     see a property. */
  .page-header-actions {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .page-header-actions .btn-primary,
  .page-header-actions .btn-secondary {
    flex-shrink: 0;
    padding: 10px 12px;
  }
  .page-header-actions .btn-secondary span { display: none; }
  .page-header-actions .btn-primary { width: auto; }
  .page-header-actions .btn-primary span { display: none; }

  /* Tables: tighter padding on mobile so more columns are visible before
     the (already-global) horizontal scroll kicks in */
  .data-table th, .data-table td {
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .data-table td:last-child, .data-table th:last-child {
    position: sticky;
    right: 0;
    background: inherit;
  }

  /* Modals: near-fullscreen on phones */
  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 18px;
  }
  .modal-backdrop {
    padding: 0;
  }

  /* Bulk Edit uses its own overlay/panel classes (not .modal-backdrop),
     so it needs its own fullscreen mobile treatment. */
  .bulk-edit-overlay { padding: 0; }
  .bulk-edit-panel { max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .bulk-edit-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }
  .bulk-edit-header > div:last-child {
    width: 100%;
    justify-content: space-between;
  }

  .stat-card { padding: 16px; }
  .card-box { padding: 16px; }
}

/* Document Vault — RERA Template cards */
.doc-template-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: var(--transition);
}
.doc-template-card:hover { box-shadow: var(--shadow-md); background: #fff; }
.doc-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.doc-info { flex: 1; }
.doc-info h4 { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 2px; }
.doc-info p  { font-size: 11px; color: var(--text-muted); }
.btn-doc-download {
  background: var(--accent-gold-light);
  border: none;
  color: var(--accent-gold-dark);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-doc-download:hover { background: var(--accent-gold); color: #fff; }

/* Document Vault — Uploaded files */
.documents-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: var(--transition);
}
.doc-card:hover { background: #fff; box-shadow: var(--shadow-md); }
.doc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.doc-card-body { flex: 1; min-width: 0; }
.doc-card-name { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-card-actions { display: flex; gap: 4px; flex-shrink: 0; }

.doc-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.doc-empty-state i {
  font-size: 52px;
  color: #cbd5e1;
  display: block;
  margin-bottom: 12px;
}
.doc-empty-state p { font-size: 14px; font-weight: 600; margin-bottom: 4px; }

/* Market Analytics — Result Boxes */
.analytics-result-box {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  animation: fadeIn 0.3s ease;
}

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