/* ===================================================================== */
/* LAJO — 6-THEME ENGINE DENGAN SENTUHAN 3D ELEGAN & ANTI-SCROLL         */
/* ===================================================================== */

:root, html[data-theme="light"] {
  --lj-bg: #e7edf4;
  --lj-bg-glow: radial-gradient(circle at 12% 0%, rgba(2, 132, 199, 0.08), transparent 45%);
  --lj-sidebar: #f8fafc;
  --lj-topbar: #ffffff;
  --lj-surface: #ffffff;
  --lj-surface-hi: #ffffff;
  --lj-surface-2: #f1f5f9;
  --lj-hover: #e8eef6;
  --lj-border: #cbd5e1;
  --lj-border-deep: #94a3b8;
  --lj-specular: rgba(255, 255, 255, 0.9);
  --lj-text: #0f172a;
  --lj-muted: #5b6b82;
  --lj-accent: #0284c7;
  --lj-accent-soft: rgba(2, 132, 199, 0.13);
  --lj-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -6px rgba(15, 23, 42, 0.14);
  --lj-shadow-hover: 0 4px 10px rgba(15, 23, 42, 0.1), 0 12px 24px -8px rgba(15, 23, 42, 0.18);
  --lj-inset-input: inset 0 1px 3px rgba(15, 23, 42, 0.09);
}

html[data-theme="dark"] {
  --lj-bg: #0b1220;
  --lj-bg-glow: radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.09), transparent 48%);
  --lj-sidebar: #111a2c;
  --lj-topbar: #131e32;
  --lj-surface: #1a2538;
  --lj-surface-hi: #212f46;
  --lj-surface-2: #121b2d;
  --lj-hover: #24334b;
  --lj-border: #2c3c55;
  --lj-border-deep: #0b111d;
  --lj-specular: rgba(255, 255, 255, 0.075);
  --lj-text: #f1f5f9;
  --lj-muted: #94a3b8;
  --lj-accent: #38bdf8;
  --lj-accent-soft: rgba(56, 189, 248, 0.16);
  --lj-shadow-card: 0 2px 4px rgba(0, 0, 0, 0.28), 0 10px 22px -10px rgba(0, 0, 0, 0.55);
  --lj-shadow-hover: 0 5px 12px rgba(0, 0, 0, 0.36), 0 16px 28px -10px rgba(0, 0, 0, 0.65);
  --lj-inset-input: inset 0 2px 4px rgba(0, 0, 0, 0.34);
}

html[data-theme="blue"] {
  --lj-bg: #081326;
  --lj-bg-glow: radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.12), transparent 50%);
  --lj-sidebar: #0d1c36;
  --lj-topbar: #102342;
  --lj-surface: #152b4f;
  --lj-surface-hi: #1b3661;
  --lj-surface-2: #0d1d38;
  --lj-hover: #1e3b69;
  --lj-border: #2a4c80;
  --lj-border-deep: #081326;
  --lj-specular: rgba(186, 230, 253, 0.1);
  --lj-text: #f0f6ff;
  --lj-muted: #9ebce3;
  --lj-accent: #38bdf8;
  --lj-accent-soft: rgba(56, 189, 248, 0.2);
  --lj-shadow-card: 0 2px 5px rgba(2, 8, 22, 0.35), 0 10px 24px -10px rgba(2, 8, 22, 0.62);
  --lj-shadow-hover: 0 6px 14px rgba(2, 8, 22, 0.42), 0 16px 30px -10px rgba(2, 8, 22, 0.72);
  --lj-inset-input: inset 0 2px 4px rgba(2, 8, 22, 0.4);
}

