@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
  --bg:          #000000;
  --surface:     #0A0A0A;
  --surface-2:   #111111;
  --surface-3:   #1A1A1A;
  --border:      #2A2A2A;
  --border-soft: #181818;

  --text:        #F5F5F5;
  --text-muted:  #666666;
  --text-dim:    #333333;

  /* Electric blue — monochromatic scale */
  --accent:      #0088FF;
  --accent-h:    #006ECC;
  --accent-dim:  rgba(0,136,255,.12);
  --blue-soft:   #33AAFF;
  --blue-muted:  rgba(0,136,255,.5);

  /* Status — monochromatic electric blue scale */
  --lead:        #66BBFF;
  --lead-dim:    rgba(102,187,255,.12);
  --contacted:   #0088FF;
  --contacted-dim: rgba(0,136,255,.12);
  --client:      #0055FF;
  --client-dim:  rgba(0,85,255,.12);
  --danger:      #FF2D55;
  --danger-dim:  rgba(255,45,85,.12);
  --warning:     #FFD600;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.4);
  --shadow:      0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.6);

  --sidebar-w:        220px;
  --sidebar-w-collapsed: 56px;
  --topbar-h:    60px;
  --mobile-nav:  64px;

  --transition:  0.18s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; scroll-behavior: smooth; }

body {
  height: 100%;
  font-family: 'Nunito Sans', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }

/* ─── App Layout ─────────────────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  overflow: hidden;
  transition: grid-template-columns 0.22s ease;
}

.app-layout.sidebar-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

/* ─── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  transition: width 0.22s ease;
  width: var(--sidebar-w);
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
}

/* ─── Sidebar Header ─────────────────────────────────────────────── */
@keyframes logo-pop-in {
  0%   { transform: scale(0.7) rotate(-15deg); opacity: 0.4; }
  60%  { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes logo-pop-out {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(0.85) rotate(-8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-bottom: 1px solid var(--border-soft);
  min-height: 58px;
  overflow: hidden;
}

/* The logo IS the toggle button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 14px 14px;
  background: none;
  border: none;
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
}

.sidebar-collapsed .sidebar-toggle { justify-content: center; padding: 14px 0; }

.sidebar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  transition: filter 0.2s ease;
}

.sidebar-toggle:hover .sidebar-logo-img { filter: brightness(1.2); }

.sidebar-logo-img.animate-in  { animation: logo-pop-in  0.35s cubic-bezier(.34,1.56,.64,1) forwards; }
.sidebar-logo-img.animate-out { animation: logo-pop-out 0.28s ease forwards; }

.sidebar-logo-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  white-space: nowrap;
  opacity: 1;
  max-width: 160px;
  transition: opacity 0.18s ease, max-width 0.22s ease;
  overflow: hidden;
  text-align: left;
}

.sidebar-collapsed .sidebar-logo-text { opacity: 0; max-width: 0; }

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 10px 4px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease;
}

.sidebar-collapsed .nav-section-label { opacity: 0; pointer-events: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-collapsed .nav-item { padding: 9px 0; justify-content: center; gap: 0; }

.nav-label {
  transition: opacity 0.15s ease;
  overflow: hidden;
}

.sidebar-collapsed .nav-label { opacity: 0; width: 0; }

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item.active svg { opacity: 1; color: var(--accent); }

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border-soft);
  overflow: hidden;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  overflow: hidden;
}

.sidebar-collapsed .user-card { justify-content: center; padding: 8px 0; gap: 0; }
.sidebar-collapsed .user-info,
.sidebar-collapsed .btn-logout { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }

.user-card:hover { background: var(--surface-2); }

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex;
  align-items: center;
}

.btn-logout:hover { color: var(--danger); background: var(--danger-dim); }

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.topbar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.topbar-logo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-body {
  padding: 28px;
  flex: 1;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); color: #fff; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.25);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ─── Stat Cards ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}

.stat-card:hover {
  border-color: var(--border);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
}


/* ─── Section Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.1px;
}

.card-body { padding: 20px 24px; }
.card-body:has(> .data-table),
.card-body:has(> table) { padding: 0; }

/* ─── Table ──────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover { background: var(--surface-2); }

.data-table td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}

.data-table td.muted { color: var(--text-muted); }

.table-scroll { max-height: 480px; overflow-y: auto; }

/* ─── Status Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-lead    { background: var(--lead-dim);      color: var(--lead);      }
.badge-lead::before { background: var(--lead); }
.badge-contacted { background: var(--contacted-dim); color: var(--contacted); }
.badge-contacted::before { background: var(--contacted); }
.badge-client  { background: var(--client-dim);    color: var(--client);    }
.badge-client::before { background: var(--client); }
.badge-admin   { background: rgba(99,102,241,.15); color: var(--accent); }
.badge-admin::before { background: var(--accent); }
.badge-executive { background: var(--contacted-dim); color: var(--contacted); }
.badge-executive::before { background: var(--contacted); }
.badge-viewer  { background: var(--surface-3); color: var(--text-muted); }
.badge-viewer::before { background: var(--text-muted); }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-section {
  margin-bottom: 28px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

input[type="url"] {
  background: var(--surface-2);
  color: var(--text);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,136,255,.12);
}

/* Override browser autofill yellow/white background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
}

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

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A8394' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select option { background: var(--surface-2); color: var(--text); }

/* Form errors */
.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 3px;
}

input.error, select.error, textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-dim);
}

