@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #050811;
  color: #f1f5f9;
  overflow: hidden;
  user-select: none;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* PERBAIKAN KANVAS v5.1: Pastikan SVG & Layer Tidak Pernah Memotong Garis Jalur di Koordinat Mana Pun! */
#links-svg {
  overflow: visible !important;
}

#regions-layer,
#badges-layer,
#nodes-layer {
  overflow: visible !important;
}

/* Kunci Kursor Normal di dalam Panel Form & Modal */
.inspector-panel,
.inspector-panel *,
.modal-backdrop,
.modal-backdrop * {
  cursor: default;
}

.inspector-panel input,
.inspector-panel textarea {
  cursor: text !important;
  user-select: text !important;
}

.inspector-panel button,
.inspector-panel select,
.modal-backdrop button,
.modal-backdrop select {
  cursor: pointer !important;
}

@keyframes flowAnimation {
  from { stroke-dashoffset: 32; }
  to { stroke-dashoffset: 0; }
}

.link-up-base {
  stroke: #059669;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  opacity: 0.72;
}

.link-up-flow {
  stroke: #34d399;
  stroke-width: 2.7;
  stroke-dasharray: 4, 12;
  animation: flowAnimation 0.85s linear infinite;
  fill: none;
  stroke-linecap: round;
}

@keyframes blinkRedAlert {
  0%, 100% {
    stroke: #ef4444;
    stroke-width: 4.2;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.95));
  }
  50% {
    stroke: #7f1d1d;
    stroke-width: 2.5;
    opacity: 0.25;
    filter: none;
  }
}

.link-down-solid-blink {
  animation: blinkRedAlert 0.8s ease-in-out infinite;
  fill: none;
  stroke-linecap: round;
}

.link-hitbox {
  stroke: transparent;
  stroke-width: 18;
  fill: none;
  cursor: pointer !important;
  pointer-events: stroke;
}
.link-hitbox:hover {
  stroke: rgba(56, 189, 248, 0.25);
}

.enterprise-canvas-bg {
  background-color: #050811;
  background-image:
    radial-gradient(rgba(56, 189, 248, 0.12) 1px, transparent 1px),
    linear-gradient(to right, rgba(30, 41, 59, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 41, 59, 0.18) 1px, transparent 1px);
  background-size: 24px 24px, 96px 96px, 96px 96px;
}

@keyframes focusPulse {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.85); opacity: 0; }
}
.focus-highlight-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 3px solid #38bdf8;
  border-radius: 9999px;
  pointer-events: none;
  animation: focusPulse 1.1s ease-out infinite;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 9999px; }


/* 3 Standar Garis Jalur Backup (Standby Putih, Failover Hijau Flow, Backup Down Merah) */
.backup-standby-white {
  stroke: #e2e8f0;
  stroke-width: 2.2;
  stroke-dasharray: 6, 6;
  fill: none;
  opacity: 0.78;
}

.backup-active-green-flow {
  stroke: #34d399;
  stroke-width: 3.2;
  stroke-dasharray: 7, 6;
  animation: flowAnimation 0.75s linear infinite;
  fill: none;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.75));
}

@keyframes backupDownPulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.3; }
}
.backup-down-red {
  stroke: #f87171;
  stroke-width: 2.5;
  stroke-dasharray: 6, 6;
  fill: none;
  animation: backupDownPulse 1.2s infinite;
}


/* PERBAIKAN #3: Layer Jalur Paling Atas (Top-Layer Path Elevation) Saat Perangkat Diklik */
#highlight-links-svg,
#highlight-badges-layer {
  overflow: visible !important;
  pointer-events: none !important;
}

.link-highlighted-halo {
  stroke: rgba(56, 189, 248, 0.38);
  stroke-width: 9;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.85));
}

.link-highlighted-core {
  stroke: #38bdf8;
  stroke-width: 3.4;
  stroke-dasharray: 6, 10;
  animation: flowAnimation 0.65s linear infinite;
  fill: none;
  stroke-linecap: round;
}

.link-dimmed {
  opacity: 0.65 !important;
  transition: opacity 0.2s ease;
}


/* TURBO v5.5: Akselerasi Hardware GPU & Optimasi Layer Kanvas */
#viewport {
  will-change: transform;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.node-card-fast {
   contain: layout style;
  will-change: left, top;
}

/* Matikan transisi CSS saat sedang di-drag agar tidak ada efek karet/delay */
.is-dragging-active * {
  transition: none !important;
}


