:root {
  --navy-950: #061831;
  --navy-900: #071f3d;
  --navy-800: #0a3055;
  --blue-500: #2f8fe8;
  --blue-300: #7ac7ff;
  --text: #ffffff;
  --muted: #b9dfff;
  --line: rgba(255, 255, 255, 0.16);
}

* { box-sizing: border-box; }
html, body, #react-entry-point { min-height: 100%; margin: 0; }
body {
  background: #041426;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 10%, rgba(47,143,232,0.18), transparent 35%),
    linear-gradient(135deg, #041426 0%, #071f3d 48%, #061831 100%);
}

.dashboard-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 280px;
  min-width: 280px;
  padding: 24px 20px;
  background: rgba(4, 20, 38, 0.94);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 5;
}

.logo-box {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.logo {
  width: 100%;
  max-width: 220px;
  height: auto;
  max-height: 92px;
  object-fit: contain;
  display: block;
}

.filter-heading { font-size: 20px; font-weight: 700; margin-bottom: 18px; }
.filter-label { display: block; font-size: 13px; font-weight: 600; color: #d6ebff; margin: 15px 0 7px; }
.dashboard-dropdown { color: #071f3d; }
.dashboard-dropdown .Select-control { border-radius: 8px; }

.refresh-button {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 9px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #1f78c8, #35a6ff);
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(47,143,232,0.25);
}
.refresh-button:hover { filter: brightness(1.08); }
.filter-hint { margin-top: 12px; font-size: 12px; line-height: 1.45; color: #9fc7ea; }

.main-content { flex: 1; min-width: 0; padding: 28px 32px 40px; }
.title-panel {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(10,48,85,0.90), rgba(7,31,61,0.72));
  box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}
.title-panel h1 { margin: 0; font-size: 30px; line-height: 1.15; }
.title-panel p { margin: 8px 0 0; color: #b9dfff; }

.error-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255,118,118,0.40);
  border-radius: 10px;
  background: rgba(130, 20, 20, 0.28);
  color: #ffd2d2;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.kpi-card {
  min-height: 138px;
  padding: 20px;
  border: 1px solid rgba(122,199,255,0.20);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(10,48,85,0.94), rgba(6,24,49,0.90));
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
}

.clickable-kpi {
  cursor: pointer;
  position: relative;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  user-select: none;
}
.clickable-kpi:hover {
  transform: translateY(-3px);
  border-color: rgba(122,199,255,0.65);
  box-shadow: 0 16px 34px rgba(0,0,0,0.28), 0 0 0 1px rgba(122,199,255,0.15) inset;
}
.clickable-kpi:active { transform: translateY(-1px); }
.kpi-value { font-size: 31px; font-weight: 800; letter-spacing: -0.5px; }
.kpi-label { margin-top: 6px; font-size: 14px; font-weight: 700; }
.kpi-note { margin-top: 4px; font-size: 12px; color: #a9d0f2; }
.kpi-drill-hint { margin-top: 13px; font-size: 11px; color: #7ac7ff; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.chart-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(6,24,49,0.76);
  box-shadow: 0 12px 30px rgba(0,0,0,0.16);
}
.wide-panel { margin-bottom: 18px; }
.panel-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.map-graph { min-height: 430px; }
.tables-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Drill-down modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(1, 10, 20, 0.78);
  backdrop-filter: blur(8px);
}
.modal-hidden { display: none !important; }
.modal-card {
  width: min(1500px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(122,199,255,0.30);
  background: #061831;
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #0a3055, #071f3d);
}
.modal-title { margin: 0; font-size: 23px; }
.modal-subtitle { margin-top: 6px; color: #b9dfff; font-size: 13px; }
.modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 28px;
  line-height: 32px;
  cursor: pointer;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }
.modal-table-wrap { padding: 18px; }

@media (max-width: 980px) {
  .dashboard-shell { display: block; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: relative; }
  .main-content { padding: 20px; }
  .tables-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-card { width: 100%; max-height: 96vh; }
}