/* Planologic Market Research — memakai token "Column" dari variables.css */
:root {
  --font-ui: 'Inter', var(--font-suisseintl);
  --font-mono: 'JetBrains Mono', var(--font-sfmono);
  --topbar-h: 60px;
  --ink: var(--color-indigo-navy);
  --text: var(--color-slate-ink);
  --line: var(--color-silver-lining);
  --danger: #c2410c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--color-cloud-canvas); color: var(--text);
  font: 400 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 600; }
h1 { font-size: 28px; line-height: 1.1; letter-spacing: -0.28px; }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -0.2px; }
h3 { font-size: 14px; font-weight: 600; }
a { color: var(--ink); }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); font-feature-settings: 'cv11'; }
.muted { color: var(--color-steel); }
.spacer { flex: 1; }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-steel); }

/* ------------------------------------------------------------ Topbar */
.topbar {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 24px; padding: 0 20px;
  background: var(--color-pure-white); border-bottom: 1px solid var(--line); position: relative; z-index: 1200;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-mark { width: 10px; height: 10px; border-radius: 2px; background: var(--ink); align-self: center; }
.brand-name { font-weight: 600; font-size: 16px; color: var(--ink); letter-spacing: -0.2px; }
.brand-sub { font-size: 13px; color: var(--color-steel); }
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 400;
  border: 1px solid transparent;
}
.nav a:hover { background: var(--color-cloud-canvas); }
.nav a.active { color: var(--ink); font-weight: 500; border-color: var(--line); background: var(--color-cloud-canvas); }
.topbar-spacer { flex: 1; }
.tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-seafoam-600); display: inline-block; }

