:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --ink-secondary: #475467;
  --muted: #667085;
  --line: #e3e8ef;
  --line-light: #edf2f7;
  --brand: #1f4e79;
  --brand-hover: #163a5c;
  --brand-light: #eaf2f8;
  --accent: #2563eb;
  --good: #157347;
  --good-bg: #e9f7ef;
  --good-border: #c3e6cb;
  --warn: #9a6700;
  --warn-bg: #fff6d8;
  --warn-border: #ffeeba;
  --danger: #b02a37;
  --danger-bg: #f8d7da;
  --purple: #6f42c1;
  --purple-bg: #f3e8ff;
  --teal: #0d9488;
  --teal-bg: #ccfbf1;
  --shadow-sm: 0 2px 6px rgba(23, 32, 51, 0.04);
  --shadow: 0 10px 30px rgba(23, 32, 51, 0.08);
  --shadow-lg: 0 16px 40px rgba(23, 32, 51, 0.12);
  --r: 16px;
  --r-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #edf2f7;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Main Layout Grid */
.app, .app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.side, .sidebar {
  background: #102a43;
  color: #dce9f3;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
  text-decoration: none;
  color: inherit;
}

.mark, .brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4a91bd, #71c2e3);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.brand b, .brand-title {
  display: block;
  color: white;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.brand small, .brand-sub {
  color: #95afc2;
  font-size: 11px;
  font-weight: 500;
}

.nav-label, .nav-section {
  font-size: 10px;
  color: #7391a6;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 18px 10px 8px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav a, .nav button {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 10px;
  color: #c8d9e6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav a .icon {
  font-size: 15px;
  display: inline-block;
}

.nav a:hover, .nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav a.active, .nav button.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #71c2e3;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6aaed6;
  display: inline-block;
  flex-shrink: 0;
}

.nav a.active .dot, .nav button.active .dot {
  background: #71c2e3;
  box-shadow: 0 0 8px #71c2e3;
}

.side-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #7391a6;
  line-height: 1.5;
}

.side-footer a {
  color: #95afc2;
  text-decoration: underline;
}

/* Main Area */
.main, .main-wrapper {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Top Sticky Header */
.top, .topbar {
  min-height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 16px;
}

.crumb {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.crumb b {
  color: var(--ink);
}

.crumb a {
  color: var(--brand);
  text-decoration: none;
}
.crumb a:hover {
  text-decoration: underline;
}

/* Search Omnibox */
.search-box-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 13px;
  background: #f8fafc;
  color: var(--ink);
  transition: all 0.2s ease;
  outline: none;
}

.search-box-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
  opacity: 0.6;
}

.search-input:focus {
  background: white;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.12);
}

.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.search-dropdown.open {
  display: block;
}

.search-group-title {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.08em;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-light);
}

.search-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: background 0.1s;
}

.search-item:hover {
  background: #f1f5f9;
}

.search-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content Container */
.content, .content-body {
  padding: 24px 30px 60px;
  min-height: calc(100vh - 70px);
}

