:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #8e97b3;
  --amber: #ffb703;
  --orange: #fb8500;
  --green: #3ddc97;
  --radius: 20px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow { position: fixed; border-radius: 50%; filter: blur(120px); opacity: 0.35; pointer-events: none; z-index: 0; }
.g1 { width: 520px; height: 520px; background: var(--orange); top: -200px; right: -120px; opacity: 0.22; }
.g2 { width: 480px; height: 480px; background: #3b5bdb; bottom: -220px; left: -160px; opacity: 0.25; }

.hero, .layout, footer { position: relative; z-index: 1; max-width: 1360px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* ---------- Hero ---------- */
.hero { padding-top: 48px; padding-bottom: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: "Unbounded", sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0.02em; }
.sun {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3b0, var(--amber) 55%, var(--orange));
  box-shadow: 0 0 22px 4px rgba(255, 183, 3, 0.6);
}
.hero h1 { font-family: "Unbounded", sans-serif; font-weight: 700; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.15; margin: 22px 0 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--amber), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; padding-bottom: 40px; }
.content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 22px;
}
.panel h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }

/* ---------- Controls ---------- */
.controls { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 26px; }
.group { display: flex; flex-direction: column; gap: 16px; }
.group h2 { display: flex; align-items: center; gap: 10px; }
.group h2 i { font-style: normal; font-family: "Unbounded", sans-serif; font-size: 0.7rem; color: #1a1200; background: var(--amber); padding: 4px 8px; border-radius: 8px; }
.controls label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

.field { display: flex; align-items: center; margin-top: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 12px; transition: border-color 0.2s; }
.field:focus-within { border-color: var(--amber); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 700 1.05rem "Manrope", sans-serif; padding: 12px 14px; }
.field span { padding-right: 14px; color: var(--amber); font-weight: 700; }

select {
  width: 100%; margin-top: 8px; padding: 12px 14px; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 12px;
  font: 600 0.9rem "Manrope", sans-serif; outline: 0; cursor: pointer;
}
select:focus { border-color: var(--amber); }
select option { background: #151b33; color: var(--text); }

.val { float: right; color: var(--amber); font-size: 1rem; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin-top: 16px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); outline: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 14px rgba(255, 183, 3, 0.7); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--amber); cursor: pointer; }

.switch { display: flex !important; gap: 12px; align-items: center; cursor: pointer; color: var(--text) !important; }
.switch small { display: block; color: var(--muted); font-weight: 500; margin-top: 2px; }
.switch input { display: none; }
.track { width: 44px; height: 24px; flex-shrink: 0; border-radius: 24px; background: rgba(255, 255, 255, 0.14); position: relative; transition: background 0.25s; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.25s; }
.switch input:checked + .track { background: var(--amber); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ---------- Map ---------- */
.panel-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 0.82rem; }
#map { height: 360px; border-radius: 14px; border: 1px solid var(--border); z-index: 0; }
.coords { margin-top: 12px; font-size: 0.88rem; color: var(--muted); }
.coords b { color: var(--text); font-variant-numeric: tabular-nums; }
.pin { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, var(--amber) 55%, var(--orange)); box-shadow: 0 0 0 6px rgba(255, 183, 3, 0.25), 0 0 24px 6px rgba(255, 183, 3, 0.6); }
.leaflet-container { background: #10162b; font-family: "Manrope", sans-serif; }
.leaflet-control-attribution { background: rgba(11, 16, 32, 0.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--amber) !important; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 14px; }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s, border-color 0.2s;
}
.kpi:hover { transform: translateY(-3px); border-color: rgba(255, 183, 3, 0.5); }
.kpi span { font-size: 0.78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi b { font-family: "Unbounded", sans-serif; font-size: 1.15rem; font-weight: 500; white-space: nowrap; }
.kpi.accent { background: linear-gradient(135deg, var(--amber), var(--orange)); border: 0; color: #1a1200; }
.kpi.accent span { color: rgba(26, 18, 0, 0.7); }
.kpi.accent b { font-size: 1.7rem; font-weight: 700; }

/* ---------- Charts & cards ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart { height: 330px; }
.info-card { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.row span { color: var(--muted); font-size: 0.9rem; }
.row b { font-family: "Unbounded", sans-serif; font-size: 1rem; font-weight: 500; color: var(--amber); text-align: right; }
.eco .row b { color: var(--green); }
.note { margin: 8px 0 0; font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.note.warn { color: #ffd166; }

footer { padding-top: 10px; padding-bottom: 40px; color: var(--muted); font-size: 0.82rem; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .controls { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi.accent { grid-column: span 2; }
}
@media (max-width: 720px) {
  .hero, .layout, footer { padding-left: 16px; padding-right: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
}
