@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

html {
  overflow-y: scroll;
}

:root {
  --primary: #4f46e5;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --p1-color: #0284c7;
  --p2-color: #8b5cf6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  width: 100%;
  min-height: 100vh;
}

.dashboard-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 20px 24px !important;
  margin: 0 !important;
}

/* NAVBAR TABS */
.navbar-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 24px;
  width: 100%;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.nav-tab-highlight.active {
  background: #059669;
}

.badge-tab-count {
  background: #ecfdf5;
  color: #059669;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.nav-tab.active .badge-tab-count {
  background: #ffffff;
  color: #059669;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* CARDS & STAT BOXES */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.exec-stat-grid,
.pm-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px;
}

.stat-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-sub);
  text-transform: uppercase;
}

.stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.stat-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-sub);
}

.stat-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sub);
  margin: 4px 0 0 0;
}

/* KOMPARASI CARDS */
.komparasi-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.p-card-p1 { border-top: 4px solid var(--p1-color); }
.p-card-p2 { border-top: 4px solid var(--p2-color); }

.p-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.p-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-title h4 { margin: 0; font-size: 1rem; font-weight: 800; }
.dot-p1 { width: 10px; height: 10px; background: var(--p1-color); border-radius: 50%; }
.dot-p2 { width: 10px; height: 10px; background: var(--p2-color); border-radius: 50%; }

