:root {
  --primary: #075e54;
  --secondary: #128c7e;
  --bg-dark: #1e1e2d;
  --bg-light: #f5f7fb;
  --card-bg: #ffffff;
  --text-dark: #2b2b2b;
  --border-color: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, sans-serif; }
body { background-color: var(--bg-light); color: var(--text-dark); height: 100vh; overflow: hidden; }

.app-container { display: flex; height: 100vh; }

/* SIDEBAR NAVIGASI */
.main-sidebar {
  width: 260px; background: var(--bg-dark); color: #fff; display: flex;
  flex-direction: column; justify-content: space-between; padding: 20px 15px;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.logo-avatar { font-size: 28px; background: rgba(255,255,255,0.1); padding: 8px; border-radius: 50%; }
.brand-text h3 { font-size: 16px; } .brand-text span { font-size: 11px; color: #a1a5b7; }

.sidebar-menu { display: flex; flex-direction: column; gap: 10px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 15px; background: transparent;
  border: none; color: #a1a5b7; font-size: 14px; font-weight: 600; border-radius: 8px; cursor: pointer; transition: 0.2s;
}
.nav-item:hover, .nav-item.active { background: var(--secondary); color: #fff; }

.sidebar-footer .btn-action {
  width: 100%; padding: 10px; background: rgba(255,255,255,0.1); color: #fff;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; cursor: pointer;
}

/* MAIN CONTENT */
.main-content { flex: 1; overflow-y: auto; padding: 25px; position: relative; }
.menu-section { display: none; }
.menu-section.active { display: block; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.btn-refresh { padding: 8px 16px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; }

/* KPI CARDS */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 25px; }
.kpi-card { background: var(--card-bg); padding: 20px; border-radius: 12px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--border-color); }
.kpi-icon { width: 50px; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.kpi-icon.blue { background: #3b82f6; } .kpi-icon.green { background: #10b981; }
.kpi-icon.orange { background: #f59e0b; } .kpi-icon.purple { background: #8b5cf6; }

/* VISUAL DASHBOARD */
.dashboard-visuals { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.visual-card { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); }
.gauge-container { display: flex; gap: 15px; margin-top: 15px; }
.gauge-box { flex: 1; background: var(--bg-light); padding: 15px; border-radius: 8px; text-align: center; }

/* CHATBOT */
.chat-container { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border-color); height: calc(100vh - 100px); display: flex; flex-direction: column; }
.chat-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; }
.bot-info { display: flex; align-items: center; gap: 12px; }
.bot-avatar { font-size: 24px; }
.bot-details h3 { font-size: 15px; } .bot-details span { font-size: 12px; color: #10b981; }
.chat-body { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; background: #efeae2; }
.message { max-width: 70%; padding: 10px 14px; border-radius: 8px; font-size: 14px; line-height: 1.4; position: relative; }
.message.bot { background: #fff; align-self: flex-start; }
.message.user { background: #dcf8c6; align-self: flex-end; }
.message .time { font-size: 10px; color: #999; margin-top: 4px; text-align: right; }
.chat-footer { padding: 15px; background: #f0f0f0; display: flex; gap: 10px; }
.chat-footer input { flex: 1; padding: 10px 15px; border: 1px solid #ccc; border-radius: 20px; outline: none; }
.btn-send { width: 40px; height: 40px; background: var(--primary); color: #fff; border: none; border-radius: 50%; cursor: pointer; }

/* DYNAMIC FORM */
.form-wrapper { background: var(--card-bg); padding: 25px; border-radius: 12px; border: 1px solid var(--border-color); }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.required-asterisk { color: #ef4444; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.sub-card { background: var(--bg-light); padding: 15px; border-radius: 8px; border: 1px dashed #cbd5e1; }
.group-label { font-weight: 700; font-size: 13px; color: var(--primary); margin-bottom: 10px; display: block; }
.btn-submit { padding: 12px 20px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; width: 100%; }
.btn-secondary-add, .btn-add-main { padding: 6px 12px; background: #e2e8f0; color: #334155; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-delete { padding: 4px 8px; background: #fee2e2; color: #ef4444; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; }
.anomali-item-card { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; padding: 15px; margin-bottom: 15px; }
.card-header-inner { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px solid #e2e8f0; padding-bottom: 6px; }

/* =================================================================
   MODERN FORM INPUTS (TAMPILAN BARU)
   ================================================================= */

/* 1. Pengaturan Dasaran Input & Select */
.form-control,
input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px;
  color: #1e293b;
  background-color: #ffffff; /* Mengubah background abu-abu menjadi putih bersih */
  border: 1.5px solid #cbd5e1; /* Border halus */
  border-radius: 8px; /* Sudut membulat modern */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease-in-out;
  outline: none;
  appearance: none; /* Menghapus style bawaan browser */
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* 2. Custom Icon Panah untuk Dropdown Select */
select.form-control,
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%6b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  padding-right: 2.5rem;
}

/* 3. Efek Focus Soft Ring Saat Field Diklik */
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--secondary); /* Menggunakan warna hijau aplikasi #128c7e */
  box-shadow: 0 0 0 3px rgba(18, 140, 126, 0.18); /* Efek glow hijau di tepi input */
  background-color: #ffffff;
}

/* 4. Penyempurnaan Tampilan Sub Card & Spasi Label */
.sub-card {
  background: #f8fafc;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

/* REPORT PRINT MENU & FILTER (DIPERBARUI) */
.report-filter-bar {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.filter-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  outline: none;
  background-color: #fff;
}

.filter-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.filter-buttons .btn-action {
  flex: 1;
  justify-content: center;
}

.report-action-bar { display: flex; justify-content: space-between; margin-bottom: 15px; }
.btn-action { padding: 8px 14px; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-filter { background: var(--secondary); color: #fff; }
.btn-reset { background: #94a3b8; color: #fff; }
.btn-add { background: #10b981; color: #fff; }
.btn-email { background: #0284c7; color: #fff; }
.btn-print { background: var(--primary); color: #fff; }

/* REPORT PAPER PREVIEW & MEDIA PRINT FORMAT */
.report-paper { background: #fff; width: 210mm; min-height: 297mm; padding: 12mm 15mm; margin: 0 auto 30px auto; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-radius: 4px; box-sizing: border-box; }

.header-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; border-bottom: 1px solid #000; padding-bottom: 4px; }
.header-table td { vertical-align: middle; border: none; }
.logo-pln { width: 26px; height: auto; display: block; }
.company-title { padding-left: 8px; line-height: 1.25; }
.company-title .main-name { font-weight: 700; font-size: 9pt; display: block; }
.company-title .sub-name { font-weight: 700; font-size: 8pt; display: block; color: #333; }
.report-title { font-weight: 700; font-size: 10.5pt; margin: 12px 0; line-height: 1.3; text-transform: uppercase; text-align: center; }

.info-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 7.5pt; }
.info-table td { padding: 2px 0; vertical-align: top; line-height: 1.3; border: none; }
.info-table td.label { width: 120px; white-space: nowrap; font-weight: 700; }
.info-table td.colon { width: 12px; text-align: center; font-weight: 700; }
.info-table td.value { text-align: left; font-weight: 400; }

.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-bottom: 10px; }
.data-table th, .data-table td { border: 1px solid #000; padding: 4px 3px; text-align: center; vertical-align: middle; word-wrap: break-word; overflow-wrap: break-word; }
.data-table th { font-weight: 700; background-color: #fff; text-transform: uppercase; font-size: 6.5pt; }
.data-table td { font-size: 6pt; line-height: 1.2; }
.data-table td.text-left { text-align: left; }
.data-table a { color: #0284c7; text-decoration: underline; font-weight: 600; }

.footer-notes { font-size: 5.5pt; margin-bottom: 16px; line-height: 1.3; color: #222; }

.signature-section { width: 100%; page-break-inside: avoid; }
.signature-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.signature-table td { width: 33.33%; vertical-align: bottom; padding: 0 4px; border: none; }
.date-location { font-weight: 400; font-size: 6.5pt; margin-bottom: 3px; text-align: center; }
.signature-title { font-size: 6.5pt; font-weight: 400; vertical-align: top; }
.signature-space { height: 45px; }
.signature-name { font-size: 6.5pt; font-weight: 700; text-decoration: underline; }

.page-break { page-break-before: always; margin-top: 20px; }
.attachment-container-table { width: 100%; border-collapse: collapse; }
.attachment-container-table td { border: none; }

/* STYLING MULTI-COLUMN & CENTERED DOKUMENTASI FOTO */
.photo-grid-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  margin: 0 auto !important;
}

.photo-grid-table td {
  width: 50% !important;
  padding: 6px !important;
  vertical-align: top !important;
  text-align: center !important;
}

.photo-card {
  border: none !important;
  padding: 4px;
  background: transparent;
  text-align: center;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.photo-card img {
  width: 100% !important;
  max-width: 320px !important;
  height: 210px !important;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px auto;
}

.photo-caption {
  font-size: 7.5pt;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

/* MEDIAPRINT HIDE OVERRIDES */
@media print {
  @page {
    size: A4 portrait;
    margin: 15mm 20mm;
  }
  body {
    background: #fff !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact;
  }
  .main-sidebar, .no-print, .section-header, .report-filter-bar, .report-action-bar { 
    display: none !important; 
  }
  .main-content { 
    padding: 0 !important; 
    overflow: visible !important; 
  }
  .report-paper {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
}

/* UTILITY CLASSES UNTUK SUB-MENU NAVIGASI LAPORAN */
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 1rem !important; }
.py-5 { padding-top: 3rem !important; }
.text-center { text-align: center !important; }
.text-muted { color: #64748b !important; }

/* KONTROL VISIBILITAS SUB-CONTENT LAPORAN */
.report-sub-content {
  display: none;
}

.report-sub-content.active {
  display: block;
}

/* 1. Pengaturan wadah logo dan gambar background */
.logo-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    
    /* Menampilkan Gambar Logo */
    background-image: url('Logo Bekantan.png');
    background-size: cover;          /* atau 'contain' sesuai selera */
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 50%;              /* Membuat gambar berbentuk lingkaran */
}

/* 2. Tata letak sejajar dengan teks judul */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =================================================================
   DASHBOARD 7 GAUGE MODERN
   ================================================================= */
.gauge-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.gauge-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(18, 140, 126, 0.07), transparent 38%),
    var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gauge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.gauge-card.is-warning { border-color: rgba(245, 158, 11, 0.30); }
.gauge-card.is-complete { border-color: rgba(16, 185, 129, 0.35); }
.gauge-card.is-over { border-color: rgba(59, 130, 246, 0.35); }

.gauge-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.gauge-card-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  color: #0f172a;
}

.gauge-card-head span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}

.gauge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex: 0 0 44px;
}

.gauge-icon.blue { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.gauge-icon.green { background: linear-gradient(135deg, #059669, #34d399); }
.gauge-icon.cyan { background: linear-gradient(135deg, #0891b2, #67e8f9); }
.gauge-icon.orange { background: linear-gradient(135deg, #d97706, #fbbf24); }
.gauge-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.gauge-icon.red { background: linear-gradient(135deg, #dc2626, #fb7185); }
.gauge-icon.indigo { background: linear-gradient(135deg, #4338ca, #818cf8); }

.gauge-wrap {
  position: relative;
  margin: 8px 0 0;
  padding-top: 6px;
}

.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.gauge-track,
.gauge-progress {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.gauge-track {
  stroke: #e8edf4;
}

.gauge-progress {
  stroke: var(--gauge-color, #128c7e);
  stroke-dasharray: 157.08;
  stroke-dashoffset: 157.08;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.gauge-card.is-warning { --gauge-color: #f59e0b; }
.gauge-card.is-complete { --gauge-color: #10b981; }
.gauge-card.is-over { --gauge-color: #3b82f6; }
.gauge-card.is-empty { --gauge-color: #94a3b8; }

.gauge-center {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 140px;
  text-align: center;
  pointer-events: none;
}

.gauge-center strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.gauge-center span {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  font-weight: 700;
}

.gauge-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.gauge-stats > div {
  background: #f8fafc;
  border-radius: 10px;
  padding: 9px 10px;
  text-align: center;
}

.gauge-stats span,
.gauge-gap span {
  display: block;
  font-size: 10px;
  color: #64748b;
  margin-bottom: 3px;
}

.gauge-stats strong {
  font-size: 16px;
  color: #0f172a;
}

.gauge-gap {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, #fff7ed, #fffaf5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gauge-gap span {
  margin: 0;
  font-size: 11px;
}

.gauge-gap strong {
  font-size: 16px;
  color: #c2410c;
}

.gauge-card.is-complete .gauge-gap {
  background: linear-gradient(90deg, #ecfdf5, #f0fdf4);
}

.gauge-card.is-complete .gauge-gap strong {
  color: #047857;
}

.gauge-card.is-over .gauge-gap {
  background: linear-gradient(90deg, #eff6ff, #f8fbff);
}

.gauge-card.is-over .gauge-gap strong {
  color: #1d4ed8;
}

.gauge-card.is-empty .gauge-gap {
  background: #f8fafc;
}

.gauge-card.is-empty .gauge-gap strong {
  color: #64748b;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.dashboard-summary-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.dashboard-summary-card h4 {
  margin-bottom: 6px;
}

.dashboard-summary-card p {
  font-size: 12px;
  color: #64748b;
}

.dashboard-summary-values {
  display: flex;
  gap: 12px;
  min-width: 360px;
}

.summary-item {
  flex: 1;
  background: var(--bg-light);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}

.summary-item span {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 5px;
}

.summary-item strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  color: #0f172a;
}

.btn-refresh.is-syncing {
  opacity: 0.85;
  cursor: wait;
}

.btn-refresh.is-error {
  background: #b45309;
}

@media (max-width: 1024px) {
  .gauge-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .gauge-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-summary-card {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-summary-values {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .gauge-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-values {
    flex-direction: column;
  }
}

.dashboard-bottom-grid {
  margin-bottom: 24px; /* Memberi jarak antara banner PDKB dengan kartu gauge */
}

.section-title {
    margin-bottom: 20px; /* Atur nilai piksel sesuai tingkat kelonggaran yang diinginkan */
    display: flex;       /* Opsional: membuat ikon dan teks sejajar dengan rapi */
    align-items: center;
    gap: 8px;           /* Opsional: memberi jarak antara ikon dan tulisan */
}

/* =================================================================
   LAPORAN MATERIAL ERS / LINDSEY & PRINT OVERRIDES
   ================================================================= */

/* Pengaturan Kertas Laporan */
.report-paper {
  width: 210mm;
  min-height: 297mm;
  background: #ffffff;
  padding: 15mm 20mm;
  margin: 0 auto 30px auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

/* Header Laporan ERS */
.company-title .main-name {
  font-weight: 700;
  font-size: 9.5pt;
  display: block;
  letter-spacing: 0.2px;
}

/* Judul Laporan ERS */
.report-title {
  font-weight: 700;
  font-size: 11pt;
  margin: 16px 0;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

/* Kolom Khusus Tabel ERS */
.data-table th {
  background-color: #ffff00;
  color: #000000;
  font-size: 7.5pt;
}

.data-table td {
  font-size: 7pt;
  line-height: 1.2;
}

.data-table td.col-code {
  font-weight: 600;
}

.data-table td.col-name {
  text-align: left;
  padding-left: 6px;
}

/* Container Preview Gambar Tabel */
.img-container {
  width: 70px;
  height: 45px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Area Tanda Tangan Khusus ERS */
.signature-table-ers {
  width: 300px;
  margin-left: auto;
  margin-right: 0;
  border-collapse: collapse;
  text-align: center;
}

.signature-table-ers td {
  width: 100%;
  vertical-align: bottom;
  padding: 0 5px;
  border: none;
}

.submenu-wrapper {
  display: none;
  padding-left: 16px;
  margin-top: 4px;
}

.sub-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-align: left;
}

.sub-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sub-nav-item.active {
  color: #ffffff;
  background: var(--secondary); /* Mengubah #10b981 menjadi var(--secondary) */
  font-weight: 600;
}

.caret-icon {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.dropdown-btn.open .caret-icon {
  transform: rotate(90deg);
}

/* ==========================================
   HORIZONTAL STEPPER WIZARD STYLES
   ========================================== */

.k3-stepper-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin: 25px 0 35px 0;
  padding: 0 10px;
}

/* Garis Latar Stepper */
.k3-stepper-wrapper::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

/* Garis Hijau Progress Berjalan */
.k3-stepper-line {
  position: absolute;
  top: 18px;
  left: 30px;
  height: 4px;
  background: #10b981;
  z-index: 2;
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bulatan Step */
.k3-step-item {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.k3-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  color: #64748b;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.k3-step-label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  transition: color 0.3s ease;
}

/* Status Active & Completed */
.k3-step-item.active .k3-step-circle {
  border-color: #10b981;
  background: #10b981;
  color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.k3-step-item.active .k3-step-label {
  color: #0f172a;
  font-weight: 700;
}

.k3-step-item.completed .k3-step-circle {
  border-color: #10b981;
  background: #ecfdf5;
  color: #10b981;
}

/* Container Form Card & Animasi Transisi */
.k3-form-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.k3-step-content {
  display: none;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.k3-step-content.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* Footer & Navigasi Tombol */
.k3-wizard-footer {
  display: flex;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.k3-wizard-footer .spacer {
  flex-grow: 1;
}

.btn-wizard {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-wizard.btn-prev {
  background: #f1f5f9;
  color: #475569;
}

.btn-wizard.btn-prev:hover {
  background: #e2e8f0;
}

.btn-wizard.btn-next {
  background: #10b981;
  color: #ffffff;
}

.btn-wizard.btn-next:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-wizard.btn-finish {
  background: #0284c7;
  color: #ffffff;
}

.btn-wizard.btn-finish:hover {
  background: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* --- BASE SIDEBAR & CONTENT TRANSITION --- */
.main-sidebar {
  width: 260px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 1000;
}

.main-content {
  flex: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Layout Content Header / Topbar */
.content-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

/* Style Tombol Toggle (Selalu terlihat di Header Topbar) */
.toggle-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* --- TAMPILAN DESKTOP (> 768px) --- */
@media (min-width: 769px) {
  /* Saat disembunyikan (collapsed) di PC */
  .main-sidebar.collapsed {
    margin-left: -260px !important; /* Menggeser sidebar keluar dari viewport */
    opacity: 0;
    pointer-events: none;
  }

  .main-content.expanded {
    margin-left: 0 !important;
    width: 100% !important;
  }
}

/* --- TAMPILAN HP / MOBILE (<= 768px) --- */
@media (max-width: 768px) {
  .main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
  }

  .main-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

.form-row-3 { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); /* Mengubah dari 1fr 1fr menjadi 3 kolom */
  gap: 15px; 
}

/* Pastikan wadah utama menjadi acuan posisi */
.chat-container {
  position: relative; /* Penting agar overlay tidak bocor ke luar area chat */
}

/* Lapisan penutup (Overlay) */
.maintenance-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 45, 0.85); /* Warna background gelap transparan */
  backdrop-filter: blur(1px); /* Efek buram modern pada chat di belakangnya */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100; /* Memastikan berada di paling atas */
  border-radius: 12px;
  pointer-events: all; /* Mengunci semua klik mouse */
}

/* Kotak Teks Informasi */
.maintenance-content {
  text-align: center;
  color: #ffffff;
  padding: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 80%;
}

.maintenance-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.maintenance-content h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #f59e0b; /* Warna aksen oranye pemeliharaan */
  text-transform: uppercase;
  letter-spacing: 1px;
}

.maintenance-content p {
  font-size: 13px;
  color: #a1a5b7;
}