:root {
  --bg: #07111f;
  --panel: rgba(8, 22, 38, .92);
  --panel-soft: rgba(17, 40, 64, .78);
  --line: rgba(148, 184, 216, .18);
  --text: #f4f8fc;
  --muted: #9db1c4;
  --blue: #2f8cff;
  --cyan: #36d5e7;
  --green: #35d08b;
  --amber: #ffb44c;
  --red: #ff646d;
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar {
  position: fixed; inset: 0 0 auto 0; height: 68px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5, 14, 25, .97), rgba(5, 14, 25, .88));
  backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.brand-wrap, .top-actions { display: flex; align-items: center; gap: 12px; }
.back-button, .brand-mark, .top-button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.055);
  text-decoration: none;
}
.back-button { width: 38px; height: 38px; border-radius: 12px; text-decoration: none; }
.back-button:hover, .top-button:hover { background: rgba(47, 140, 255, .18); border-color: rgba(47, 140, 255, .45); }
.dashboard-link { border-color: rgba(54,213,231,.34); background: rgba(54,213,231,.08); }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; color: var(--cyan); background: linear-gradient(145deg, rgba(47,140,255,.2), rgba(54,213,231,.08)); }
.brand-wrap strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand-wrap span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.live-status { display: inline-flex; align-items: center; gap: 7px; color: #cbeada; font-size: 12px; }
.live-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(53,208,139,.12); }
.top-button { gap: 8px; min-height: 38px; border-radius: 11px; padding: 0 13px; cursor: pointer; }
.workspace { position: fixed; inset: 68px 0 0; }
#map { position: absolute; inset: 0; background: #091827; }
.control-panel {
  position: absolute; z-index: 10; top: 18px; left: 18px; bottom: 18px; width: 340px;
  overflow: auto; padding: 18px; border: 1px solid rgba(148,184,216,.2); border-radius: 20px;
  background: var(--panel); backdrop-filter: blur(22px); box-shadow: var(--shadow);
  scrollbar-width: thin; scrollbar-color: rgba(148,184,216,.28) transparent;
}
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eyebrow { display: block; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.panel-heading h1 { margin: 5px 0 0; font-size: 22px; line-height: 1.15; }
.mode-badge { min-width: 42px; padding: 6px 9px; border: 1px solid rgba(54,213,231,.35); border-radius: 999px; color: var(--cyan); background: rgba(54,213,231,.1); text-align: center; font-size: 11px; font-weight: 800; }
.field-label { display: block; margin: 0 0 7px; color: #c5d4e1; font-size: 11px; font-weight: 700; }
.select-shell, .search-shell { position: relative; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.055); }
.select-shell > i, .search-shell > i { position: absolute; left: 12px; color: var(--cyan); font-size: 12px; pointer-events: none; }
.select-shell select, .search-shell input { width: 100%; min-height: 43px; border: 0; outline: 0; color: var(--text); background: transparent; }
.select-shell select { padding: 0 36px 0 34px; appearance: none; cursor: pointer; }
.select-shell select option { color: #0b1a2b; background: white; }
.iksi-card { display: grid; grid-template-columns: 86px 1fr; gap: 13px; margin-top: 14px; padding: 13px; border: 1px solid rgba(47,140,255,.25); border-radius: 15px; background: linear-gradient(135deg, rgba(47,140,255,.16), rgba(54,213,231,.055)); }
.iksi-score-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--line); }
.iksi-score-wrap span { color: var(--muted); font-size: 10px; }
.iksi-score-wrap strong { margin-top: 2px; font-size: 29px; line-height: 1; }
.iksi-detail { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.iksi-detail small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.status-pill { width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-pill.good { color: #a7f2ce; background: rgba(53,208,139,.15); }
.status-pill.warn { color: #ffd496; background: rgba(255,180,76,.15); }
.status-pill.bad { color: #ffb0b5; background: rgba(255,100,109,.15); }
.status-pill.neutral { color: #c3d2de; background: rgba(157,177,196,.14); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.stat-grid article { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.04); }
.stat-grid span, .stat-grid small { display: block; color: var(--muted); font-size: 9px; }
.stat-grid strong { display: block; margin: 3px 0 2px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.panel-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.section-heading strong, .section-title, .legend > strong { font-size: 12px; }
.section-heading button { border: 0; color: var(--cyan); background: transparent; font-size: 10px; cursor: pointer; }
.switch-row { display: flex; position: relative; align-items: center; justify-content: space-between; min-height: 36px; color: #d5e0e9; font-size: 11px; cursor: pointer; }
.switch-row span { display: flex; align-items: center; gap: 9px; }
.switch-row span > i { width: 16px; text-align: center; }
.channel-icon { color: #48b6ff; } .building-icon { color: #ffb44c; } .area-icon { color: #49d2a3; } .terrain-icon { color: #bc8dff; } .label-icon { color: #e9f0f6; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 35px; height: 20px; border-radius: 999px; background: rgba(157,177,196,.25); transition: .2s ease; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; transition: .2s ease; }
.switch-row input:checked + .switch { background: var(--blue); }
.switch-row input:checked + .switch::after { transform: translateX(15px); }
.view-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }
.view-buttons button { display: grid; place-items: center; gap: 5px; min-height: 48px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 10px; cursor: pointer; }
.view-buttons button.active { color: white; border-color: rgba(47,140,255,.65); background: rgba(47,140,255,.18); }
.search-shell input { padding: 0 42px 0 34px; }
.search-shell button { position: absolute; right: 5px; width: 32px; height: 32px; border: 0; border-radius: 9px; color: white; background: var(--blue); cursor: pointer; }
.search-results { max-height: 185px; overflow: auto; margin-top: 7px; border: 1px solid var(--line); border-radius: 11px; background: #0b1b2d; }
.search-result { display: block; width: 100%; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: rgba(47,140,255,.14); }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 11px; }
.search-result small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.legend > strong { grid-column: 1 / -1; color: var(--text); }
.legend div { display: flex; align-items: center; gap: 7px; }
.legend-line { width: 24px; height: 3px; border-radius: 99px; }
.legend-line.primary { background: #ff5f6d; }.legend-line.secondary { background: #31c77f; }.legend-line.tertiary { background: #ffb44c; }
.legend-node { width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: #2f8cff; box-shadow: 0 0 0 3px rgba(47,140,255,.22); }
.map-hint { position: absolute; z-index: 8; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; color: #c9d8e4; background: rgba(7,17,31,.84); backdrop-filter: blur(14px); font-size: 11px; box-shadow: 0 12px 28px rgba(0,0,0,.24); }
.loading-overlay { position: absolute; z-index: 15; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(4, 13, 23, .78); backdrop-filter: blur(8px); transition: opacity .25s ease, visibility .25s ease; }
.loading-overlay.hidden { opacity: 0; visibility: hidden; }
.loader { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; transform: translate(-50%, 18px); max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; color: white; background: rgba(9,24,40,.96); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: .22s ease; font-size: 12px; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.maplibregl-ctrl-group { overflow: hidden; border: 1px solid rgba(148,184,216,.25) !important; border-radius: 12px !important; background: rgba(7,17,31,.88) !important; box-shadow: 0 10px 30px rgba(0,0,0,.2) !important; }
.maplibregl-ctrl-group button { background-color: transparent !important; }
.maplibregl-ctrl-group button + button { border-top-color: rgba(148,184,216,.18) !important; }
.maplibregl-ctrl-icon { filter: invert(1); opacity: .86; }
.maplibregl-ctrl-bottom-left { left: 366px; }
.maplibregl-ctrl-attrib { color: #688097; background: rgba(7,17,31,.65) !important; }
.maplibregl-ctrl-attrib a { color: #8ba8bf; }
.satria-popup .maplibregl-popup-content { width: 300px; max-width: calc(100vw - 32px); padding: 0; overflow: hidden; border: 1px solid rgba(148,184,216,.25); border-radius: 16px; color: #eaf2f8; background: #0b1b2d; box-shadow: 0 22px 50px rgba(0,0,0,.38); }
.satria-popup .maplibregl-popup-tip { border-top-color: #0b1b2d; border-bottom-color: #0b1b2d; }
.satria-popup .maplibregl-popup-close-button { z-index: 2; right: 5px; top: 3px; width: 30px; height: 30px; color: white; font-size: 20px; }
.popup-head { padding: 15px 42px 12px 15px; background: linear-gradient(135deg, rgba(47,140,255,.25), rgba(54,213,231,.08)); }
.popup-head span { display: block; color: #80ddec; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.popup-head strong { display: block; margin-top: 4px; font-size: 16px; line-height: 1.3; }
.popup-body { padding: 13px 15px 15px; }
.popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.popup-item { padding: 8px; border: 1px solid rgba(148,184,216,.14); border-radius: 9px; background: rgba(255,255,255,.035); }
.popup-item span, .popup-coordinate { display: block; color: #91a9bc; font-size: 9px; }
.popup-item strong { display: block; margin-top: 3px; overflow-wrap: anywhere; color: #f4f8fc; font-size: 11px; }
.popup-coordinate { margin-top: 10px; }
.popup-actions { display: flex; gap: 7px; margin-top: 11px; }
.popup-actions a { flex: 1; padding: 8px; border: 1px solid rgba(47,140,255,.35); border-radius: 9px; color: white; background: rgba(47,140,255,.14); text-align: center; text-decoration: none; font-size: 10px; }
.popup-actions a:hover { background: rgba(47,140,255,.28); }
@media (max-width: 780px) {
  .topbar { height: 60px; padding: 0 11px; }
  .brand-wrap span, .live-status, .top-button span { display: none; }
  .workspace { inset-top: 60px; top: 60px; }
  .top-button { width: 38px; padding: 0; }
  .control-panel { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; max-height: 47vh; border-radius: 17px; padding: 14px; }
  .panel-heading h1 { font-size: 18px; }
  .map-hint { display: none; }
  .maplibregl-ctrl-bottom-left { left: 0; bottom: 48vh; }
  .maplibregl-ctrl-top-right { top: 8px; right: 4px; }
}

.thematic-select{margin-bottom:2px}.dashboard-link{padding:0 13px}.legend-line.good{background:#35d08b}.legend-line.light{background:#ffcf5c}.legend-line.medium{background:#ff9255}.legend-line.heavy{background:#ff646d}.legend-line.unknown{background:#7890a5}


/* SATRIA V18.1: layout peta 3D responsif dan panel ringkas */
.maplibregl-map { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.maplibregl-canvas-container, .maplibregl-canvas { position: absolute; inset: 0; }
.maplibregl-canvas-container { width: 100%; height: 100%; }

.control-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100dvh - 104px);
  transition: width .24s ease, transform .24s ease, opacity .2s ease;
}
.panel-heading { flex: 0 0 auto; margin-bottom: 12px; }
.panel-heading-actions { display: flex; align-items: center; gap: 7px; }
.panel-content { min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 3px; scrollbar-width: thin; scrollbar-color: rgba(148,184,216,.28) transparent; }
.collapse-panel-btn, .expand-panel-btn {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.06); cursor: pointer;
}
.collapse-panel-btn { width: 30px; height: 30px; border-radius: 9px; }
.collapse-panel-btn:hover, .expand-panel-btn:hover { border-color: rgba(47,140,255,.55); background: rgba(47,140,255,.18); }
.expand-panel-btn {
  position: absolute; z-index: 11; top: 18px; left: 18px; display: none; width: 44px; height: 44px;
  align-items: center; justify-content: center; border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.workspace.panel-collapsed .control-panel { transform: translateX(calc(-100% - 28px)); opacity: 0; pointer-events: none; }
.workspace.panel-collapsed .expand-panel-btn { display: inline-flex; }
.workspace.panel-collapsed .maplibregl-ctrl-bottom-left { left: 0; }
.control-panel::after { content: ''; position: absolute; inset: auto 18px 0; height: 22px; pointer-events: none; background: linear-gradient(transparent, rgba(8,22,38,.96)); }
.panel-content { padding-bottom: 18px; }

/* Menjaga area peta dominan pada laptop dengan tinggi viewport pendek. */
@media (max-height: 720px) and (min-width: 781px) {
  .control-panel { top: 12px; bottom: 12px; width: 320px; padding: 14px; border-radius: 17px; }
  .panel-heading h1 { font-size: 18px; }
  .panel-heading { margin-bottom: 9px; }
  .iksi-card { margin-top: 10px; padding: 10px; }
  .iksi-score-wrap strong { font-size: 24px; }
  .stat-grid article { padding: 8px; }
  .stat-grid strong { font-size: 15px; }
  .panel-section { margin-top: 10px; padding-top: 10px; }
  .switch-row { min-height: 30px; }
  .view-buttons button { min-height: 42px; }
  .legend { margin-top: 10px; padding-top: 10px; }
  .maplibregl-ctrl-bottom-left { left: 344px; }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .top-actions .live-status, .top-button span { display: none; }
  .top-button { width: 38px; padding: 0; }
}

@media (max-width: 780px) {
  .control-panel { display: flex; max-height: 46dvh; overflow: hidden; }
  .panel-content { overflow-y: auto; }
  .collapse-panel-btn { display: none; }
  .expand-panel-btn { display: none !important; }
}

/* SATRIA V22.1 - polygon luas baku, fungsional, dan potensial */
.area-polygon-summary{margin:14px 0 2px;padding:13px;border:1px solid rgba(148,184,216,.18);border-radius:15px;background:rgba(255,255,255,.045)}
.area-polygon-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.area-polygon-heading>div{min-width:0}.area-polygon-heading strong{display:block;margin-top:4px;color:#f4f8fc;font-size:11px;line-height:1.35}.area-polygon-heading small{max-width:150px;color:#9db1c4;font-size:8px;line-height:1.45;text-align:right}
.area-polygon-grid{display:grid;grid-template-columns:1fr;gap:7px}
.area-polygon-grid article{position:relative;min-width:0;padding:10px 10px 9px 13px;border:1px solid rgba(148,184,216,.15);border-radius:11px;background:rgba(255,255,255,.035);overflow:hidden}
.area-polygon-grid article::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:#7890a5}
.area-polygon-grid article.baku::before{background:#1f9d75}.area-polygon-grid article.fungsional::before{background:#1677e8}.area-polygon-grid article.potensial::before{background:#f59e0b}
.area-polygon-grid span,.area-polygon-grid strong,.area-polygon-grid small{display:block}.area-polygon-grid span{color:#a9bed1;font-size:8px;font-weight:750}.area-polygon-grid strong{margin:3px 0 2px;color:#fff;font-size:13px}.area-polygon-grid small{color:#839db3;font-size:7px;line-height:1.35}
.area-polygon-summary.empty .area-polygon-grid{opacity:.58}
.area-layer-group{display:grid;margin:1px 0 4px 13px;padding-left:10px;border-left:1px solid rgba(148,184,216,.2)}
.switch-row.area-child{min-height:31px;font-size:10px}.switch-row.area-child.baku span>i{color:#1f9d75}.switch-row.area-child.fungsional span>i{color:#3e91ef}.switch-row.area-child.potensial span>i{color:#f59e0b}.switch-row input:disabled+.switch{opacity:.35}.switch-row:has(input:disabled){opacity:.5;cursor:not-allowed}
.area-popup-head.baku{background:linear-gradient(135deg,#11684d,#1f9d75)!important}.area-popup-head.fungsional{background:linear-gradient(135deg,#0755b2,#1677e8)!important}.area-popup-head.potensial{background:linear-gradient(135deg,#a76605,#f59e0b)!important}.popup-item.popup-wide{grid-column:1/-1}
@media(max-width:780px){.area-polygon-summary{padding:10px}.area-polygon-heading{display:block}.area-polygon-heading small{display:block;max-width:none;margin-top:5px;text-align:left}.area-polygon-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.area-polygon-grid article{padding:9px 7px 8px 10px}.area-polygon-grid strong{font-size:11px}.area-polygon-grid small{font-size:6.5px}}
@media(max-width:520px){.area-polygon-grid{grid-template-columns:1fr}.area-layer-group{margin-left:8px}}
