:root {
  /* tema TERANG — palet AERONET (primary #013880 + gold #ffbd07) */
  --bg: #e3eaee;
  --panel: #ffffff;
  --panel-2: #f0f4f7;
  --line: #d0d9e0;
  --txt: #162030;
  --muted: #475569;
  --gold: #ffbd07;
  --navy: #013880;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --gray: #6b7280;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 22px;
  background: linear-gradient(90deg, #081c3f 0%, #013880 65%, #0157b4 100%);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
/* logo 38px — format TemanBelajar */
.brand-logo {
  width: 38px; height: 38px; border-radius: 8px; object-fit: contain;
  background: #fff; padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: opacity .2s, transform .2s;
}
.brand-logo:hover { opacity: .9; transform: scale(1.05); }
.brand h1 { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.brand h1 span { color: #ffb74d; }
.brand h1 a { color: inherit; text-decoration: none; }
.brand h1 a:hover { color: #fff; text-decoration: underline; }
.brand .sub { font-size: 11px; color: #bcd0f0; margin-top: 1px; }
.top-right { display: flex; align-items: center; gap: 18px; }

/* nav-link — format konsisten AERONET (adaptasi dark) */
.nav-link {
  color: #fff; text-decoration: none; font-size: 12.5px; font-weight: 700;
  letter-spacing: .3px; padding: 8px 16px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.3); transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.14); border-color: var(--gold); color: var(--gold); }

/* ---------- footer (format Tidal: gradient biru + border gold) ---------- */
.footer {
  background: linear-gradient(135deg, #013880 0%, #014a9e 55%, #0157b4 100%);
  color: #fff; text-align: center; padding: 18px 24px;
  font-size: 11.5px; border-top: 3px solid var(--gold);
}
.footer p { margin: 0; color: #fff; }
.footer .src { opacity: .85; margin-top: 4px; font-size: 10.5px; }
.footer code { background: rgba(255,255,255,.15); padding: 2px 6px; border-radius: 5px; font-size: 10.5px; }

/* ---------- about page (format AERONET, adaptasi dark) ---------- */
.about-wrap { max-width: 980px; margin: 0 auto; padding: 34px 24px 70px; }
.about-hero {
  background: linear-gradient(120deg, #04122e 0%, #0b1f4b 70%, #0148a8 100%);
  color: #fff; border-radius: 18px; padding: 34px 38px; margin-bottom: 26px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); position: relative; overflow: hidden;
}
.about-hero .kick { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.about-hero h2 { font-size: 30px; font-weight: 800; margin: 8px 0 10px; }
.about-hero p { color: #bcd0f0; font-size: 14px; max-width: 640px; line-height: 1.65; }
.about-hero .logo-big { position: absolute; right: -20px; top: -30px; font-size: 180px; opacity: .07; font-weight: 800; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.about-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 26px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.about-card.wide { grid-column: 1 / -1; }
.about-card h3 {
  display: flex; align-items: center; gap: 10px;
  color: var(--navy); font-size: 16px; font-weight: 800; margin-bottom: 14px;
}
.about-card h3 .ic {
  width: 30px; height: 30px; border-radius: 8px; background: var(--navy);
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.about-card p, .about-card li { font-size: 13px; line-height: 1.7; color: #3c465c; }
.about-card ul { padding-left: 20px; margin: 8px 0; }
.about-card b { color: #012a60; }
.about-card .muted { color: var(--muted); font-size: 12px; }
.about-card a { color: var(--navy); }
.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.spec { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.spec .k { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.spec .v { font-size: 14px; font-weight: 800; color: var(--navy); margin-top: 3px; }
.credit-box {
  background: #fdf8ea; border: 1px solid #f2e2b3; border-left: 4px solid var(--gold);
  border-radius: 10px; padding: 14px 16px; margin-top: 12px; font-size: 12.5px; line-height: 1.65; color: #6b5a20;
}
.credit-box code { background: #f5ecd0; padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.about-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font-weight: 700; font-size: 13px; color: var(--navy); text-decoration: none; }
.about-back:hover { color: var(--gold); }
.ok-tag, .warn-tag, .crit-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; }
.ok-tag { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.5); }
.warn-tag { background: rgba(234,179,8,.15); color: #a16207; border: 1px solid rgba(234,179,8,.5); }
.crit-tag { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.5); }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-hero { padding: 26px 22px; }
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .4px;
  color: var(--muted); background: var(--panel); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: blink 1.6s infinite; }
.pill.live .dot { background: var(--green); animation: none; }
.pill.err .dot { background: var(--red); animation: none; }
@keyframes blink { 50% { opacity: .25; } }

/* ---------- layout ---------- */
.wrap { max-width: 1500px; margin: 0 auto; padding: 16px 20px 24px; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 260px)); gap: 14px; margin-bottom: 16px; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px;
  border-top: 3px solid var(--muted);
}
.card.ok { border-top-color: var(--green); }
.card.warn { border-top-color: var(--yellow); }
.card.crit { border-top-color: var(--red); }
.card .k { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--muted); }
.card .v { font-size: 30px; font-weight: 800; margin: 4px 0 2px; }
.card .v.small { font-size: 18px; padding-top: 6px; }
.card .d { font-size: 11px; color: var(--muted); }

.grid-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px;
  align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.panel-head .hint { font-size: 10.5px; color: var(--muted); }

#map { height: 592px; background: #dfe6ec; z-index: 1; }

/* 🔒 badge kunci peta — muncul saat bandara dipilih (lihat app.js lockMap) */
.map-lock-badge {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 2000; pointer-events: none; display: none;
  background: rgba(15, 20, 38, .88); color: #ffbd07;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 189, 7, .4);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.map-lock-badge.show { display: block; }

/* ---------- sidebar ---------- */
.side-panel { display: flex; flex-direction: column; }
.side-empty {
  display: flex; flex-direction: column;
  max-height: 640px; overflow: hidden;
  padding: 0;
}
.list-head {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: var(--muted);
  text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.list-head span { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 11.5px; }
.airport-list { overflow-y: auto; flex: 1; }
.list-sec {
  position: sticky; top: 0; z-index: 2;
  padding: 7px 16px; font-size: 9.5px; font-weight: 800; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between;
}
.airport-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid rgba(0,0,0,.06);
  cursor: pointer; text-align: left;
}
.airport-item:hover { background: rgba(0,56,128,.05); }
.airport-item.active { background: rgba(0,56,128,.08); box-shadow: inset 2px 0 0 var(--gold); }
.list-empty { padding: 28px 20px; text-align: center; color: var(--muted, #8b949e); font-size: 12.5px; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.item-main { flex: 1; min-width: 0; }
.icao-line { display: flex; align-items: center; gap: 8px; }
.icao-line b { font-family: var(--mono); font-size: 12.5px; color: #0b1f4b; }
.icao-line .name { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-main .sub { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.side-content { flex: 1; overflow-y: auto; padding: 16px; }

.side-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.icao-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icao { font-family: var(--mono); font-size: 22px; font-weight: 800; color: #0b1f4b; }
.badge {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 999px;
}
.badge.GO { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.5); }
.badge.CAUTION { background: rgba(234,179,8,.15); color: #a16207; border: 1px solid rgba(234,179,8,.5); }
.badge.CRITICAL { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.5); }
.badge.NO_DATA { background: rgba(107,114,128,.15); color: var(--gray); border: 1px solid rgba(107,114,128,.5); }
.badge.cat { color: #0f4c81; border-color: rgba(15,76,129,.4); background: rgba(15,76,129,.08); }
.side-head h3 { font-size: 15px; font-weight: 700; margin-top: 6px; }
.munic { font-size: 11.5px; color: var(--muted); }
.close-btn {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.close-btn:hover { color: #fff; border-color: #3a4d80; }

.metar-box {
  background: #070d1c; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px;
}
.metar-label { font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 6px; }
.metar-box code {
  font-family: var(--mono); font-size: 11.8px; line-height: 1.55; color: #b9c8ea;
  word-break: break-all; white-space: pre-wrap;
}

.hud-row { display: flex; gap: 14px; margin-bottom: 14px; }
.hud-compass { position: relative; }
.hud-compass svg { display: block; }
.compass-label {
  position: absolute; left: 0; right: 0; bottom: 26px; text-align: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #0b1f4b;
}
.hud-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hud-grid > div {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px;
}
.hud-grid .k { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.hud-grid .v { font-family: var(--mono); font-size: 14.5px; font-weight: 700; margin-top: 2px; }

.acft-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.acft-row label { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.acft-row select {
  flex: 1; background: var(--panel-2); color: var(--txt); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
}

.runway-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.rt-head, .runway-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr .5fr;
  gap: 4px; padding: 8px 10px; font-size: 11px;
}
.rt-head { background: var(--panel-2); color: var(--muted); font-weight: 700; letter-spacing: .6px; }
.runway-row { border-top: 1px solid var(--line); font-family: var(--mono); align-items: center; }
.runway-row .ident { font-weight: 700; color: #fff; }
.runway-row.warn { background: rgba(239,68,68,.08); }
.runway-row .rec {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; color: #04140a; background: var(--green); font-weight: 800;
}
.runway-row .cw.exceed { color: var(--red); font-weight: 800; }
.runway-row .tw.exceed { color: var(--red); font-weight: 800; }

.warn-line { margin-top: 10px; font-size: 11.5px; color: var(--red); min-height: 15px; }

.fire-line { margin-top: 4px; font-size: 11.5px; color: #b45309; min-height: 15px; }

/* ---------- legend ---------- */
.legend-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding: 10px 4px; font-size: 11.5px; color: var(--txt);
}
.lg { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.lg.muted { color: var(--muted); font-weight: 400; font-size: 10.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.g { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.8); }
.dot.y { background: var(--yellow); box-shadow: 0 0 6px rgba(234,179,8,.8); }
.dot.r { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,.8); }
.dot.n { background: var(--gray); }
.dot.o { background: #f97316; box-shadow: 0 0 6px rgba(249,115,22,.8); }

/* ---------- bandara: pin teardrop + label ICAO (beda dgn titik api lingkaran) ---------- */
.apt-marker-wrap { background: transparent; border: none; }
.apt-marker {
  position: relative;
  width: 46px; height: 42px;
  display: flex; flex-direction: column; align-items: center;
}
.apt-pin {
  position: relative;
  width: 18px; height: 18px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--c, #22c55e);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.apt-pin::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
}
.apt-code {
  margin-top: 1px;
  font-size: 8.5px; font-weight: 700;
  color: #013880;
  text-shadow: 0 1px 2px #fff, 0 0 4px #fff;
  letter-spacing: .2px;
  white-space: nowrap;
}
/* legend: pin mini utk bandara */
.apt-lg {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--c, #22c55e);
  border: 1.5px solid #fff;
  vertical-align: middle;
}

/* ---------- leaflet light tweaks ---------- */
.leaflet-container { font-family: 'Plus Jakarta Sans', sans-serif; }
.leaflet-control-attribution { background: rgba(255,255,255,.85) !important; color: #5a6a7a !important; font-size: 9px !important; }
.leaflet-control-attribution a { color: #013880 !important; }
.leaflet-control-zoom a { background: #ffffff !important; color: #162030 !important; border-color: var(--line) !important; }
.leaflet-control-zoom a:hover { background: #f0f4f7 !important; }

/* marker pulse for critical */
@keyframes pulse { 0% { r: 9; opacity: .9; } 100% { r: 20; opacity: 0; } }

@media (max-width: 1100px) {
  .grid-main { grid-template-columns: 1fr; }
  #map { height: 440px; }
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* mobile: header lengkap seperti AERONET — topbar turun jadi kolom */
@media (max-width: 900px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  .top-right { flex-wrap: wrap; gap: 10px; width: 100%; }
  .brand { width: 100%; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .brand h1 { font-size: 17px; }
  .nav-link { padding: 7px 12px; font-size: 11.5px; }
}


/* ===== STICKY FOOTER (fix 2026-09-02) ===== */
body {
  display: flex;
  flex-direction: column;
}
main {
  flex: 1 0 auto;
}
