/* ── Global ──────────────────────────────────────────────── */
body {
  background-color: #f0f4f8;
  font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
}

/* ── Navbar ──────────────────────────────────────────────── */
.app-navbar {
  background-color: #040c18 !important;
  background-image: url('/assets/banner.svg') !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  z-index: 1050;
  min-height: 108px;
}
/* very light overlay — SVG already has dark background; stronger on left for text readability */
.app-navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(4,12,24,0.55) 0%, rgba(4,12,24,0.15) 40%, rgba(4,12,24,0.05) 100%);
  z-index: 0;
}
.app-navbar > * { position: relative; z-index: 1; }
.app-navbar .navbar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: #e2e8f0 !important;
}
.app-navbar .subtitle-text {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.50);
}
.app-navbar img {
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
.navbar-action-btn {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  padding: 0.28rem 0.75rem !important;
  border-radius: 6px !important;
}
.navbar-status { font-size: 0.75rem; color: rgba(226,232,240,0.85); margin-left: 6px; }
.navbar-badge  { font-size: 0.72rem !important; padding: 0.25em 0.55em !important; }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar-col {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 0 !important;
}
/* Outer wrapper fills viewport height and uses flex column */
.sidebar-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 108px);
  overflow: hidden;
}
/* Scrollable accordion area */
.sidebar-inner {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 0.75rem 0.6rem 0.5rem 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.sidebar-inner::-webkit-scrollbar { width: 5px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
/* Sticky action footer — always visible */
.sidebar-footer {
  flex-shrink: 0;
  background: white;
  border-top: 2px solid #e2e8f0;
  padding: 0.6rem 0.7rem 0.75rem 0.7rem;
  box-shadow: 0 -3px 10px rgba(0,0,0,0.06);
  z-index: 5;
}
.sidebar-footer .btn-load { background: #1a56db !important; border-color: #1a56db !important; }
.sidebar-footer .btn-run  { background: #057a55 !important; border-color: #057a55 !important; }

/* Accordion in sidebar */
.accordion-button {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  padding: 0.5rem 0.85rem !important;
  background: #f8fafc !important;
  color: #1e293b !important;
}
.accordion-button:not(.collapsed) {
  color: #1a56db !important;
  background: #eff6ff !important;
  box-shadow: none !important;
}
.accordion-body {
  font-size: 0.82rem;
  padding: 0.65rem 0.85rem !important;
  background: white;
}
.accordion-item {
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  overflow: hidden;
  margin-bottom: 4px !important;
}

/* Sidebar labels */
.sidebar-inner label {
  font-size: 0.78rem !important;
  font-weight: 600;
  color: #475569;
  margin-bottom: 3px !important;
}

/* ── Main content area ───────────────────────────────────── */
.main-col {
  min-height: calc(100vh - 56px);
  padding: 1rem 1.25rem !important;
}

/* ── Tabs ────────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid #e2e8f0 !important;
  margin-bottom: 1rem !important;
}
.nav-tabs .nav-link {
  font-size: 0.83rem;
  font-weight: 500;
  padding: 0.42rem 0.85rem;
  color: #64748b !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.nav-tabs .nav-link:hover {
  color: #1a56db !important;
}
.nav-tabs .nav-link.active {
  color: #1a56db !important;
  border-bottom-color: #1a56db !important;
  background: transparent !important;
  font-weight: 700;
}

/* ── Metric cards ────────────────────────────────────────── */
.metric-card {
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07) !important;
  transition: box-shadow 0.2s;
}
.metric-card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.10) !important; }
.metric-card .card-body { padding: 0.9rem 1rem !important; }
.metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.metric-label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  font-weight: 600;
}
.metric-icon {
  font-size: 1.1rem;
  opacity: 0.6;
}

/* ── Chart cards ─────────────────────────────────────────── */
.chart-card {
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07) !important;
  margin-bottom: 1rem;
}
.chart-card .card-body { padding: 0.5rem 0.5rem 0 0.5rem !important; }

/* ── Disclaimer ──────────────────────────────────────────── */
.disclaimer-box {
  border-left: 4px solid #176B87;
  background: #f0f9ff;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  color: #475569;
  border-radius: 0 8px 8px 0;
  line-height: 1.5;
}

/* ── Section headers ─────────────────────────────────────── */
.section-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
}

/* ── Tables ──────────────────────────────────────────────── */
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner th {
  background: #f1f5f9 !important;
  font-size: 0.78rem !important;
  color: #475569 !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner td {
  font-size: 0.83rem !important;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-load { background: #1a56db !important; border-color: #1a56db !important; }
.btn-run  { background: #057a55 !important; border-color: #057a55 !important; }

/* ── Upload zone ─────────────────────────────────────────── */
#upload-scenario > div {
  border: 1.5px dashed #cbd5e1 !important;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: #64748b;
  background: #f8fafc;
  transition: border-color 0.15s;
}
#upload-scenario > div:hover { border-color: #1a56db !important; color: #1a56db; }

/* ── Spinner overlay ─────────────────────────────────────── */
._dash-loading { min-height: 120px; }

/* ── Slider tooltips ─────────────────────────────────────── */
.rc-slider-tooltip-inner {
  background: #1a56db !important;
  border-radius: 4px !important;
  font-size: 0.72rem !important;
  padding: 2px 7px !important;
}
.rc-slider-tooltip-placement-bottom .rc-slider-tooltip-arrow {
  border-bottom-color: #1a56db !important;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state-wrapper {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Language selector */
.lang-btn {
  font-size: 0.75rem !important;
  padding: 2px 8px !important;
  border-color: rgba(255,255,255,0.35) !important;
  color: rgba(255,255,255,0.85) !important;
}
.lang-btn:hover, .lang-btn:focus, .lang-btn.active {
  background-color: rgba(255,255,255,0.18) !important;
  color: #fff !important;
}
