/* USP Web — tema "Command Center" (gelap), diturunkan dari web MPT (mpt-v2/apps/web):
   palet, tipografi (Inter / Space Grotesk / IBM Plex Mono), login split-hero, sidebar
   bersection, kartu KPI bergaris atas. Satu tema saja (gelap), seperti MPT. */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #2E74D6; --primary-dark: #245FB0; --secondary: #4C8CE8;
  --success: #17A66B; --danger: #E5484D; --warning: #E0A02E; --info: #2BB0D6;
  --bg: #0A1322; --surface: #122238; --surface-2: #0E1A2D;
  --border: #233A5C; --line-soft: #1A2D48;
  --text: #EAF1FB; --text-light: #93A6C4; --text-faint: #5F7498;
  --brand-soft: rgba(46,116,214,.16);
  --radius: 12px; --radius-sm: 9px;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}
html, body { height: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; font-size: 14px; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--secondary); }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-light); }
.faint { color: var(--text-faint); }

/* ===== Login ===== */
#loginPage { display: flex; width: 100%; height: 100vh; background: var(--bg); }
.login-hero { flex: 1.15; position: relative; overflow: hidden; border-right: 1px solid var(--border);
  background: radial-gradient(120% 90% at 15% 10%, rgba(46,116,214,.16), transparent 55%), radial-gradient(100% 80% at 90% 90%, rgba(23,166,107,.12), transparent 55%), var(--surface-2);
  display: flex; flex-direction: column; justify-content: space-between; padding: 46px 52px; }
.hero-grid { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 70% at 30% 40%, #000, transparent 80%); mask-image: radial-gradient(80% 70% at 30% 40%, #000, transparent 80%); }
.hero-ring { position: absolute; left: -140px; top: 60px; width: 640px; height: 640px; border-radius: 50%; border: 1px solid var(--border); opacity: .6; }
.hero-ring.r2 { left: -40px; top: 160px; width: 440px; height: 440px; }
.hero-ring.r3 { left: 60px; top: 260px; width: 240px; height: 240px; }
.hero-sweep { position: absolute; width: 640px; height: 640px; left: -140px; top: 60px; border-radius: 50%; animation: ccspin 9s linear infinite;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(46,116,214,.20) 40deg, transparent 70deg);
  -webkit-mask: radial-gradient(circle, #000 0 62%, transparent 63%); mask: radial-gradient(circle, #000 0 62%, transparent 63%); }
@keyframes ccspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-sweep { animation: none; } }
.brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.brand img { height: 68px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .3px; }
.brand-sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 2px; text-transform: uppercase; }
.hero-copy { position: relative; z-index: 2; max-width: 460px; }
.hero-copy .eyebrow { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 2.5px; color: var(--secondary); text-transform: uppercase; margin-bottom: 14px; }
.hero-copy h1 { font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 1.08; letter-spacing: -.5px; }
.hero-copy p { color: var(--text-light); font-size: 15px; margin-top: 16px; line-height: 1.6; }
.login-panel { flex: .85; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 352px; }
.login-card h2 { font-family: var(--font-display); font-size: 23px; font-weight: 600; }
.login-card .lead { color: var(--text-light); font-size: 13.5px; margin: 6px 0 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-light); margin-bottom: 7px; letter-spacing: .2px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > i { position: absolute; left: 14px; color: var(--text-faint); font-size: 14px; }
.input-wrap input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 40px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-wrap .toggle-password { left: auto; right: 14px; cursor: pointer; background: none; border: 0; color: var(--text-faint); position: absolute; }
.btn-login { width: 100%; margin-top: 8px; padding: 13px; border: none; border-radius: var(--radius-sm); background: linear-gradient(180deg, var(--secondary), var(--primary)); color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px; box-shadow: 0 8px 22px -10px rgba(46,116,214,.7); }
.btn-login:hover { filter: brightness(1.07); }
.btn-login:disabled { opacity: .6; cursor: progress; }
.login-error { margin-top: 14px; color: var(--danger); font-size: 13px; min-height: 18px; }
@media (max-width: 900px) { .login-hero { display: none; } .login-panel { flex: 1; padding: 24px 16px; } }