html[data-theme="green"] {
  --lj-bg: #091914;
  --lj-bg-glow: radial-gradient(circle at 18% 0%, rgba(52, 211, 153, 0.1), transparent 50%);
  --lj-sidebar: #0e241d;
  --lj-topbar: #122d25;
  --lj-surface: #18382e;
  --lj-surface-hi: #1f463a;
  --lj-surface-2: #0f251e;
  --lj-hover: #214c3f;
  --lj-border: #2e6655;
  --lj-border-deep: #071410;
  --lj-specular: rgba(167, 243, 208, 0.09);
  --lj-text: #ecfdf5;
  --lj-muted: #9bd0bf;
  --lj-accent: #34d399;
  --lj-accent-soft: rgba(52, 211, 153, 0.2);
  --lj-shadow-card: 0 2px 5px rgba(2, 16, 11, 0.35), 0 10px 24px -10px rgba(2, 16, 11, 0.6);
  --lj-shadow-hover: 0 6px 14px rgba(2, 16, 11, 0.42), 0 16px 30px -10px rgba(2, 16, 11, 0.7);
  --lj-inset-input: inset 0 2px 4px rgba(2, 16, 11, 0.38);
}

html[data-theme="pink"] {
  --lj-bg: #1a0d15;
  --lj-bg-glow: radial-gradient(circle at 18% 0%, rgba(244, 114, 182, 0.11), transparent 50%);
  --lj-sidebar: #25131f;
  --lj-topbar: #2c1725;
  --lj-surface: #361e2e;
  --lj-surface-hi: #432639;
  --lj-surface-2: #22111c;
  --lj-hover: #4a2a3f;
  --lj-border: #663b57;
  --lj-border-deep: #140910;
  --lj-specular: rgba(251, 207, 232, 0.1);
  --lj-text: #fdf2f8;
  --lj-muted: #dfb4cf;
  --lj-accent: #f472b6;
  --lj-accent-soft: rgba(244, 114, 182, 0.2);
  --lj-shadow-card: 0 2px 5px rgba(15, 4, 10, 0.35), 0 10px 24px -10px rgba(15, 4, 10, 0.6);
  --lj-shadow-hover: 0 6px 14px rgba(15, 4, 10, 0.44), 0 16px 30px -10px rgba(15, 4, 10, 0.72);
  --lj-inset-input: inset 0 2px 4px rgba(15, 4, 10, 0.38);
}

html[data-theme="purple"] {
  --lj-bg: #120e21;
  --lj-bg-glow: radial-gradient(circle at 18% 0%, rgba(167, 139, 250, 0.12), transparent 50%);
  --lj-sidebar: #1a1530;
  --lj-topbar: #211b3b;
  --lj-surface: #292247;
  --lj-surface-hi: #342b59;
  --lj-surface-2: #18132d;
  --lj-hover: #372e5e;
  --lj-border: #504385;
  --lj-border-deep: #0e0a1a;
  --lj-specular: rgba(221, 214, 254, 0.1);
  --lj-text: #f5f3ff;
  --lj-muted: #beb4e6;
  --lj-accent: #a78bfa;
  --lj-accent-soft: rgba(167, 139, 250, 0.22);
  --lj-shadow-card: 0 2px 5px rgba(8, 5, 20, 0.36), 0 10px 24px -10px rgba(8, 5, 20, 0.62);
  --lj-shadow-hover: 0 6px 14px rgba(8, 5, 20, 0.45), 0 16px 30px -10px rgba(8, 5, 20, 0.72);
  --lj-inset-input: inset 0 2px 4px rgba(8, 5, 20, 0.4);
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--lj-bg);
  background-image: var(--lj-bg-glow);
  background-attachment: fixed;
  color: var(--lj-text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* SIDEBAR & TOPBAR BERDIMENSI 3D HALUS */
#app-sidebar {
  background: linear-gradient(180deg, var(--lj-sidebar) 0%, var(--lj-surface-2) 100%);
  box-shadow: 4px 0 18px -6px rgba(0, 0, 0, 0.28);
}
#app-topbar {
  background: linear-gradient(180deg, var(--lj-topbar) 0%, var(--lj-sidebar) 100%);
  box-shadow: 0 3px 12px -4px rgba(0, 0, 0, 0.22), inset 0 -1px 0 var(--lj-specular);
}