/* ─── Alerts / Flash ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 12px;
}

.alert-success { background: rgba(16,185,129,.12); color: #34D399; border: 1px solid rgba(16,185,129,.2); }
.alert-danger   { background: var(--danger-dim);  color: #F87171;  border: 1px solid rgba(239,68,68,.2); }
.alert-warning  { background: rgba(245,158,11,.12); color: #FCD34D; border: 1px solid rgba(245,158,11,.2); }

/* ─── Search / Filters ───────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.search-bar svg { color: var(--text-dim); flex-shrink: 0; }

.search-bar input {
  background: none;
  border: none;
  box-shadow: none;
  padding: 9px 0;
  width: 100%;
  color: var(--text);
  font-size: 13.5px;
}

.search-bar input:focus { box-shadow: none; border: none; }

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: var(--surface-2);
  color: var(--text-muted);
}

.chip:hover { background: var(--surface-3); color: var(--text); }

.chip.active-all       { background: var(--accent-dim);    color: var(--accent);    border-color: rgba(0,136,255,.3); }
.chip.active-lead      { background: var(--lead-dim);      color: var(--lead);      border-color: rgba(102,187,255,.3); }
.chip.active-contacted { background: var(--contacted-dim); color: var(--contacted); border-color: rgba(0,136,255,.3); }
.chip.active-client    { background: var(--client-dim);    color: var(--client);    border-color: rgba(0,85,255,.3); }

.chip.chip-city { padding: 4px 10px; font-size: 11.5px; }

.filter-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 5px;
}

/* ─── Map styles ─────────────────────────────────────────────────── */
.map-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.map-panel {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 55%;
  flex-shrink: 0;
}

.map-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.map-business-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.map-business-item:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.map-business-item.highlighted {
  background: var(--accent-dim);
  border-color: rgba(99,102,241,.3);
}

.map-business-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-business-addr {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#map-container {
  height: 100%;
  background: var(--bg);
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-tip { background: var(--surface-2) !important; }

.leaflet-popup-content { margin: 0 !important; width: auto !important; }

.popup-card { padding: 16px; min-width: 220px; max-width: 280px; }
.popup-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.popup-row  { font-size: 12.5px; color: var(--text-muted); margin-bottom: 3px; }
.popup-row span { color: var(--text); }
.popup-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-soft); }