.badge-p-count {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 800;
}
.p1-badge { background: #e0f2fe; color: #0369a1; }
.p2-badge { background: #f3e8ff; color: #6b21a8; }

.p-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.p-metric-box {
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}

.p-metric-label { font-size: 0.72rem; color: var(--text-sub); font-weight: 700; display: block; }
.p-metric-value { font-size: 1.25rem; font-weight: 800; display: block; }
.p-metric-sub { font-size: 0.7rem; color: var(--text-sub); }

.p-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
}

.p-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.p-info-item span { color: var(--text-sub); font-weight: 600; }
.p-info-item strong { font-weight: 800; color: var(--text-main); text-align: right; }

.charts-grid-exec {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-wrapper {
  position: relative;
  height: 260px;
  width: 100%;
}

/* PM BATCH CARDS */
.pm-batch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.badge-batch { padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 0.8rem; color: white; }

.pm-list-group { display: flex; flex-direction: column; gap: 12px; }
.pm-list-item { background: #f8fafc; padding: 12px 16px; border-radius: 10px; font-size: 0.82rem; }
.pm-list-item p { margin: 4px 0 0 0; color: var(--text-sub); }
.text-danger { color: #f43f5e !important; }
.text-success { color: #10b981 !important; }

/* TABEL UTAMA */
.table-card {
  padding: 20px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.table-toolbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 16px !important;
  gap: 16px !important;
  width: 100% !important;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  outline: none;
  background: #ffffff;
}

.search-box input:focus {
  border-color: #4f46e5;
}

.toolbar-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-left: auto !important;
}

.data-count-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.btn-csv {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-csv:hover {
  background: #059669;
  color: #ffffff;
}

.btn-add {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-add:hover {
  background: #4338ca;
}

/* Styling Tabel Supaya Rapi dan Tidak Bertumpuk */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.custom-table th {
  padding: 10px 12px;
  white-space: nowrap; /* Mencegah teks header bertumpuk/patah berlebihan */
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-sub, #64748b);
  border-bottom: 2px solid #e2e8f0;
}

.custom-table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Styling Tabel Supaya Rapi dan Tidak Bertumpuk */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.custom-table th {
  padding: 10px 12px;
  white-space: nowrap; /* Mencegah teks header bertumpuk/patah berlebihan */
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-sub, #64748b);
  border-bottom: 2px solid #e2e8f0;
}

.custom-table td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

/* Penyesuaian Lebar Spesifik Kolom */
.custom-table th:nth-child(1), .custom-table td:nth-child(1) { width: 40px; text-align: center; } /* NO */
.custom-table th:nth-child(2), .custom-table td:nth-child(2) { white-space: nowrap; min-width: 105px; } /* PERIODE */
.custom-table th:nth-child(3), .custom-table td:nth-child(3) { white-space: nowrap; min-width: 95px; } /* TANGGAL */
.custom-table th:nth-child(4), .custom-table td:nth-child(4) { min-width: 200px; max-width: 280px; word-break: break-word; } /* NAMA OLT */
.custom-table th:nth-child(5), .custom-table td:nth-child(5) { white-space: nowrap; min-width: 90px; } /* AREA */
.custom-table th:nth-child(6), .custom-table td:nth-child(6) { text-align: center; min-width: 95px; white-space: nowrap; } /* MTTR */
.custom-table th:nth-child(7), .custom-table td:nth-child(7) { text-align: center; min-width: 60px; white-space: nowrap; } /* TIKET */
.custom-table th:nth-child(8), .custom-table td:nth-child(8) { white-space: nowrap; min-width: 100px; } /* ID INCIDENT */
.custom-table th:nth-child(9), .custom-table td:nth-child(9) { text-align: center; white-space: nowrap; min-width: 100px; } /* KETERANGAN */
.custom-table th:nth-child(10), .custom-table td:nth-child(10) { text-align: center; white-space: nowrap; min-width: 70px; } /* KATEGORI */
.custom-table th:nth-child(11), .custom-table td:nth-child(11) { min-width: 180px; max-width: 260px; } /* PENYEBAB */
.custom-table th:nth-child(12), .custom-table td:nth-child(12) { text-align: center; white-space: nowrap; min-width: 75px; } /* AKSI */
.custom-table th:nth-child(13), .custom-table td:nth-child(13) { text-align: center; white-space: nowrap; min-width: 95px; } /* TARGET PM */

.badge-sheet {
  background: #f3e8ff;
  color: #6b21a8;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-block;
  white-space: nowrap;
}

.badge-status-done { background: #e0f2fe; color: #0369a1; }
.badge-status-prog { background: #fef3c7; color: #d97706; }
.badge-status-notyet { background: #ffe4e6; color: #e11d48; }

.badge-kategori {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-action-group {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.btn-act {
  border: none;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit { background: #e0e7ff; color: #3730a3; }
.btn-edit:hover { background: #3730a3; color: #ffffff; }

.btn-delete { background: #ffe4e6; color: #e11d48; }
.btn-delete:hover { background: #e11d48; color: #ffffff; }

/* MODAL STYLING */
.modal-overlay {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100vh;

  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);

  display: none;
  justify-content: center;
  align-items: center;

  z-index: 9999;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay.active { display: flex; }

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 650px;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modalSlide 0.25s ease-out;
}

@keyframes modalSlide {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.btn-close-modal { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; color: #94a3b8; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full-width { grid-column: span 2; }
.form-group label { font-size: 0.75rem; font-weight: 700; color: #475569; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.8rem;
  outline: none;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: #4f46e5; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}

.btn-cancel { background: #f1f5f9; color: #64748b; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-save { background: #4f46e5; color: #ffffff; border: none; padding: 9px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* FILTER CONTROL STYLING */
.filter-card {
  padding: 16px 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.filter-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.filter-item label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control-select {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.form-control-select:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.filter-vs-badge {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 8px 14px;
  border-radius: 20px;
  margin-top: 18px;
}

.filter-header-mode {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.filter-mode-label { font-size: 0.78rem; font-weight: 800; color: #64748b; text-transform: uppercase; }

/* STYLING DATE RANGE PICKER KHUSUS V2 */
.range-picker-container {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.range-input {
  flex: 1;
  background: #ffffff !important;
  font-weight: 700;
  color: #0f172a;
}

.preset-select {
  width: 170px;
  background: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 700;
}

.btn-preset-chip {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset-chip:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* PM TABLE SPECIAL STYLES */
.badge-pm-target {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pm-normal {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 12px;
}

.text-excel-tl {
  font-size: 0.78rem;
  font-weight: 700;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pm-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.pm-table th:nth-child(1), .pm-table td:nth-child(1) { width: 45px; text-align: center; }
.pm-table th:nth-child(2), .pm-table td:nth-child(2) { width: 105px; }
.pm-table th:nth-child(3), .pm-table td:nth-child(3) { width: 120px; white-space: nowrap !important; }
.pm-table th:nth-child(4), .pm-table td:nth-child(4) { width: 240px; }
.pm-table th:nth-child(5), .pm-table td:nth-child(5) { width: 110px; }
.pm-table th:nth-child(6), .pm-table td:nth-child(6) { width: 70px; text-align: center; }
.pm-table th:nth-child(7), .pm-table td:nth-child(7) { width: 170px; white-space: normal !important; word-break: break-word; }
.pm-table th:nth-child(8), .pm-table td:nth-child(8) { width: 220px; white-space: normal !important; word-break: break-word; }
.pm-table th:nth-child(9), .pm-table td:nth-child(9) { width: 150px; }
.pm-table th:nth-child(10), .pm-table td:nth-child(10) { width: 65px; text-align: center; }

.border-green-light { border: 1.5px solid #a7f3d0 !important; border-radius: 16px !important; }
.text-green-dark { color: #065f46 !important; font-weight: 800; }
.bg-green-subtle { background: #d1fae5; }

.border-cyan-light { border: 1.5px solid #a5f3fc !important; border-radius: 16px !important; }
.border-cyan-full { border: 1.5px solid #a5f3fc !important; border-radius: 16px !important; }
.text-cyan-dark { color: #0e7490 !important; }
.text-cyan-title { color: #0f172a !important; font-weight: 800; font-size: 1.05rem; margin: 0; }
.bg-cyan-subtle { background: #cff4fc; }
.bg-cyan-dark-fill { background: #0891b2; color: #ffffff; }
.pct-cyan-capsule { background: #cff4fc; color: #0e7490; font-weight: 800; font-size: 0.78rem; padding: 5px 12px; border-radius: 20px; }

.border-purple-light { border: 1.5px solid #e9d5ff !important; border-radius: 16px !important; }
.border-purple-full { border: 1.5px solid #e9d5ff !important; border-radius: 16px !important; }
.text-purple-dark { color: #7e22ce !important; }
.text-purple-title { color: #0f172a !important; font-weight: 800; font-size: 1.05rem; margin: 0; }
.bg-purple-subtle { background: #f3e8ff; }
.bg-purple-dark-fill { background: #9333ea; color: #ffffff; }
.pct-purple-capsule { background: #f3e8ff; color: #7e22ce; font-weight: 800; font-size: 0.78rem; padding: 5px 12px; border-radius: 20px; }

.border-slate-light { border: 1.5px solid #e2e8f0 !important; border-radius: 16px !important; }
.text-slate-dark { color: #334155 !important; }
.bg-slate-subtle { background: #f1f5f9; }

.pm-batch-title-box { display: flex; align-items: center; gap: 12px; }
.pm-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.stat-top { display: flex !important; justify-content: space-between !important; align-items: center !important; margin-bottom: 12px !important; }
.stat-icon-box { width: 34px !important; height: 34px !important; border-radius: 10px !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 0.95rem !important; }
.stat-body { display: flex !important; justify-content: space-between !important; align-items: baseline !important; margin-bottom: 8px !important; }
.stat-value { display: flex; align-items: baseline; gap: 6px; }
.pct-badge { font-size: 0.75rem; font-weight: 800; padding: 4px 10px; border-radius: 16px; }
.stat-foot { font-size: 0.72rem; color: #64748b; font-weight: 600; margin: 0; }

.navbar-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 8px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

/* Pemisah antar tab internal dan link luar */
.nav-divider {
  width: 1px;
  height: 24px;
  background-color: #e2e8f0;
  margin: 0 4px;
}

/* Styling Tombol Link Rekap PM */
.nav-tab.nav-link-external {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab.nav-link-external:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

body.dark {
  background-color: #0f172a !important;
  color: #f8fafc !important;
}
body.dark .card, 
body.dark .content-card,
body.dark .table-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* =========================================================
   PENGATURAN SCROLL & UTILS UNTUK INTEGRASI IFRAME DASHBOARD
   ========================================================= */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  overflow-y: auto !important; /* Membiarkan konten mengalir mulus tanpa scrollbar ganda */
}

/* =========================================================
   DARK MODE — PLN ENTERPRISE NAVY
   DISAMAKAN DENGAN REKAP PM
   HANYA MENGUBAH TAMPILAN
   ========================================================= */

html {
  overflow-y: visible !important;
}

html,
body {
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* =========================================================
   BACKGROUND
   ========================================================= */

body.dark {
  --primary: #3b82f6;
  --bg-main: #0b1220;
  --card-bg: #111c2e;
  --border-color: #26354a;
  --text-main: #f8fafc;
  --text-sub: #94a3b8;

  background: #0b1220 !important;
  color: #f8fafc !important;
}

/* =========================================================
   NAVBAR
   ========================================================= */

body.dark .navbar-card {
  background: #0f172a !important;
  border-color: #26354a !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22) !important;
}

body.dark .nav-tab {
  background: transparent !important;
  color: #94a3b8 !important;
}

body.dark .nav-tab:hover {
  background: #172338 !important;
  color: #e2e8f0 !important;
}

body.dark .nav-tab.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}

body.dark .nav-tab-highlight.active {
  background: #059669 !important;
  color: #ffffff !important;
}

body.dark .nav-divider {
  background: #334155 !important;
}

body.dark .nav-link-external {
  background: #172338 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark .nav-link-external:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* =========================================================
   CARD
   ========================================================= */

body.dark .card,
body.dark .filter-card,
body.dark .chart-card,
body.dark .table-card,
body.dark .pm-batch-card,
body.dark .stat-box {
  background: #111c2e !important;
  color: #f8fafc !important;
  border-color: #26354a !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24) !important;
}

/* =========================================================
   TEXT
   ========================================================= */

body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6,
body.dark strong {
  color: #f8fafc !important;
}

body.dark .stat-title,
body.dark .stat-unit,
body.dark .stat-sub,
body.dark .stat-foot,
body.dark .subtitle,
body.dark .filter-mode-label,
body.dark .filter-item label,
body.dark .data-count-text,
body.dark .text-muted {
  color: #94a3b8 !important;
}

body.dark .stat-num {
  color: #f8fafc !important;
}

/* =========================================================
   STAT COLORS
   ========================================================= */

body.dark .text-blue {
  color: #60a5fa !important;
}

body.dark .text-orange {
  color: #fbbf24 !important;
}

body.dark .text-purple {
  color: #c084fc !important;
}

body.dark .text-green,
body.dark .text-green-dark {
  color: #4ade80 !important;
}

body.dark .text-cyan-dark,
body.dark .text-cyan-title {
  color: #67e8f9 !important;
}

body.dark .text-purple-dark,
body.dark .text-purple-title {
  color: #c084fc !important;
}

body.dark .text-slate-dark {
  color: #cbd5e1 !important;
}

/* =========================================================
   SUBTLE BACKGROUND
   ========================================================= */

body.dark .bg-green-subtle {
  background: #153827 !important;
}

body.dark .bg-cyan-subtle {
  background: #12343d !important;
}

body.dark .bg-purple-subtle {
  background: #2d2140 !important;
}

body.dark .bg-slate-subtle {
  background: #1a2638 !important;
}

body.dark .bg-cyan-dark-fill {
  background: #0891b2 !important;
}

body.dark .bg-purple-dark-fill {
  background: #9333ea !important;
}

/* =========================================================
   FILTER
   ========================================================= */

body.dark .form-control-select,
body.dark .range-input,
body.dark .preset-select {
  background: #172338 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark .form-control-select:focus {
  border-color: #3b82f6 !important;
  background: #172338 !important;
}

body.dark .btn-preset-chip {
  background: #172338 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark .btn-preset-chip:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
}

body.dark .filter-vs-badge {
  background: #172338 !important;
  color: #94a3b8 !important;
}

body.dark .filter-header-mode {
  border-bottom-color: #334155 !important;
}

/* =========================================================
   SEARCH
   ========================================================= */

body.dark .search-box input {
  background: #172338 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark .search-box input::placeholder {
  color: #64748b !important;
}

body.dark .search-box input:focus {
  border-color: #3b82f6 !important;
}

/* =========================================================
   TABLE
   ========================================================= */

body.dark .table-card {
  background: #111c2e !important;
}

body.dark .custom-table {
  background: #111c2e !important;
  color: #f8fafc !important;
}

body.dark .custom-table th {
  background: #172338 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark .custom-table td {
  background: #111c2e !important;
  color: #cbd5e1 !important;
  border-color: #26354a !important;
}

body.dark .custom-table tbody tr:hover td {
  background: #172338 !important;
}

/* =========================================================
   BADGE
   ========================================================= */

body.dark .badge-sheet {
  background: #2d2140 !important;
  color: #c084fc !important;
}

body.dark .badge-status-done {
  background: #153827 !important;
  color: #4ade80 !important;
}

body.dark .badge-status-prog {
  background: #3a2d12 !important;
  color: #fbbf24 !important;
}

body.dark .badge-status-notyet {
  background: #3a1d25 !important;
  color: #f87171 !important;
}

body.dark .badge-kategori {
  background: #172338 !important;
  color: #a5b4fc !important;
}

body.dark .badge-pm-target {
  background: #153827 !important;
  color: #4ade80 !important;
}

body.dark .badge-pm-normal {
  background: #1a2638 !important;
  color: #94a3b8 !important;
}

/* =========================================================
   BUTTON
   ========================================================= */

body.dark .btn-add {
  background: #2563eb !important;
  color: #ffffff !important;
}

body.dark .btn-add:hover {
  background: #3b82f6 !important;
}

body.dark .btn-csv {
  background: #153827 !important;
  color: #4ade80 !important;
  border-color: #166534 !important;
}

body.dark .btn-csv:hover {
  background: #059669 !important;
  color: #ffffff !important;
}

body.dark .btn-edit {
  background: #25345a !important;
  color: #93c5fd !important;
}

body.dark .btn-delete {
  background: #3a1d25 !important;
  color: #f87171 !important;
}

body.dark .btn-cancel {
  background: #1a2638 !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark .btn-save {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* =========================================================
   PM BATCH
   ========================================================= */

body.dark .pm-list-item {
  background: #172338 !important;
  color: #e2e8f0 !important;
}

body.dark .border-green-light,
body.dark .border-cyan-light,
body.dark .border-purple-light,
body.dark .border-slate-light {
  border-color: #334155 !important;
}

/* =========================================================
   MODAL
   ========================================================= */

body.dark .modal-overlay {
  background: rgba(2, 8, 23, .72) !important;
}

body.dark .modal-card {
  background: #111c2e !important;
  color: #f8fafc !important;
  border: 1px solid #26354a !important;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .45) !important;
}

body.dark .modal-header {
  border-bottom-color: #26354a !important;
}

body.dark .modal-header h3 {
  color: #f8fafc !important;
}

body.dark .btn-close-modal {
  color: #94a3b8 !important;
}

body.dark .form-group label {
  color: #cbd5e1 !important;
}

body.dark .form-group input,
body.dark .form-group select,
body.dark .form-group textarea {
  background: #172338 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark .form-group input::placeholder,
body.dark .form-group textarea::placeholder {
  color: #64748b !important;
}

body.dark .modal-footer {
  border-top-color: #26354a !important;
}

/* =========================================================
   FLATPICKR
   ========================================================= */

body.dark .flatpickr-calendar {
  background: #111c2e !important;
  border-color: #334155 !important;
}

body.dark .flatpickr-months,
body.dark .flatpickr-month,
body.dark .flatpickr-weekdays,
body.dark .flatpickr-weekday {
  background: #111c2e !important;
  color: #cbd5e1 !important;
}

body.dark .flatpickr-day {
  color: #cbd5e1 !important;
}

body.dark .flatpickr-day:hover {
  background: #24344c !important;
  border-color: #24344c !important;
}

body.dark .flatpickr-day.selected {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

/* =========================================================
   SCROLLBAR
   DISAMAKAN DENGAN REKAP PM
   ========================================================= */

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body.dark::-webkit-scrollbar-thumb,
body.dark *::-webkit-scrollbar-thumb {
  background: #334155;
}

body.dark::-webkit-scrollbar-thumb:hover,
body.dark *::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* =========================================================
   DARK MODE FIX — KOMPARASI & CHART
   DISAMAKAN DENGAN REKAP PM
   KHUSUS TAMPILAN
   ========================================================= */

/* Background kartu komparasi */
body.dark .p-card {
  background: #111c2e !important;
  border-color: #26354a !important;
  color: #f8fafc !important;
}

/* Judul Rentang */
body.dark .p-title h4 {
  color: #f8fafc !important;
}

/* Badge jumlah kejadian */
body.dark .p1-badge {
  background: #172d45 !important;
  color: #60a5fa !important;
}

body.dark .p2-badge {
  background: #2d2140 !important;
  color: #c084fc !important;
}

/* Kotak Total Tiket / MTTR / Wilayah */
body.dark .p-metric-box {
  background: #172338 !important;
  border: 1px solid #26354a !important;
  color: #f8fafc !important;
}

/* Label kecil */
body.dark .p-metric-label {
  color: #94a3b8 !important;
}

/* Nilai utama */
body.dark .p-metric-value {
  color: #f8fafc !important;
}

/* Nilai yang punya warna hijau/merah dari JS
   tetap dipertahankan */
body.dark .p-metric-value .text-success {
  color: #4ade80 !important;
}

body.dark .p-metric-value .text-danger {
  color: #f87171 !important;
}

/* Sub nilai seperti (16.6 Jam) */
body.dark .p-metric-sub {
  color: #94a3b8 !important;
}

/* Garis pemisah */
body.dark .p-info-list {
  border-top-color: #334155 !important;
}

/* Label informasi */
body.dark .p-info-item span {
  color: #94a3b8 !important;
}

/* Nilai informasi */
body.dark .p-info-item strong {
  color: #f8fafc !important;
}

/* Chart card */
body.dark .chart-card {
  background: #111c2e !important;
  border-color: #26354a !important;
  color: #f8fafc !important;
}

/* Judul chart */
body.dark .chart-title-group h4,
body.dark .chart-header h4 {
  color: #f8fafc !important;
}

/* Subtitle chart */
body.dark .chart-title-group .subtitle,
body.dark .chart-header .subtitle {
  color: #94a3b8 !important;
}

/* =========================================================
   DARK MODE TABEL
   ========================================================= */

body.dark .table-card {
  background: #111c2e !important;
  border-color: #26354a !important;
}

body.dark .custom-table th {
  background: #172338 !important;
  color: #cbd5e1 !important;
  border-bottom-color: #334155 !important;
}

body.dark .custom-table td {
  background: #111c2e !important;
  color: #cbd5e1 !important;
  border-bottom-color: #26354a !important;
}

body.dark .custom-table tbody tr:hover td {
  background: #172338 !important;
}

/* Warna inline pada isi tabel */
body.dark .custom-table td[style*="color:#0f172a"],
body.dark .custom-table td[style*="color: #0f172a"] {
  color: #f8fafc !important;
}

body.dark .custom-table td[style*="color:#334155"],
body.dark .custom-table td[style*="color: #334155"] {
  color: #cbd5e1 !important;
}

body.dark .custom-table td[style*="color:#64748b"],
body.dark .custom-table td[style*="color: #64748b"] {
  color: #94a3b8 !important;
}

/* =========================================================
   SCROLLBAR — SAMA DENGAN REKAP PM
   ========================================================= */

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

body.dark::-webkit-scrollbar-thumb {
  background: #334155;
}

body.dark::-webkit-scrollbar-thumb:hover {
  background: #475569;
}