/* EMBLEM LOGO LAJO 3D ELEGAN (EMAS & OBSIDIAN) */
.lj-brand-emblem {
  background: linear-gradient(145deg, #243045 0%, #0d1524 100%);
  border: 1px solid rgba(212, 160, 23, 0.52);
  box-shadow:
    inset 0 1px 1px rgba(255, 235, 168, 0.32),
    inset 0 -2px 4px rgba(0, 0, 0, 0.55),
    0 4px 12px -2px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(212, 160, 23, 0.14);
}
.lj-brand-emblem img {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.65));
}

/* KARTU 3D HALUS (SOFT BEVEL & DEPTH, TIDAK NORAK) */
.lj-card {
  background: linear-gradient(180deg, var(--lj-surface-hi) 0%, var(--lj-surface) 100%);
  border: 1px solid var(--lj-border);
  border-bottom-color: var(--lj-border-deep);
  box-shadow: var(--lj-shadow-card), inset 0 1px 0 var(--lj-specular);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lj-kpi {
  position: relative;
  overflow: hidden;
}
.lj-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--lj-shadow-hover), inset 0 1px 0 var(--lj-specular);
}

.lj-icon-3d {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.18),
    0 3px 8px -2px rgba(0, 0, 0, 0.25);
}

.lj-surface-2 {
  background-color: var(--lj-surface-2);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.lj-border { border-color: var(--lj-border); }
.lj-muted { color: var(--lj-muted); }
.lj-hover-bg:hover { background-color: var(--lj-hover); }

.lj-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lj-muted);
  margin-bottom: 4px;
}

/* INPUT & SELECT 3D CEKUNG (RECESSED DEPTH) */
.lj-input, .lj-select, .lj-textarea {
  width: 100%;
  background-color: var(--lj-surface-2);
  border: 1px solid var(--lj-border);
  color: var(--lj-text);
  border-radius: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-size: 0.84rem;
  outline: none;
  box-shadow: var(--lj-inset-input);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lj-input:focus, .lj-select:focus, .lj-textarea:focus {
  border-color: var(--lj-accent);
  box-shadow: var(--lj-inset-input), 0 0 0 2px var(--lj-accent-soft);
}

/* NAVIGASI SIDEBAR DENGAN KEDALAMAN 3D HALUS */
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--lj-muted);
  border: 1px solid transparent;
  transition: all 0.16s ease;
  text-align: left;
}
.nav-item:hover {
  background-color: var(--lj-hover);
  color: var(--lj-text);
  transform: translateX(1px);
}
.nav-item.active {
  background: linear-gradient(180deg, var(--lj-accent-soft) 0%, rgba(2, 132, 199, 0.08) 100%);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 1px 0 var(--lj-specular), 0 3px 10px -4px rgba(0, 0, 0, 0.35);
  color: var(--lj-accent);
  font-weight: 700;
}

/* TAB SUB-MENU 3D HALUS (WRAP, TANPA SCROLLBAR) */
.lj-tab-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.lj-tab {
  padding: 0.42rem 0.8rem;
  border-radius: 0.58rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--lj-muted);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.lj-tab:hover { background-color: var(--lj-hover); color: var(--lj-text); }