/* Hero Section */
.hero {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.profile {
  display: flex;
  gap: 20px;
  align-items: center;
}

.avatar {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: linear-gradient(135deg, #1f4e79, #2b6cb0);
  color: white;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.avatar.office-ro { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.avatar.office-zo { background: linear-gradient(135deg, #059669, #34d399); }
.avatar.office-ho { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.avatar.office-ti { background: linear-gradient(135deg, #d97706, #fbbf24); }
.avatar.office-do { background: linear-gradient(135deg, #475569, #94a3b8); }

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--brand);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero .sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--line);
}

.badge.good { background: var(--good-bg); color: var(--good); border-color: var(--good-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge.danger { background: var(--danger-bg); color: var(--danger); border-color: #f5c6cb; }

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.btn.primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.btn.primary:hover {
  background: var(--brand-hover);
}

.btn.sm {
  padding: 5px 10px;
  font-size: 11px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.fact small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.fact strong {
  font-size: 14px;
  color: var(--ink);
  font-weight: 700;
}

/* Metrics Section (4 cards) */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.metric small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.metric b {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: var(--brand);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* Grids */
.grid2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.title span {
  font-size: 11px;
  color: var(--muted);
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e2e8f0;
}

.event {
  position: relative;
  padding-bottom: 18px;
}

.event::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 2px solid #94a3b8;
}

.event.current::before {
  border-color: var(--brand);
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.event small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.event b {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin: 2px 0;
}

.event p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-secondary);
}

/* Progress Bars */
.prow {
  margin-bottom: 12px;
}

.phead {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
}

.phead b {
  color: var(--ink);
}

.phead span {
  color: var(--muted);
}

.progress {
  height: 7px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Key-value List */
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
}

.item b {
  display: block;
  font-size: 12px;
  color: var(--ink);
}

.item p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.pill.blue { background: #e0f2fe; color: #0369a1; }
.pill.green { background: #dcfce7; color: #15803d; }
.pill.warn { background: #fef3c7; color: #b45309; }
.pill.danger { background: #fee2e2; color: #b91c1c; }

/* Table Section */
.table-section {
  margin-bottom: 24px;
}

.table-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.data-table th {
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink-secondary);
}

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

.data-table td b {
  color: var(--ink);
}

/* Notice box */
.notice {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 12px;
  color: #166534;
  margin-top: 20px;
}

/* As-on-date Bar */
.as-on-date-bar {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.as-on-date-bar label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.as-on-date-bar input[type="date"] {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

/* Map Section */
.geo-map-card {
  margin-bottom: 24px;
  overflow: hidden;
}

.geo-map-container {
  height: 380px;
  width: 100%;
  border-radius: 12px;
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  background: #f1f5f9;
}

.map-header-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.map-toggle-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-toggle-btn:hover {
  background: #f8fafc;
}

.map-toggle-btn.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.heatmap-spectrum {
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #15803d, #84cc16, #eab308, #ea580c, #dc2626);
  display: inline-block;
}

.map-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-secondary);
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Custom Marker Styles (Strictly Green to Red Spectrum) */
.custom-map-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid white;
  transition: transform 0.2s ease;
}

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

.custom-map-marker.status-red {
  background: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.custom-map-marker.status-orange {
  background: #ea580c !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.custom-map-marker.status-amber {
  background: #eab308 !important;
  color: #1c1917 !important;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.custom-map-marker.status-lime {
  background: #65a30d !important;
  box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.custom-map-marker.status-green {
  background: #15803d !important;
  box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.custom-map-marker.office-pin {
  background: #1f4e79 !important;
  border-radius: 8px;
}

.custom-map-marker.is-current {
  animation: pulseMarker 2s infinite;
}

@keyframes pulseMarker {
  0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(21, 128, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

.custom-map-marker.status-red.is-current {
  animation: pulseRedMarker 2s infinite;
}

@keyframes pulseRedMarker {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
  padding: 4px;
}

.leaflet-popup-content {
  margin: 10px 14px;
  font-size: 12px;
  line-height: 1.4;
}

.map-popup-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
}

.map-popup-sub {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 500;
  padding: 20px;
}

.modal-backdrop.open {
  display: grid;
}

.modal, .modal-card {
  background: white;
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

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

.modal-body {
  padding: 22px;
  overflow-y: auto;
}

/* Links inside tables/cards */
a.entity-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

a.entity-link:hover {
  text-decoration: underline;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .app, .app-layout {
    grid-template-columns: 80px 1fr;
  }
  .brand div:last-child, .nav-label, .nav-section, .nav a span:not(.icon), .side-footer {
    display: none;
  }
  .nav a, .nav button {
    justify-content: center;
    padding: 12px;
  }
  .brand {
    justify-content: center;
  }
  .metrics, .facts {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2, .grid3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app, .app-layout {
    display: flex;
    flex-direction: column;
  }
  .side, .sidebar {
    height: auto;
    position: relative;
    padding: 16px;
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav a, .nav button {
    padding: 8px 12px;
    width: auto;
  }
  .brand div:last-child, .nav a span:not(.icon) {
    display: inline-block;
  }
  .top, .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .search-box-wrapper {
    max-width: 100%;
    margin: 8px 0;
    order: 3;
    width: 100%;
  }
  .content, .content-body {
    padding: 16px;
  }
  .facts, .metrics, .grid2, .grid3 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 22px;
  }
  .profile {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Print Styling */
@media print {
  .side, .sidebar, .top, .topbar, .actions, .search-box-wrapper, .modal-backdrop {
    display: none !important;
  }
  .app, .app-layout {
    display: block;
  }
  .content, .content-body {
    padding: 0;
    max-width: 100%;
  }
  .card, .hero {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
}

/* Print Media Query */
@media print {
  .sidebar, .topbar, .actions, .filter-bar, .search-box-wrapper, .modal-backdrop, .map-header-controls {
    display: none !important;
  }
  .app-layout {
    display: block !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
}

/* Spatial & Regional Stagnation Analytics Styles */
.scatter-plot-card {
  margin-bottom: 24px;
}

.scatter-plot-wrapper {
  position: relative;
  width: 100%;
  height: 440px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.scatter-plot-svg {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.scatter-dot {
  transition: transform 0.15s ease, opacity 0.15s ease;
  cursor: pointer;
}

.scatter-dot:hover {
  transform: scale(1.6);
  opacity: 1 !important;
}

.scatter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.scatter-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.scatter-select {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: white;
  cursor: pointer;
}

.filter-pills-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink-secondary);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-pill:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.filter-pill.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.filter-pill.active.danger {
  background: #dc2626;
  border-color: #dc2626;
}

.filter-pill.active.warn {
  background: #ea580c;
  border-color: #ea580c;
}

.filter-pill.active.good {
  background: #15803d;
  border-color: #15803d;
}

.filter-controls-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .filter-controls-row {
    grid-template-columns: 1fr;
  }
}

.scatter-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
  max-width: 260px;
}

.scatter-tooltip b {
  color: white;
  font-size: 12px;
}

.scatter-tooltip .badge {
  margin-top: 4px;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.matrix-table th {
  background: #f8fafc;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  border-bottom: 1px solid var(--line);
}

.matrix-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.matrix-table tr:hover {
  background: #f8fafc;
  cursor: pointer;
}

.stagnation-index-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stagnation-bar-outer {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.stagnation-bar-fill {
  height: 100%;
  border-radius: 4px;
}

/* Macro-Regional Affinity & Distribution */
.macro-region-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: #e2e8f0;
  margin: 12px 0 16px 0;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.macro-region-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.macro-region-seg:hover {
  filter: brightness(1.12);
}

.macro-region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.macro-region-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--ink);
}

.macro-region-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