/* v6.3 Smart NOC Cockpit: Micro-LED Matrix pada Kapsul ODP */
.odp-led-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  display: inline-block;
  cursor: pointer !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.odp-led-dot:hover {
  transform: scale(1.65);
  z-index: 50;
}
.led-online {
  background-color: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.7);
}
.led-warn {
  background-color: #eab308;
  box-shadow: 0 0 5px rgba(234, 179, 8, 0.8);
}
.led-pwrdown {
  background-color: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.9);
}
.led-los {
  background-color: #ef4444;
  box-shadow: 0 0 7px rgba(239, 68, 68, 1);
  animation: backupDownPulse 0.75s infinite;
}
.led-isolir {
  background-color: #a855f7;
}


/* v6.4 Sorotan Titik LED saat Pelanggan di dalam Kapsul ODP sedang Diklik / Diinspeksi */
@keyframes selectedLedPulse {
  0%, 100% {
    transform: scale(1.75);
    box-shadow: 0 0 0 2px #ffffff, 0 0 12px #38bdf8;
  }
  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 1px #38bdf8, 0 0 6px #38bdf8;
  }
}
.led-selected-active {
  animation: selectedLedPulse 0.9s infinite !important;
  z-index: 60 !important;
}


/* v7.2 Smart Responsive Layout & Custom Thin Scrollbar untuk Header/Sub-Header/Modal */
.no-scrollbar::-webkit-scrollbar {
  height: 3px;
  width: 3px;
}
.no-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
}

/* Responsif untuk Modal di Layar Laptop Kecil, Tablet, dan Smartphone */
@media (max-width: 1024px) {
  .modal-backdrop > div {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    padding: 14px !important;
  }
  #info-panel {
    width: 340px !important;
    right: 8px !important;
  }
}

@media (max-width: 640px) {
  #info-panel {
    width: calc(100vw - 16px) !important;
    left: 8px !important;
    right: 8px !important;
    top: auto !important;
    bottom: 36px !important;
    max-height: 68vh !important;
  }
}


/* ==========================================================================
   v7.4 MOBILE GPU ANTI-FLICKER & NATIVE MOBILE APP UI (< 768px)
   ========================================================================== */

/* Cegah browser HP menggeser kerangka halaman atau melakukan pull-to-refresh */
html, body {
  overscroll-behavior: none !important;
  touch-action: manipulation;
}

#canvas-container {
  touch-action: none !important;
  -webkit-user-select: none;
  user-select: none;
}

/* Pastikan SVG Layer tidak mengalami GPU Texture Eviction saat Zoom-In di Android Chrome */
#viewport {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#svg-layer, #highlight-svg-layer {
  will-change: auto !important;
  transform: translateZ(0);
  shape-rendering: geometricPrecision;
}

/* Khusus Layar Smartphone & Tablet Portrait (< 768px) */
@media (max-width: 768px) {
  /* 1. Matikan animasi dash infinite pada ratusan garis cabang di HP agar GPU tidak drop/berkedip saat zoom! */
  #svg-layer .link-flow {
    animation: none !important;
    stroke-dasharray: none !important;
    stroke-width: 2.2px !important;
  }

  /* Tetap nyalakan garis fokus biru & garis merah DOWN dengan kontras tinggi di HP */
  #highlight-svg-layer path {
    stroke-width: 3.8px !important;
  }

  /* 2. Ringankan beban GPU Mobile: kurangi blur berat & shadow berlapis pada ratusan kartu node */
  .node-card, .region-box {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65) !important;
  }

  /* 3. Sembunyikan Header Desktop yang panjang & tampilkan Mobile App HUD + Bottom Nav */
  .desktop-only-header {
    display: none !important;
  }
  .mobile-only-ui {
    display: flex !important;
  }

  /* 4. Panel Inspector Kanan berubah menjadi Mobile Bottom-Sheet yang rapi dari bawah layar */
  #info-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 56px !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 64vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    z-index: 48 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.85) !important;
  }

  /* 5. Drawer Kiri (List Node & Log Insiden) menyesuaikan layar HP */
  #tree-list-drawer, #incident-drawer {
    bottom: 56px !important;
  }
}

@media (min-width: 769px) {
  .mobile-only-ui {
    display: none !important;
  }
}


/* ==========================================================================
   v7.5 MOBILE ERGONOMIC OVERHAUL (HANYA AKTIF DI HP < 768px, DESKTOP UTUH)
   ========================================================================== */