/* ===== Shell ===== */
#appShell { display: flex; width: 100%; height: 100vh; }
.sidebar { width: 250px; background: linear-gradient(180deg, var(--surface-2), var(--bg)); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; transition: width .2s ease; overflow: hidden; }
.sidebar.collapsed { width: 64px; }
.sidebar-header { padding: 20px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; min-height: 76px; }
.sidebar-header img { height: 34px; width: auto; flex-shrink: 0; }
.sidebar-header .t { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.2; }
.sidebar-header .s { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); letter-spacing: 1.5px; text-transform: uppercase; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 20px 8px; }
.sidebar.collapsed .sidebar-header .txt, .sidebar.collapsed .menu-label, .sidebar.collapsed .sidebar-section, .sidebar.collapsed .sidebar-footer .txt { display: none; }
.sidebar-menu { list-style: none; padding: 10px 0; flex: 1; overflow-y: auto; }
.sidebar-section { padding: 14px 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-faint); font-family: var(--font-mono); }
.sidebar-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 18px; margin-right: 10px; color: var(--text-light); text-decoration: none; border-radius: 0 8px 8px 0; font-size: 13.5px; white-space: nowrap; position: relative; }
.sidebar-menu a i { width: 18px; text-align: center; color: var(--secondary); font-size: 15px; }
.sidebar-menu a:hover { background: rgba(46,116,214,.10); color: var(--text); }
.sidebar-menu a.active { background: rgba(46,116,214,.16); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.sidebar.collapsed .sidebar-menu a { justify-content: center; margin-right: 0; border-radius: 0; padding: 13px 0; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 7px; font-family: var(--font-mono); }
.sidebar.collapsed .nav-badge { position: absolute; top: 5px; right: 8px; margin: 0; }
.sidebar-footer { padding: 14px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-light); margin-bottom: 10px; overflow: hidden; }
.user-chip i { font-size: 18px; color: var(--secondary); }
.user-chip .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar.collapsed .user-chip { justify-content: center; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; }
.crumb { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 1px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-light); padding: 0 6px; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); display: inline-block; }
.conn-dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(23,166,107,.2); }
.conn-dot.off { background: var(--danger); box-shadow: 0 0 0 3px rgba(229,72,77,.2); }
.content { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .25s ease-in; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Komponen ===== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--secondary), var(--primary)); color: #fff; box-shadow: 0 6px 16px -9px rgba(46,116,214,.75); }
.btn-success { background: linear-gradient(180deg, #1FB979, var(--success)); color: #fff; }
.btn-danger { background: linear-gradient(180deg, #EC5A5F, var(--danger)); color: #fff; }
.btn-warning { background: linear-gradient(180deg, #EDB04A, var(--warning)); color: #111; }
.btn-ghost { background: var(--surface-2); color: var(--text-light); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); }
.btn-ghost.on { color: var(--text); border-color: var(--primary); background: var(--brand-soft); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 8px; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--text-light); padding: 7px 10px; }
.icon-btn:hover { color: var(--text); border-color: var(--primary); }

.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: 0 2px 14px -10px rgba(0,0,0,.6); }
.section-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--primary); }
.section-title .aside { margin-left: auto; font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--text-light); }

