:root {
  --sea:       #c8e0ef;
  --land:      #ddd5be;
  --land-stroke: #bfb8a2;
  --high-strong: #993C1D;
  --high-mid:    #D85A30;
  --high-light:  #F5C4B3;
  --high-bg:     #FAECE7;
  --low-strong:  #0C447C;
  --low-mid:     #378ADD;
  --low-light:   #B5D4F4;
  --low-bg:      #E6F1FB;
  --panel-bg:    #ffffff;
  --page-bg:     #f4f2ee;
  --border:      rgba(0,0,0,0.10);
  --text-muted:  #6b6a65;
  --text-hint:   #9c9a92;
  --font-body:   'IBM Plex Sans', sans-serif;
  --font-mono:   'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  min-height: 100vh;
  font-size: 13px;
  color: #1a1a18;
}

/* ── TOP BAR ─────────────────────────────────────── */
.topbar {
  background: var(--panel-bg);
  border-bottom: 0.5px solid var(--border);
  padding: 0 20px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-brand { font-size: 13px; font-weight: 500; white-space: nowrap; }
.topbar-sub   { font-size: 11px; color: var(--text-muted); }
.topbar-nav { margin-left: auto; display: flex; gap: 3px; }
.nav-pill {
  font-size: 12px; padding: 5px 13px;
  border-radius: 6px; border: 0.5px solid transparent;
  cursor: pointer; color: var(--text-muted);
  background: transparent; transition: all .15s;
}
.nav-pill:hover  { background: #f0ede8; }
.nav-pill.active {
  background: var(--low-bg);
  color: var(--low-strong);
  border-color: var(--low-mid);
}

/* ── LAYOUT ──────────────────────────────────────── */
.portal-body {
  display: grid;
  grid-template-columns: 248px 1fr 264px;
  height: calc(100vh - 50px);
}

/* ── LEFT PANEL ──────────────────────────────────── */
.left-panel {
  background: var(--panel-bg);
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.filter-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(#e0e6ed); margin-bottom: 8px;
}
.param-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}
.param-btn {
  font-size: 12px; padding: 7px 8px;
  border-radius: 6px;
  border: 0.5px solid var(--border);
  background: #f7f5f0;
  color: var(--text-muted);
  cursor: pointer; text-align: left;
  transition: all .12s;
}
.param-btn:hover { background: #ede9e2; }
.param-btn.active-high {
  background: var(--high-bg);
  border-color: var(--high-mid);
  color: var(--high-strong);
}
.param-btn.active-low {
  background: var(--low-bg);
  border-color: var(--low-mid);
  color: var(--low-strong);
}

.seg-toggle {
  display: flex;
  border: 0.5px solid var(--border);
  border-radius: 7px; overflow: hidden;
}
.seg-btn {
  flex: 1; font-size: 12px; padding: 7px 4px;
  text-align: center; cursor: pointer;
  border: none; background: #f7f5f0;
  color: var(--text-muted); transition: all .12s;
}
.seg-btn + .seg-btn { border-left: 0.5px solid var(--border); }
.seg-btn.active-high { background: var(--high-bg); color: var(--high-strong); }
.seg-btn.active-low  { background: var(--low-bg);  color: var(--low-strong); }
.seg-btn.active-def  { background: var(--panel-bg); color: #1a1a18; font-weight: 500; }

.slider-wrap { display: flex; flex-direction: column; gap: 5px; }
.slider-row-lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.slider-val { font-weight: 500; color: #1a1a18; }
input[type=range] {
  width: 100%; accent-color: var(--high-mid);
}
input[type=text], input[type=date], input[type=number] {
  width: 100%; font-size: 12px;
  border: 0.5px solid var(--border);
  border-radius: 5px; padding: 5px 8px;
  background: #f7f5f0; color: #1a1a18;
  font-family: var(--font-mono);
  outline: none;
}
input[type=text]:focus, input[type=date]:focus {
  border-color: var(--low-mid);
  background: #fff;
}
.bbox-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 7px;
}
.bbox-field label { font-size: 11px; color: var(--text-hint); display: block; margin-bottom: 3px; }

/* ── MAP ─────────────────────────────────────────── */
.map-area {
  position: relative; overflow: hidden;
  background: var(--sea);
  display: flex; flex-direction: column;
}
.map-area svg { flex: 1; width: 100%; }
.map-zoom {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.map-btn {
  width: 28px; height: 28px;
  background: var(--panel-bg);
  border: 0.5px solid var(--border);
  border-radius: 5px; font-size: 14px; font-weight: 400;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #1a1a18; transition: background .12s;
}
.map-btn:hover { background: #f0ede8; }
.map-legend {
  position: absolute; bottom: 56px; left: 12px;
  background: var(--panel-bg);
  border: 0.5px solid var(--border);
  border-radius: 7px; padding: 8px 12px;
}
.legend-title { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }
.legend-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.map-timebar {
  background: var(--panel-bg);
  border-top: 0.5px solid var(--border);
  padding: 9px 16px; display: flex; align-items: center; gap: 10px;
}
.play-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--low-bg); color: var(--low-strong);
  border: none; cursor: pointer; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.timeline {
  flex: 1; height: 4px; background: #e0ddd6;
  border-radius: 2px; position: relative; cursor: pointer;
}
.timeline-fill {
  height: 100%; background: var(--low-mid);
  border-radius: 2px; width: 62%;
}
.timeline-handle {
  position: absolute; top: -4px; left: 62%;
  width: 12px; height: 12px;
  background: var(--panel-bg);
  border: 1.5px solid var(--low-mid);
  border-radius: 50%; transform: translateX(-50%);
}
.time-lbl { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-family: var(--font-mono); }

/* ── RIGHT PANEL ─────────────────────────────────── */
.right-panel {
  background: var(--panel-bg);
  border-left: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rp-header {
  padding: 11px 16px;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.rp-title { font-size: 13px; font-weight: 500; }
.rp-count { font-size: 11px; color: var(--text-hint); font-family: var(--font-mono); }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 12px 16px;
}
.stat-card {
  background: #f7f5f0; border-radius: 7px; padding: 10px 12px;
}
.stat-lbl { font-size: 10px; color: var(--text-hint); margin-bottom: 3px; }
.stat-val { font-size: 19px; font-weight: 500; font-family: var(--font-mono); }
.stat-unit { font-size: 10px; font-weight: 400; color: var(--text-hint); }

.sparkline-wrap {
  padding: 0 16px 10px;
  border-bottom: 0.5px solid var(--border);
}
.spark-lbl { font-size: 11px; color: var(--text-hint); margin-bottom: 5px; }

.event-list {
  flex: 1; overflow-y: auto; padding: 10px 16px;
  display: flex; flex-direction: column; gap: 7px;
}
.event-card {
  border: 0.5px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  cursor: pointer; background: var(--panel-bg);
  transition: border-color .12s, box-shadow .12s;
}
.event-card:hover { border-color: #b0ad a4; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.event-card.selected {
  border-color: var(--low-mid);
  background: var(--low-bg);
}
.ec-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
.ec-title { font-size: 12px; font-weight: 500; font-family: var(--font-mono); }
.ec-badge {
  font-size: 10px; padding: 2px 7px;
  border-radius: 8px; font-weight: 500; flex-shrink: 0;
}
.badge-high { background: var(--high-bg); color: var(--high-strong); }
.badge-low  { background: var(--low-bg);  color: var(--low-strong); }
.ec-meta { display: flex; gap: 10px; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; font-family: var(--font-mono); }
.intensity-bar { height: 3px; background: #e0ddd6; border-radius: 2px; }
.intensity-fill { height: 100%; border-radius: 2px; }

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d0c8; border-radius: 3px; }

.sb-sidenav-menu
{
	padding: 10px;
}


.sb-subsection
{
	margin-top: 20px;
}


.sb-subsection label, .sb-subsection .slider-row-lbl
{
	color: #E5E1D8;
}

.sb-subsection label, .sb-subsection .slider-val
{
	color: #B0BCC7;
}


.main-div
{
	max-height: calc(100vh - 120px);
	height: calc(100vh - 126px);
	padding: 10px 0;
	margin: 0;
	overflow-y: auto;
}


footer
{
	position: fixed;
	bottom: 0;
	width: -webkit-fill-available;
	height: 70px;
}


footer span
{
	font-size: 14px;
}


.map-div
{
	width: 100%;
	height: 100%;
	height: calc(100vh - 160px);
	margin: 10px 0;
}


.navbar .navbar-brand
{
	text-wrap-mode: wrap;
	line-height: normal;
	font-size: 17px;
}


.chart-pane
{
	height: fit-content;
	min-height: 200px;
	width: 100%;
}


.chart-pane canvas
{
	width: 100%;
}