/* 1. PERBAIKAN MUTLAK BUG MENU TIDAK BISA DITUTUP */
.hidden,
.mobile-only-ui.hidden,
#mobile-menu-sheet.hidden,
#mobile-search-bar-wrap.hidden,
#mob-fab-los-btn.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-only-ui:not(.hidden) {
    display: flex !important;
  }

  /* 2. SEMUA MODAL MENU DI HP MENJADI FULL-SCREEN SHEET YANG NYAMAN DI-SCROLL UTUH */
  .modal-backdrop:not(.hidden) {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-backdrop > div {
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100dvh - 56px) !important;
    max-height: calc(100dvh - 56px) !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 12px 12px 28px 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Sticky Header pada setiap modal di HP agar tombol ✕ Tutup selalu mudah dijangkau */
  .modal-backdrop > div > div:first-child {
    position: sticky !important;
    top: -12px !important;
    background: rgba(15, 23, 42, 0.97) !important;
    backdrop-filter: blur(8px) !important;
    z-index: 30 !important;
    padding: 10px 4px 10px 4px !important;
    margin-bottom: 10px !important;
    border-bottom: 1px solid #1e293b !important;
  }

  /* Perbesar tombol Tutup (✕) di semua modal pada layar HP */
  .modal-backdrop > div > div:first-child button {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    background: #1e293b !important;
    color: #f8fafc !important;
    flex-shrink: 0 !important;
  }

  /* 3. KARTU TARGET DNS (GAMBAR 2) MENJADI GRID 2x2 KOMPAK DI HP (TIDAK MEMAKAN LAYAR) */
  #sla-target-cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 8px 0 !important;
  }

  #sla-target-cards > div {
    padding: 8px !important;
  }

  /* Kartu Ringkasan Omzet Billing & Buku Kas menjadi Horizontal Swipeable Cards di HP */
  #billing-owner-summary-cards,
  #erp-cashbook-cards {
    display: flex !important;
    overflow-x: auto !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
    scroll-snap-type: x mandatory;
  }

  #billing-owner-summary-cards > div,
  #erp-cashbook-cards > div {
    min-width: 220px !important;
    flex-shrink: 0 !important;
    scroll-snap-align: start;
    padding: 10px !important;
  }

  /* 4. TOMBOL TAB & TOOLBAR TIDAK BOLEH TERLIPAT VERTIKAL -> JADIKAN SWIPEABLE PILLS 1 BARIS */
  #modal-sla-rto .border-b.pb-2\.5,
  #modal-billing-manager .border-b.pb-2,
  #modal-flagship-erp .border-b.py-2\.5 {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #modal-sla-rto .border-b.pb-2\.5 > div,
  #modal-billing-manager .border-b.pb-2 > div:first-child,
  #modal-flagship-erp .border-b.py-2\.5 > div:first-child {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch;
  }

  #modal-sla-rto button,
  #modal-billing-manager button,
  #modal-flagship-erp button,
  #modal-ai-noc button {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Input cari di dalam modal Billing memenuhi lebar layar HP */
  #modal-billing-manager input[placeholder*="Cari"] {
    width: 100% !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }

  /* 5. FORM GRID 12-KOLOM (SPK, KAS, TARGET DNS, SETTINGS) OTOMATIS MENJADI 1-2 KOLOM RAPI DI HP */
  #pane-erp-tab-TICKETS .grid-cols-12,
  #pane-erp-tab-CASHBOOK .grid-cols-12,
  #sla-config-targets-list .grid-cols-12 {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #pane-erp-tab-TICKETS .grid-cols-12 > div,
  #pane-erp-tab-CASHBOOK .grid-cols-12 > *,
  #sla-config-targets-list .grid-cols-12 > * {
    width: 100% !important;
  }

  /* Kotak Info Rekening & Broadcast WA di Billing ditumpuk rapi di HP */
  #modal-billing-manager .bg-slate-950.flex.items-center.justify-between,
  #modal-ai-noc .bg-slate-950.flex.items-center.justify-between,
  #modal-unmapped-onu .bg-slate-950.flex.items-center.justify-between,
  #pane-erp-tab-SECURITY .bg-slate-950.flex.items-center.justify-between {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #modal-billing-manager .bg-slate-950.flex.items-center.justify-between button,
  #modal-ai-noc .bg-slate-950.flex.items-center.justify-between button {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px !important;
  }

  /* 6. PEMBEBASAN TINGGI TABEL DI DALAM MODAL HP (AGAR TIDAK PERNAH TERJEPIT 0px LAGI!) */
  .modal-backdrop .max-h-72,
  .modal-backdrop .max-h-64,
  .modal-backdrop .max-h-56,
  .modal-backdrop .max-h-80 {
    max-height: none !important;
    min-height: 280px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  /* 7. TRANSFORMASI TABEL BILLING, SPK & UNMAPPED MENJADI MOBILE TOUCH CARDS YANG ENAK DIOPERASIKAN */
  #billing-table-body tr,
  #erp-tickets-tbody tr,
  #unmapped-table-body tr {
    display: flex !important;
    flex-direction: column !important;
    background: #090f1d !important;
    border: 1px solid #1e293b !important;
    border-radius: 14px !important;
    margin: 8px 6px !important;
    padding: 10px !important;
    gap: 6px !important;
  }

  #modal-billing-manager thead,
  #pane-erp-tab-TICKETS thead,
  #modal-unmapped-onu thead {
    display: none !important;
  }

  #billing-table-body td,
  #erp-tickets-tbody td,
  #unmapped-table-body td {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 3px 0 !important;
    border: none !important;
    width: 100% !important;
    text-align: left !important;
  }

  /* Besarkan tombol aksi di dalam kartu pelanggan pada layar HP agar nyaman ditekan jempol */
  #billing-table-body td:last-child > div,
  #erp-tickets-tbody td:last-child > div {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 4px !important;
    padding-top: 8px !important;
    border-top: 1px solid #1e293b !important;
  }

  #billing-table-body td:last-child button,
  #erp-tickets-tbody td:last-child button,
  #unmapped-table-body td:last-child button {
    padding: 8px 6px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* Input Simulator Chat AI di bawah Modal AI disusun nyaman untuk jempol HP */
  #modal-ai-noc > div:last-child {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #modal-ai-noc #ai-sim-role-phone {
    width: 100% !important;
  }
  #modal-ai-noc #ai-sim-input {
    width: 100% !important;
    flex: none !important;
    padding: 10px !important;
    font-size: 13px !important;
  }
}