/* ─── Login page ─────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.4px; }
.login-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-submit {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
  padding: 11px;
  font-size: 14px;
}

/* ─── Error pages ────────────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  padding: 24px;
}

.error-code {
  font-size: 80px;
  font-weight: 800;
  color: var(--surface-3);
  letter-spacing: -4px;
  line-height: 1;
}

.error-title { font-size: 20px; font-weight: 700; color: var(--text); }
.error-sub   { font-size: 14px; color: var(--text-muted); max-width: 340px; }

/* ─── Scrollbars ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ─── Utilities ──────────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12.5px; }
.font-600    { font-weight: 600; }

/* ─── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Layout ── */
  .app-layout {
    display: block !important;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
  }

  .main-content {
    display: block;
    width: 100%;
    height: calc(100dvh - var(--mobile-nav));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Bottom tab bar ── */
  .sidebar {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    width: 100% !important;
    height: var(--mobile-nav) !important;
    flex-direction: row !important;
    border-right: none !important;
    border-top: 1px solid var(--border-soft);
    background: var(--surface);
    z-index: 500;
    overflow: visible !important;
  }

  .sidebar-header,
  .sidebar-footer,
  .nav-section-label,
  .sidebar-toggle { display: none !important; }

  .sidebar-nav {
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    flex: 1;
    overflow: visible;
  }

  .nav-item {
    flex-direction: column !important;
    gap: 2px !important;
    padding: 8px 4px !important;
    font-size: 9px;
    min-width: 0;
    flex: 1;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 6px;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-label {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    font-size: 9px;
    white-space: nowrap;
    line-height: 1;
  }
  /* hide badge counts on mobile nav to save space */
  .nav-item .badge-dot { display: none; }

  /* ── Topbar ── */
  .topbar {
    padding: 0 12px;
    height: 52px;
  }
  .topbar-title { font-size: 15px; font-weight: 700; }
  .topbar-actions { gap: 6px; }

  /* Hide text labels in topbar buttons, keep icons */
  .topbar-actions .btn-ghost .btn-text { display: none; }
  .topbar-actions .btn-ghost {
    padding: 6px 8px;
    min-width: 32px;
    justify-content: center;
  }
  .topbar-actions .btn-primary { padding: 6px 10px; font-size: 12px; }
  .topbar-actions .btn-primary .btn-text { display: none; }

  /* ── Page body ── */
  .page-body { padding: 12px; }

  /* ── Stat cards — compact 2-col grid ── */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    margin-bottom: 14px;
  }
  .stat-card { padding: 14px 12px; border-radius: 12px; }
  .stat-label { font-size: 10px; margin-bottom: 6px; }
  .stat-value { font-size: 22px; letter-spacing: -0.5px; }
  .stat-sub { font-size: 11px; }

  /* ── Cards ── */
  .card { border-radius: 12px; }
  .card-header { padding: 12px 14px; }
  .card-title { font-size: 13px; }
  .card-body { padding: 0 !important; }
  .card-body:has(> form),
  .card-body:has(> div:not(.data-table)) { padding: 14px !important; }

  /* ── Tables — show only key columns ── */
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 10px; }
  .data-table th:nth-child(n+3),
  .data-table td:nth-child(n+3) { display: none; }

  /* ── Forms ── */
  .form-grid, .form-grid-3 { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* ── Map ── */
  .map-layout {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100dvh - 52px - var(--mobile-nav));
  }
  /* Filters on top */
  .map-layout > .map-panel {
    order: 1;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 55vh;
  }
  /* Map below, smaller */
  .map-layout > #map-container {
    order: 2;
    flex: 1;
    min-height: 0;
  }
  .map-panel-header {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 10px 14px !important;
    gap: 10px !important;
    max-height: none !important;
    flex: 1;
  }
  .filter-section-label { display: block !important; }
  .filter-chips { flex-wrap: wrap !important; gap: 6px; }
  .search-bar { width: 100%; }

  /* Hide the business list */
  .map-panel-body { display: none !important; }

  /* ── Metrics ── */
  .metrics-team-grid { grid-template-columns: 1fr !important; }
}