.lj-tab.active {
  background: linear-gradient(180deg, var(--lj-accent) 0%, var(--lj-accent) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -2px 0 rgba(0, 0, 0, 0.22), 0 4px 10px -3px rgba(0, 0, 0, 0.35);
}

/* TOMBOL 3D TAKTIL (HALUS & PROFESIONAL) */
.lj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.46rem 0.82rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 0 rgba(0, 0, 0, 0.22), 0 3px 7px -2px rgba(0, 0, 0, 0.28);
}
.lj-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -2px 0 rgba(0, 0, 0, 0.24), 0 5px 11px -3px rgba(0, 0, 0, 0.35);
}
.lj-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.25);
}
.lj-btn-primary {
  background: linear-gradient(180deg, var(--lj-accent) 0%, #0369a1 100%);
  color: #ffffff;
}
.lj-btn-emerald {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}
.lj-btn-danger {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}
.lj-btn-ghost {
  background: linear-gradient(180deg, var(--lj-surface-hi) 0%, var(--lj-surface-2) 100%);
  border: 1px solid var(--lj-border);
  color: var(--lj-text);
  box-shadow: inset 0 1px 0 var(--lj-specular), 0 2px 5px -2px rgba(0, 0, 0, 0.2);
}
.lj-btn-ghost:hover { background: var(--lj-hover); }

/* TABEL PADAT & RAPI — ANTI SCROLL HORIZONTAL */
.lj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: auto;
}
.lj-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lj-muted);
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--lj-border);
  background-color: var(--lj-surface-2);
  white-space: normal;
  line-height: 1.25;
}
.lj-table td {
  padding: 0.52rem 0.5rem;
  border-bottom: 1px solid var(--lj-border);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.lj-table tr:last-child td { border-bottom: 0; }
.lj-table tr:hover td { background-color: var(--lj-hover); }

/* WADAH TOMBOL AKSI TABEL — OTOMATIS BUNGKUS RAPI TANPA MELEBAR KE KANAN */
.lj-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
}

.lj-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.custom-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--lj-border); border-radius: 999px; }

/* HAK AKSES CHECKLIST RBAC */
body.perm-no-add .perm-add { display: none !important; }
body.perm-no-edit .perm-edit { display: none !important; }
body.perm-no-delete .perm-delete { display: none !important; }
body.perm-no-export .perm-export { display: none !important; }

/* NOC MAP & PIN LIVE ONU / VOUCHER */
#noc-map-canvas {
  width: 100%;
  height: calc(100vh - 205px);
  min-height: 480px;
  border-radius: 0.85rem;
  z-index: 1;
}
.noc-fullscreen #noc-map-canvas {
  height: calc(100vh - 135px) !important;
}
.noc-pin-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.noc-pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.noc-pin-online { background: #10b981; }
.noc-pin-offline { background: #ef4444; }
.noc-pin-isolated { background: #f59e0b; }
.noc-pin-standby { background: #38bdf8; }
.noc-pin-htb { background: #f97316; border-radius: 4px; }
.noc-pin-odp { background: #8b5cf6; border-radius: 4px; }
.noc-pin-pop { width: 20px; height: 20px; background: #0284c7; border-radius: 6px; }

.noc-vcr-badge {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 19px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  font-family: ui-monospace, monospace;
  color: #ffffff;
  background: #0284c7;
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.noc-vcr-mid { background: #d97706; }
.noc-vcr-high { background: #e11d48; animation: nocPulse 1.8s infinite; }
@keyframes nocPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0.7); }
  50% { box-shadow: 0 0 0 7px rgba(225,29,72,0); }
}

.leaflet-popup-content-wrapper {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155;
  border-radius: 12px !important;
}
.leaflet-popup-tip { background: #0f172a !important; }

/* CETAK VOUCHER & KWITANSI */
@media print {
  body > *:not(#print-area) { display: none !important; }
  #print-area {
    display: block !important;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .vc-grid-a4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
  }
  .vc-card {
    border: 1px dashed #334155;
    border-radius: 6px;
    padding: 7px;
    page-break-inside: avoid;
    break-inside: avoid;
    font-family: Arial, sans-serif;
    color: #000;
    background: #fff;
  }
  .vc-thermal {
    width: 56mm;
    margin: 0 auto 8px auto;
    border-bottom: 1px dashed #000;
    padding-bottom: 8px;
    page-break-inside: avoid;
  }
}