/* ==========================================================================
   v7.8 MOBILE PRO: SEMANTIC ZOOM, DRAWER FIX, FIELD LIST & QUICK ACTIONS
   ========================================================================== */

/* 1. SEMANTIC ZOOM LEVEL-OF-DETAIL (OTOMATIS SAAT ZOOM OUT JAUH) */
/* Saat skala zoom < 0.55: Sembunyikan label Mbps pada garis kabel agar tidak menutupi kartu! */
#viewport.semantic-zoom-far .link-label-group,
#viewport.semantic-zoom-far .cable-spec-badge,
#viewport.semantic-zoom-far svg text {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Saat skala zoom < 0.42 (Overview / Fit Layar di HP):
   Sembunyikan sub-detail kecil pada kartu ONU & pertegas judul ODP/Zona agar tetap terbaca jelas! */
#viewport.semantic-zoom-overview .node-card[data-node-type="ONT"] > div:not(:first-child) {
  display: none !important;
}
#viewport.semantic-zoom-overview .node-card[data-node-type="ONT"] {
  padding: 4px 6px !important;
  min-height: 28px !important;
}
#viewport.semantic-zoom-overview .node-card[data-node-type="ODP"] {
  transform: scale(1.18);
  transform-origin: center center;
  z-index: 25 !important;
  border-width: 2px !important;
}
#viewport.semantic-zoom-overview .region-box > div:first-child {
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
}

/* Indikator kartu sedang dalam mode Geser Jari (Touch Drag Node) */
.node-card.touch-dragging-node {
  outline: 3px dashed #38bdf8 !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.75) !important;
  z-index: 99 !important;
}

@media (max-width: 768px) {
  /* 2. PERBAIKI LEBAR DRAWER KIRI (LIST NODE & LOG INSIDEN) AGAR TIDAK MELEBIHI LAYAR HP */
  #tree-list-drawer,
  #incident-drawer {
    width: 92vw !important;
    max-width: 360px !important;
    top: 76px !important;
    bottom: 56px !important;
    z-index: 49 !important;
    border-radius: 0 16px 16px 0 !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.85) !important;
  }

  /* 3. SEMBUNYIKAN TOMBOL MELAYANG (FAB) SAAT ADA PANEL / MODAL / FIELD LIST YANG TERBUKA */
  body.mobile-overlay-active #mob-fab-container {
    display: none !important;
  }

  /* 4. PEGANGAN SWIPE-DOWN PADA PANEL DETAIL BAWAH (#info-panel) */
  #info-panel::before {
    content: "";
    display: block;
    width: 44px;
    height: 5px;
    background: #475569;
    border-radius: 9999px;
    margin: 2px auto 8px auto;
  }
}


/* ==========================================================================
   v7.9 PWA MENU VISIBILITY & ZERO-FLICKER SVG ENGINE (ANDROID / IOS PWA)
   ========================================================================== */