/* ----------------------------------------------------------- Tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 500 14px/1 var(--font-ui); padding: 11px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-subtle); }
.btn.primary:hover { background: #1b2670; }
.btn.outline { background: var(--color-pure-white); color: var(--ink); border-color: var(--ink); }
.btn.outline:hover { background: var(--color-cloud-canvas); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--color-cloud-canvas); }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: #fdf0e9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .seg-btn:focus-visible, .tab:focus-visible, .chip:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, tr:focus-visible { outline: 2px solid var(--color-seafoam-700); outline-offset: 2px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; flex: none;
}
.icon-btn.sm { width: 26px; height: 26px; font-size: 16px; }
.icon-btn:hover { background: var(--color-cloud-canvas); border-color: var(--line); }

.card { background: var(--color-pure-white); border-radius: 8px; box-shadow: var(--shadow-sm); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;
  color: var(--ink); background: color-mix(in srgb, var(--c, #a9acb6) 14%, white); border: 1px solid color-mix(in srgb, var(--c, #a9acb6) 35%, white);
  white-space: nowrap;
}
.badge .dot { background: var(--c, #a9acb6); }

/* ------------------------------------------------------------- Form */
input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 400 14px/1.4 var(--font-ui); color: var(--ink); background: var(--color-pure-white);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-width: 0;
}
input::placeholder, textarea::placeholder { color: var(--color-fog); }
input:hover, select:hover, textarea:hover { border-color: var(--color-mist); }
input[readonly] { background: var(--color-cloud-canvas); }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 500; color: var(--color-slate-ink); }
.hint { font-size: 12px; color: var(--color-steel); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.link-btn { border: 0; background: none; padding: 0; font: 500 12px/1.4 var(--font-ui); color: var(--color-seafoam-700); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.with-btn { display: flex; gap: 8px; align-items: stretch; }
.with-btn .btn { flex: none; }
.with-btn input, .with-btn select { flex: 1; min-width: 0; width: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

/* -------------------------------------------------- Segmented / chip */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--color-cloud-canvas); border: 1px solid var(--line); border-radius: 8px; }
.seg.card { background: var(--color-pure-white); }
.seg-btn {
  font: 500 13px/1 var(--font-ui); padding: 8px 12px; border-radius: 6px; border: 0; background: transparent; color: var(--text); cursor: pointer; white-space: nowrap;
}
.seg-btn:hover { background: var(--color-cloud-canvas); }
.seg-btn.active { background: var(--ink); color: #fff; }
.seg-sep { width: 1px; background: var(--line); margin: 4px 4px; }
.chip {
  font: 500 13px/1 var(--font-ui); padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255,255,255,.92); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm);
}
.chip:hover { background: #fff; border-color: var(--color-mist); }

/* ------------------------------------------------------------- Peta */
.map-wrap { flex: 1; position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #e8eaee; }
.map-top { position: absolute; z-index: 1000; top: 12px; left: 60px; right: 12px; display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.search-box { position: relative; width: 300px; }
.search-box input { border: 0; padding: 11px 14px; background: transparent; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: 8px; box-shadow: var(--shadow-md); border: 1px solid var(--line); overflow: hidden; }
.result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: #fff; text-align: left; cursor: pointer; font: inherit; }
.result:hover { background: var(--color-cloud-canvas); }
.result-main { display: flex; flex-direction: column; min-width: 0; }
.result-main strong { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main small { color: var(--color-steel); font-size: 12px; }
.result-empty { padding: 12px; color: var(--color-steel); }
.chips { display: flex; gap: 8px; }
#basebar { margin-left: auto; }
.legend { position: absolute; z-index: 1000; left: 12px; bottom: 28px; padding: 10px; min-width: 210px; display: flex; flex-direction: column; gap: 2px; }
.legend-title { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--color-steel); padding: 2px 6px 4px; }
.legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.legend-item:hover { background: var(--color-cloud-canvas); }
.legend-item .count { margin-left: auto; color: var(--color-seafoam-700); font-size: 12px; }
.legend-item.off { opacity: .4; text-decoration: line-through; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.legend-sum { border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 2px; font-size: 12px; color: var(--color-steel); }
.legend-sum .mono { color: var(--color-seafoam-700); font-weight: 500; }
.imginfo { position: absolute; z-index: 1000; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 8px 14px; font-size: 13px; color: var(--ink); max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-tip { font-family: var(--font-ui); font-size: 12px; border-radius: 6px; border: 0; box-shadow: var(--shadow-md); color: var(--ink); }
.leaflet-container { font-family: var(--font-ui); }
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow-sm) !important; border-radius: 8px !important; overflow: hidden; }
.leaflet-bar a { color: var(--ink) !important; }
.button-container .leaflet-buttons-control-button { border-radius: 0; }

/* ----------------------------------------------------------- Drawer */
.drawer {
  position: fixed; top: var(--topbar-h); right: 0; bottom: 0; width: min(460px, 100vw); z-index: 1100;
  background: var(--color-pure-white); box-shadow: var(--shadow-md), -1px 0 0 var(--line);
  display: flex; flex-direction: column; transform: translateX(104%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { transform: none; }
.drawer-loading { padding: 32px; color: var(--color-steel); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; }
.drawer-title h2 { margin: 2px 0 2px; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tab { font: 500 14px/1 var(--font-ui); padding: 12px; border: 0; background: transparent; color: var(--color-steel); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover:not(:disabled) { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab:disabled { opacity: .4; cursor: not-allowed; }
.drawer-body { flex: 1; overflow: auto; background: var(--color-cloud-canvas); }
.form { display: flex; flex-direction: column; min-height: 100%; }
.group { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--color-pure-white); border-bottom: 1px solid var(--line); }
.group:last-of-type { border-bottom: 0; }
.drawer-foot { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 20px; background: var(--color-pure-white); border-top: 1px solid var(--line); margin-top: auto; }
.coord-card { background: var(--color-cloud-canvas); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.coord-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.coord-row + .coord-row { border-top: 1px solid var(--line); padding-top: 10px; }
.coord-actions { display: flex; gap: 4px; }
.ro-label { font-size: 12px; color: var(--color-steel); }
.val { color: var(--color-seafoam-700); font-size: 13px; font-weight: 500; }

/* Keuangan */
.fin-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 4px; gap: 8px; }
.fin-list { padding: 12px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.fin-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fin-head { display: flex; justify-content: space-between; }
.fin-year { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--ink); }
.fin-year input { width: 96px; font-weight: 600; font-family: var(--font-mono); }
.fin-foot { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.derived { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: var(--color-cloud-canvas); border-radius: 8px; padding: 10px 12px; }
.metric { display: flex; flex-direction: column; min-width: 0; }
.files { display: flex; flex-direction: column; gap: 6px; }
.files-head { display: flex; align-items: center; justify-content: space-between; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.file-row a:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-weight: 500; }
.file-row a:first-child:hover { text-decoration: underline; }
.empty { padding: 24px; text-align: center; color: var(--color-steel); border: 1px dashed var(--color-mist); border-radius: 8px; background: var(--color-pure-white); }

/* Citra (tab) */
.citra { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.lead { margin: 0; color: var(--text); }
.tl-list { display: flex; flex-direction: column; gap: 6px; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border-radius: 8px; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.tl-year { color: var(--color-seafoam-700); font-weight: 500; width: 40px; }
.tl-note { color: var(--color-steel); font-size: 13px; flex-basis: 100%; padding-left: 52px; margin-top: -6px; }

/* ------------------------------------------------------ Modal citra */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(1, 24, 33, .55); display: flex; padding: 20px; backdrop-filter: blur(2px); }
.modal-panel { background: var(--color-pure-white); border-radius: 12px; box-shadow: var(--shadow-xl); width: 100%; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tl-info { margin: 0; padding: 8px 20px; font-size: 13px; color: var(--color-steel); background: var(--color-cloud-canvas); border-bottom: 1px solid var(--line); }
.tl-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(420px, 1fr); gap: 16px 12px; padding: 14px 20px 20px; overflow: auto; }
.tl-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tl-head strong { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; font-family: var(--font-mono); }
.tl-caps { text-align: right; min-width: 0; }
.tl-cap { font-size: 12px; color: var(--color-steel); }
.tl-cap2 { font-size: 12px; color: var(--color-seafoam-700); font-weight: 500; min-height: 18px; }
.tl-cap2.dup { color: var(--danger); }
.tl-mapwrap { position: relative; flex: 1; min-height: 240px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.tl-map { position: absolute; inset: 0; background: #1b2230; }
.tl-na { position: absolute; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: #fff; background: rgba(17,26,74,.78); font-size: 13px; }

/* ------------------------------------------------------------ Toast */
#toasts { position: fixed; z-index: 3000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow-sm-2); font-size: 14px; max-width: min(520px, 92vw); animation: pop .18s ease-out; }
.toast.error { background: #9a3412; }
.toast.warn { background: #854d0e; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* ----------------------------------------------------------- Tabel */
.table-page { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--color-pure-white); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 18px 20px; }
.stat-value { font-size: 28px; line-height: 1.1; letter-spacing: -0.28px; font-weight: 500; color: var(--color-seafoam-700); font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px; font-size: 14px; color: var(--color-steel); }
.table-card { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; min-width: 280px; }
.filter { width: auto; min-width: 140px; padding: 8px 10px; }
.filter.grow { flex: 1; min-width: 220px; }
.table-scroll { overflow: auto; max-height: calc(100vh - 360px); min-height: 240px; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fff; }
table.data th {
  position: sticky; top: 0; z-index: 2; background: var(--color-cloud-canvas); font-size: 12px; font-weight: 500; color: var(--color-steel);
  letter-spacing: .02em; user-select: none;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover, table.data th.sorted { color: var(--ink); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num { font-family: var(--font-mono); font-size: 13px; }
table.data .sticky { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
table.data th.sticky { z-index: 3; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: #f9f9fb; }
table.data td strong { font-weight: 500; color: var(--ink); }
.empty-cell { text-align: center !important; color: var(--color-steel); padding: 48px !important; }
.row-actions { display: flex; gap: 2px; }

/* ----------------------------------------------------- Responsif */
@media (max-width: 1200px) {
  .tl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .brand-sub, .tag { display: none; }
  .map-top { left: 56px; }
  .search-box { width: 100%; }
  #basebar { margin-left: 0; max-width: 100%; overflow-x: auto; }
  .legend { min-width: 0; max-width: 190px; padding: 8px; }
  .legend #legend-list { display: none; }
  .page-kawasan .legend #legend-list { display: block; max-height: 22vh; overflow: auto; }
  .legend .layer-toggles { margin-top: 0; border-top: 0; padding-top: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .table-page { padding: 16px; }
  .tl-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal-panel { border-radius: 0; }
  .grid-3, .derived { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------- Revisi: combobox, persen, lapisan */
.combo { position: relative; }
.combo-menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px;
}
.combo-title { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--color-steel); padding: 8px 8px 4px; }
.combo-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.combo-item:hover { background: var(--color-cloud-canvas); }
.combo-item small { color: var(--color-steel); font-size: 12px; white-space: nowrap; }
.combo-empty { padding: 10px 8px; color: var(--color-steel); font-size: 13px; }

.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pct-row { display: flex; align-items: center; gap: 10px; }
.pct-row input[type=number] { width: 84px; flex: none; }
.pct-unit { color: var(--color-steel); }
.range { flex: 1; min-width: 0; padding: 0; height: 24px; accent-color: var(--ink); border: 0; background: transparent; }
.wil { display: flex; flex-direction: column; gap: 14px; }
.wil-code { font-family: var(--font-mono); color: var(--color-seafoam-700); min-height: 18px; margin-top: -6px; }
.warn-text { color: #9a3412; }

.ent-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.ent-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13px; }
.ent-row:hover { background: var(--color-cloud-canvas); }

.layer-toggles { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.layer-check { padding: 4px 6px; font-size: 13px; }
.swatch.sw-batas { background: transparent; border: 2px dashed #0c6997; border-radius: 3px; }
.swatch.sw-kawasan { background: rgba(139, 92, 246, .25); border: 2px dashed #8b5cf6; border-radius: 3px; }
.swatch.sw-entitas { background: #ec652b; opacity: .6; }
.kawasan-label { background: rgba(255,255,255,.88); border: 0; border-radius: 4px; box-shadow: none; color: #5b21b6; font: 600 11px/1.2 var(--font-ui); padding: 2px 6px; }
.kawasan-label::before { display: none; }
.hide-kawasan-labels .kawasan-label { display: none; }
.page-kawasan .legend { max-width: 320px; max-height: 50vh; overflow: auto; }
.kawasan-item.on { background: var(--color-cloud-canvas); box-shadow: inset 0 0 0 1px var(--line); }
.k-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-empty { padding: 6px; font-size: 13px; }
.map-tip .muted { color: var(--color-steel); font-size: 11px; }

.swatch.sw-kec { background: transparent; border: 2px dashed #f2936b; border-radius: 3px; }
.swatch.sw-desa { background: linear-gradient(135deg, transparent 42%, #334155 42% 58%, transparent 58%); border: 1.5px solid #334155; border-radius: 3px; }
.loc-pop .leaflet-popup-content-wrapper { border-radius: 8px; box-shadow: var(--shadow-md); }
.loc-pop .leaflet-popup-content { margin: 12px 14px; font: 400 13px/1.6 var(--font-ui); color: var(--ink); }
.loc-title { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--color-steel); margin-bottom: 4px; }
.loc-pop .muted { color: var(--color-steel); }
.loc-kaw { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.loc-coord { margin-top: 6px; font-size: 11px; }

.swatch.sw-pelabuhan { background: rgba(8, 145, 178, .25); border: 2px dashed #0891b2; border-radius: 3px; }
.kawasan-label.pelabuhan { color: #0e7490; }

/* ------------------------------------------------ Logo, akun, login */
.brand { align-items: center; }
.brand-logo { height: 24px; width: auto; display: block; }
.brand-sub { padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); line-height: 20px; }
.user-slot { display: flex; align-items: center; }
.user-wrap { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); background: #fff; border-radius: 9999px; cursor: pointer; font: 500 13px/1 var(--font-ui); color: var(--ink); }
.user-btn:hover { background: var(--color-cloud-canvas); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 4px; z-index: 1300; }
.user-menu-head { display: flex; flex-direction: column; padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.user-menu-head .muted { font-size: 12px; }
.user-menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font: inherit; color: var(--ink); }
.user-menu-item:hover { background: var(--color-cloud-canvas); }
.form-error { background: #fdf0e9; color: #9a3412; border: 1px solid #f6cdb8; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.modal-panel.sm { max-width: 420px; margin: auto; height: fit-content; }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }

.page-login { align-items: center; justify-content: center; }
.login-wrap { width: 100%; padding: 24px 16px; display: flex; justify-content: center; }
.login-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow-xl); }
.login-logo { height: 38px; width: auto; align-self: flex-start; }
.login-card h1 { margin-bottom: 4px; }
.login-card .muted { margin: 0; font-size: 14px; }

/* ----------------------------------------------------- Jejak input */
.trace { gap: 8px; background: var(--color-cloud-canvas); border-bottom: 0; }
.trace-row { display: flex; flex-direction: column; font-size: 13px; }

/* ------------------------------------------------------------ Admin */
.stack { display: flex; flex-direction: column; gap: 20px; }
.section-title { font-size: 16px; margin-top: 4px; }
.tabs-seg { align-self: flex-start; }
.stat-sub { margin-top: 2px; font-size: 12px; color: var(--color-steel); }
.toolbar-card { display: flex; gap: 8px; align-items: center; padding: 12px 16px; flex-wrap: wrap; }
.table-scroll.short { max-height: none; min-height: 0; }
table.data.static tbody tr { cursor: default; }
.nowrap { white-space: nowrap; }
.plain-link { text-decoration: none; }
.plain-link:hover strong { text-decoration: underline; }
.more { padding: 12px; text-align: center; }
.abadge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; background: var(--color-cloud-canvas); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.abadge.ok { background: #e9f6f1; color: #11604f; border-color: #bfe6d8; }
.abadge.info { background: #eaf0fc; color: #1e3f8f; border-color: #c8d7f5; }
.abadge.warn { background: #fdf6dc; color: #7a5a00; border-color: #f0e0a0; }
.abadge.bad { background: #fdf0e9; color: #9a3412; border-color: #f6cdb8; }
.abadge.muted { color: var(--color-steel); }

.chart-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--color-steel); font: 400 11px var(--font-mono); }
.chart .peak { fill: var(--text); font: 500 11px var(--font-mono); }
.chart .bar { fill: var(--color-seafoam-700); transition: fill .1s; }
.chart .bar.on { fill: var(--color-seafoam-600); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible { stroke: var(--color-seafoam-700); stroke-width: 2; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-md); padding: 8px 12px; font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 5; }
.chart-tip strong { display: block; font-size: 14px; color: var(--ink); }
@media (max-width: 800px) { .brand-sub { display: none; } .user-name { display: none; } .user-btn { padding: 4px; } }