.grid { display: grid; gap: 16px; margin-bottom: 18px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--primary); }
.card.ok::before { background: var(--success); } .card.warn::before { background: var(--warning); }
.card.bad::before { background: var(--danger); } .card.info::before { background: var(--info); }
.card-title { font-size: 11px; color: var(--text-light); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.card-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card-sub { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }

.meter { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--success); transition: width .5s; }
.meter > span.mid { background: var(--warning); } .meter > span.high { background: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--surface-2); color: var(--text-light); padding: 10px 12px; text-align: left; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
tr:hover td { background: rgba(46,116,214,.04); }
td.empty { text-align: center; color: var(--text-light); padding: 26px; }
tr.clickable { cursor: pointer; }
tr.flash td { animation: rowflash 2.2s ease-out; }
@keyframes rowflash { from { background: rgba(46,116,214,.28); } to { background: transparent; } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-success { background: rgba(23,166,107,.15); color: #3DD598; }
.badge-danger { background: rgba(229,72,77,.15); color: #FF7A7E; }
.badge-warning { background: rgba(224,160,46,.15); color: #F2C063; }
.badge-info { background: rgba(43,176,214,.15); color: #6FD3EE; }
.badge-gray { background: rgba(147,166,196,.12); color: var(--text-light); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .fg { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.toolbar label { font-size: 11px; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; }
.toolbar .grow { flex: 1; }
.inp { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; outline: none; min-height: 36px; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--brand-soft); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 12.5px; color: var(--text-light); }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--border); display: flex; gap: 12px; font-size: 13px; background: rgba(43,176,214,.08); line-height: 1.5; }
.alert i { margin-top: 2px; color: var(--info); }
.alert.warn { background: rgba(224,160,46,.10); border-color: rgba(224,160,46,.35); } .alert.warn i { color: var(--warning); }
.alert.bad { background: rgba(229,72,77,.10); border-color: rgba(229,72,77,.4); } .alert.bad i { color: var(--danger); }

.svc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 12.5px; }
.svc .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); }

/* ===== Modal & toast ===== */
.modal { position: fixed; inset: 0; background: rgba(3,8,16,.65); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; box-shadow: 0 30px 80px -30px rgba(0,0,0,.85); }
.modal-content.wide { max-width: 1100px; }
.modal-header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.modal-header .x { margin-left: auto; background: none; border: 0; color: var(--text-light); font-size: 18px; cursor: pointer; }
.modal-body { padding: 18px 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-light); } .kv dd { word-break: break-word; }
pre.payload { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px; font-family: var(--font-mono); font-size: 11.5px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.snap { width: 100%; border-radius: 8px; background: #000; display: block; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px 14px; font-size: 13px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.9); cursor: pointer; animation: toastIn .25s ease-out; }
.toast.bad { border-left-color: var(--danger); } .toast.ok { border-left-color: var(--success); } .toast.warn { border-left-color: var(--warning); }
.toast b { display: block; margin-bottom: 3px; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Live view: pohon perangkat + satu layar ===== */
.lv-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 480px; }
.lv-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.lv-side .head { padding: 12px; border-bottom: 1px solid var(--border); }
.lv-side .head input { width: 100%; }
.lv-side .foot { padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-light); font-family: var(--font-mono); }
.cam-tree { overflow-y: auto; flex: 1; padding: 8px 6px 10px; font-size: 13px; }
.tr-org { padding: 8px 8px 6px; font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.tr-org i { color: var(--secondary); }
.tr-row { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; cursor: pointer; user-select: none; min-width: 0; }
.tr-row:hover { background: rgba(46,116,214,.09); }
.tr-children { padding-left: 16px; border-left: 1px solid var(--line-soft); margin-left: 13px; }
.tr-caret { width: 10px; color: var(--text-faint); font-size: 12px; text-align: center; flex-shrink: 0; }
.tr-ico { width: 15px; text-align: center; color: var(--secondary); flex-shrink: 0; font-size: 12.5px; }
.tr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-num { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.tr-tag { font-size: 10.5px; border: 1px solid rgba(229,72,77,.5); color: #FF7A7E; border-radius: 4px; padding: 0 5px; }
.tr-site .tr-name { color: var(--text); font-weight: 600; }
.tr-device { color: var(--text-light); }
.tr-device.off { color: #FF9A9D; }
.tr-device.off .tr-ico { color: #FF7A7E; }
.tr-device.pend { color: #F2C063; }
.tr-tag.pend { border-color: rgba(224,160,46,.5); color: #F2C063; }
.tr-channel { color: var(--text-light); padding-left: 10px; }
.tr-channel .tr-ico { color: var(--text-faint); }
.tr-channel.playing { background: rgba(46,116,214,.18); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.tr-channel.playing .tr-ico { color: var(--secondary); }
.tr-note { color: var(--text-faint); cursor: default; font-size: 12px; }
.tr-note:hover { background: none; }
.tree-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 16px; color: var(--text-light); font-size: 12.5px; }
.tree-empty i { font-size: 26px; color: var(--text-faint); }
.tree-empty b { color: var(--text); font-size: 13.5px; }
.st { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-faint); display: inline-block; }
.st.active { background: var(--success); } .st.offline, .st.error { background: var(--danger); } .st.pending { background: var(--warning); }
.lv-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.lv-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.lv-title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; }
.lv-title b { font-family: var(--font-display); font-size: 16px; }
.lv-stage { flex: 1; position: relative; background: #05090F; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 0; }
.lv-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.lv-stage .ph { color: var(--text-faint); font-size: 13px; text-align: center; padding: 16px; }
.lv-stage .ph i { display: block; font-size: 34px; margin-bottom: 12px; }
.lv-stage .spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 13px; background: rgba(0,0,0,.35); }
.lv-stage:fullscreen { border-radius: 0; border: 0; }

/* ===== Map ===== */
.map-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
#mapCanvas { height: calc(100vh - 200px); min-height: 460px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.leaflet-popup-content { margin: 12px 14px; font-size: 12.5px; }
.map-pin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.35); }
.map-pin.active { background: var(--success); } .map-pin.offline, .map-pin.error { background: var(--danger); } .map-pin.pending { background: var(--warning); }
.map-pin.gps { border-radius: 3px; }
.pos-list { max-height: calc(100vh - 290px); overflow-y: auto; }
.pos-item { display: flex; gap: 9px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 12.5px; }
.pos-item:hover { background: rgba(46,116,214,.06); }

/* ===== Analitik (Traffic Kendaraan, Human Analitik) ===== */
.an-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.an-side { margin: 0; position: sticky; top: 0; max-height: calc(100vh - 130px); overflow-y: auto; }
.an-side-title { font-size: 11px; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.an-pick { display: block; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text-light); padding: 8px 10px; font-size: 13px; cursor: pointer; margin-bottom: 6px; }
.an-pick:hover { color: var(--text); border-color: var(--primary); }
.an-pick.on { background: var(--brand-soft); border-color: var(--primary); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.an-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.an-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.an-presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.an-note { color: var(--text-light); font-size: 12.5px; line-height: 1.5; }
.an-empty { color: var(--text-light); font-size: 13px; }
.an-sub { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.an-link { background: none; border: 0; padding: 0; color: var(--secondary); cursor: pointer; font-weight: 600; }
.an-link:hover { text-decoration: underline; }
.an-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid var(--border); flex-shrink: 0; }
.an-feed-scroll { max-height: 480px; overflow-y: auto; }
.an-feed-scroll th { position: sticky; top: 0; z-index: 1; }
.an-map { height: 280px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.dim td { opacity: .55; }
.tc-cap { font-size: 11.5px; color: var(--text-light); margin-bottom: 6px; }
.tc-grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.tc-y { position: relative; font-size: 11.5px; color: var(--text-light); text-align: right; font-variant-numeric: tabular-nums; }
.tc-y span { position: absolute; right: 0; transform: translateY(-50%); }
.tc-plot { position: relative; }
.tc-plot svg { display: block; overflow: visible; }
.tc-dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.tc-dot.on { width: 10px; height: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.16); }
.tc-hit { position: absolute; top: 0; bottom: 0; cursor: crosshair; outline: none; }
.tc-hit:focus-visible { background: rgba(255,255,255,.05); }
.tc-tip { position: absolute; pointer-events: none; z-index: 2; white-space: nowrap; padding: 6px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,.35); font-size: 12.5px; }
.tc-axis { position: relative; height: 18px; margin-top: 4px; }
.tc-axis span { position: absolute; font-size: 11.5px; color: var(--text-light); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tc-status { min-height: 18px; margin-top: 8px; font-size: 12px; color: var(--text-faint); }
.dn { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dn-legend { display: grid; gap: 8px; min-width: 140px; flex: 1; }
.dn-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dn-row .l { flex: 1; color: var(--text-light); }
.dn-row .c { font-weight: 600; font-variant-numeric: tabular-nums; }
.dn-row .p { min-width: 42px; text-align: right; font-size: 11.5px; color: var(--text-faint); }
.cb { display: grid; grid-template-columns: minmax(0, 104px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.cb .l { color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb .t { height: 16px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.cb .t span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.cb .c { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hu-photos { display: flex; gap: 14px; align-items: flex-start; }
.hu-main { flex: 1; min-width: 0; min-height: 200px; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 8px; color: var(--text-light); padding: 0; }
.hu-main img { max-width: 100%; max-height: 60vh; border-radius: 8px; display: block; }
.hu-thumb { padding: 0; border: 2px solid var(--success); border-radius: 8px; background: none; cursor: pointer; width: 140px; flex-shrink: 0; }
.hu-thumb img { width: 100%; display: block; border-radius: 6px; }

@media (max-width: 1100px) {
  .an-layout { grid-template-columns: 1fr; }
  .an-side { position: static; max-height: 260px; }
  .lv-layout, .map-layout { grid-template-columns: 1fr; height: auto; }
  .lv-side { max-height: 340px; }
  .lv-stage { min-height: 56vw; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; z-index: 500; height: 100vh; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; width: 250px; }
  .sidebar.mobile-open { transform: none; }
  .sidebar.collapsed { width: 250px; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .clock { display: none; }
  .kv { grid-template-columns: 1fr; }
}