/* Di Monitor PC/Laptop (> 768px): Sembunyikan bar navigasi khusus HP */
@media (min-width: 769px) {
  .mobile-persistent-bar {
    display: none !important;
  }
}

/* Di Layar HP & Mode PWA Fullscreen (<= 768px): Tampilkan Bar Atas & Navigasi Bawah 100%! */
@media (max-width: 768px) {
  .mobile-persistent-bar {
    display: flex !important;
  }

  /* Safe-area untuk mode PWA Fullscreen agar tidak tertutup jam/status bar atas & garis navigasi bawah HP */
  #mobile-top-hud {
    padding-top: env(safe-area-inset-top, 0px) !important;
  }

  #mobile-bottom-nav {
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }

  /* Sembunyikan FAB melayang hanya saat menu/modal sedang terbuka */
  body.mobile-overlay-active #mob-fab-container {
    display: none !important;
  }

  /* ========================================================================
     FIX GARIS HILANG / BERKEDIP SAAT ZOOM-OUT DI HP (GPU TILE EVICTION FIX)
     ======================================================================== */
  /* 1. Jangan membuat sub-layer 3D terpisah pada SVG di dalam #viewport agar tidak di-cull oleh GPU Android saat zoom! */
  #viewport {
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    perspective: none !important;
  }

  #svg-layer,
  #highlight-svg-layer {
    transform: none !important;
    -webkit-transform: none !important;
    will-change: auto !important;
    filter: none !important;
    -webkit-filter: none !important;
    shape-rendering: optimizeSpeed !important;
  }

  /* 2. Matikan semua animasi gerak dash, drop-shadow filter, & garis putus-putus pada seluruh path SVG di HP */
  #svg-layer path,
  #svg-layer line,
  #highlight-svg-layer path {
    animation: none !important;
    -webkit-animation: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    transition: none !important;
  }

  /* Ubah garis hijau aktif menjadi garis solid tegas (bukan titik-titik) di HP agar bebas efek berkedip moire saat zoom-out */
  #svg-layer path:not([stroke="#94a3b8"]):not([stroke="#64748b"]) {
    stroke-dasharray: none !important;
    stroke-width: 2.6px !important;
  }
}


/* ==========================================================================
   v8.0 DEDICATED MOBILE CORE APP UI (<= 768px) — DESKTOP TETAP 100% KANVAS
   ========================================================================== */

@media (min-width: 769px) {
  #mobile-core-app-shell,
  #mobile-quick-edit-modal,
  #mobile-top-hud,
  #mobile-bottom-nav,
  #mob-fab-container,
  #mobile-field-list-view {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* Sembunyikan elemen versi lama & kanvas berat di layar HP agar 100% ringan */
  #mobile-top-hud,
  #mob-fab-container,
  #mobile-field-list-view,
  #mobile-menu-sheet,
  #mob-quick-action-sheet,
  #canvas-container {
    display: none !important;
  }

  /* Tampilkan Dedicated Mobile Core App Shell di layar HP */
  #mobile-core-app-shell {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    background: #020617 !important;
    z-index: 35 !important;
    overflow: hidden !important;
  }

  /* Perbaiki Bottom Navigation Bar agar 100% HORIZONTAL (Grid 5 Kolom Merata) */
  #mobile-bottom-nav {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: center !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: calc(60px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) 6px !important;
    background: rgba(2, 6, 23, 0.98) !important;
    border-top: 1px solid #1e293b !important;
    z-index: 45 !important;
  }

  /* Jika layar Login masih terbuka, sembunyikan App Shell & Bottom Nav */
  body.login-screen-open #mobile-core-app-shell,
  body.login-screen-open #mobile-bottom-nav {
    display: none !important;
  }
}


/* ==========================================================================
   v8.3 LOGIN FORM PERFECT CENTER (MOBILE & DESKTOP) + PHOTO BADGE
   ========================================================================== */

#login-overlay:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.96) 0%, rgba(2, 6, 23, 0.99) 100%) !important;
  z-index: 9999 !important;
  box-sizing: border-box !important;
}

#login-overlay > div {
  width: 100% !important;
  max-width: 390px !important;
  height: auto !important;
  max-height: 92dvh !important;
  margin: auto !important;
  padding: 24px 20px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* Lencana kecil penanda kartu di kanvas Desktop sudah memiliki Foto Rumah/ODP */
.desktop-node-photo-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(147, 51, 234, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.6);
  color: #e9d5ff;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.desktop-node-photo-pill:hover {
  background: rgba(147, 51, 234, 0.6);
  color: #ffffff;
}
