/* Variabel CSS untuk memudahkan penyesuaian */
:root {
  /* Sesuaikan nilai ini berdasarkan tinggi aktual header dan footer yang terukur */
  --header-height: 70px; /* Tinggi total header */
  --footer-height: 35px; /* Tinggi total footer */
  --main-padding-vertical: 1.5rem; /* Total padding vertikal untuk main.container (0.75rem top + 0.75rem bottom) */
  --main-padding-horizontal: 2rem; /* Padding horizontal untuk main.container */
  --dashboard-gap: 1.5rem; /* Gap antara explorer-panel dan right-column */
}

/* RESET DASAR */
html, body {
  height: 100%; /* Memastikan html dan body mengambil tinggi penuh viewport */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  display: flex; /* Mengaktifkan Flexbox untuk body */
  flex-direction: column; /* Mengatur item Flexbox secara vertikal (header, main, footer) */
  min-height: 100vh; /* Memastikan body selalu setidaknya 100% tinggi viewport */
  overflow-x: hidden; /* Mencegah scrollbar horizontal */
  /* overflow-y: auto; */ /* Biarkan browser menangani scrollbar vertikal jika konten keseluruhan melebihi viewport */
}

/* --- HEADER STYLES --- */
/* Target elemen <header> dengan kelas .navbar untuk spesifisitas tinggi */
header.navbar {
    background-color: #002D62 !important;
    color: white !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    width: 100% !important;
    position: relative !important;
    z-index: 1000 !important;
    padding: 10px 0 !important;
    
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: auto !important;
    height: auto !important;
    border-bottom: none !important;
}

/* Target container di dalam navbar dengan selektor yang SANGAT spesifik */
header.navbar > .nav-container { /* Selektor ini menargetkan anak langsung dari header.navbar */
    max-width: 1850px !important;
    width: 100% !important; /* INI KUNCI UNTUK MEMBUATNYA TERSEBAR */
    margin: 0 auto !important;
    padding: 0 1.5rem !important;
    
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important; /* Logo kiri, navigasi kanan */
    align-items: center !important;
    flex-wrap: nowrap !important;

    background-color: transparent !important;
    box-sizing: border-box !important;
    /* HAPUS INI: border: 3px dashed blue !important; */ /* Debugging border dihapus */
}

/* Target logo wrapper untuk menghilangkan kotak putih */
.logo-wrapper {
    background-color: white !important; /* Mengubah background menjadi putih */
    padding: 5px 10px !important; /* Menambah padding di sekitar logo */
    border-radius: 6px !important; /* Menambahkan sedikit sudut membulat */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important; /* Menambah sedikit bayangan */
    margin: 0 !important;

    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    height: auto !important;
}

/* Gaya untuk gambar logo */
.logo-img {
    height: 40px !important;
    width: auto !important;
    margin-right: 0 !important;
}

/* Gaya untuk teks di dalam logo wrapper (span) */
.logo-wrapper span { /* TARGET SPAN SECARA LANGSUNG */
    font-size: 1.5em !important;
    font-weight: bold !important;
    color: #333 !important; /* Mengubah warna teks menjadi hitam/gelap */
    line-height: normal !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

/* Navigasi */
nav {
    display: flex !important;
    flex-direction: row !important;
    flex-grow: 1 !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

nav a {
    color: white !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    transition: color 0.3s ease, background-color 0.3s ease !important;
    font-size: 1rem !important;
}

nav a:hover {
    background-color: rgba(255,255,255,0.2) !important;
    color: #007bff !important;
}

nav a.active {
    background-color: #ffffff !important;
    color: #002147 !important;
    font-weight: bold !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
}
/* --- END HEADER STYLES --- */

/* MAIN CONTAINER - Mengisi sisa ruang vertikal */
main.container {
  flex: 1; /* Mengambil semua ruang vertikal yang tersisa di dalam body */
  padding: var(--main-padding-vertical) var(--main-padding-horizontal);
  width: 100%;
  max-width: 1850px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex; /* Mengaktifkan Flexbox untuk main.container */
  flex-direction: column; /* Mengatur item Flexbox secara vertikal */
  height: 100%; /* Memastikan main.container mengambil tinggi penuh dari flex:1 di body */
}

/* LAYOUT UTAMA DUA KOLOM */
.dashboard-layout {
  display: flex; /* Mengaktifkan Flexbox untuk dashboard-layout */
  align-items: stretch; /* Memastikan item Flexbox (explorer-panel dan right-column) sejajar tingginya */
  gap: var(--dashboard-gap);
  flex: 1; /* Mengambil semua ruang vertikal yang tersisa di main.container */
  height: 100%; /* Memastikan dashboard-layout mengambil tinggi penuh dari flex:1 di main.container */
}

/* PANEL EXPLORER (Kolom Kiri) */
.explorer-panel {
  width: 280px; /* Lebar tetap untuk panel kiri */
  flex-shrink: 0; /* Mencegah panel menyusut secara horizontal */
  background-color: #002147;
  padding: 1.2rem;
  border-radius: 12px;
  color: white;
  display: flex; /* Mengaktifkan Flexbox untuk explorer-panel */
  flex-direction: column; /* Mengatur item Flexbox di dalamnya secara vertikal */
  justify-content: flex-start;
  height: 100%; /* Memastikan explorer-panel mengambil tinggi penuh dari dashboard-layout */
  overflow-y: auto; /* Memungkinkan scrolling internal jika kontennya melebihi tinggi panel */
  box-sizing: border-box;
}

.explorer-top {
  flex-shrink: 0; /* Menjaga bagian atas explorer agar tidak menyusut */
}

.explorer-top h3 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid #ffffff50;
}

.explorer-list {
  list-style: none;
  padding: 0.4rem 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.explorer-list li {
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.3rem;
}

.explorer-list li button,
.explorer-list li a {
  background: none;
  border: none;
  color: white;
  font-size: 0.95rem;
  font-weight: bold;
  text-align: left;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: color 0.2s ease;
  width: 100%;
  display: block;
  text-decoration: none;
}

/* FILE TERUNGGAH */
.uploaded-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-grow: 1; /* Memastikan section ini mengisi sisa ruang vertikal di explorer-panel */
}

.uploaded-card {
  background-color: #ffffff10;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1; /* Memastikan kartu ini mengisi sisa ruang vertikal di uploaded-section */
  justify-content: space-between; /* Mendorong tombol ke bagian bawah kartu */
}

.uploaded-card h4 {
  font-size: 0.9rem;
  color: white;
  margin: 0;
  font-weight: 600;
}

/* --- BLOK .csv-preview YANG DIREVISI --- */
.csv-preview {
  background-color: #0f1c3f;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  font-family: monospace;
  overflow-y: auto;
  flex-grow: 1;

  display: flex; /* Tetap flex untuk kontrol yang lebih baik */
  flex-direction: column; /* Membuat item tersusun vertikal */
  align-items: flex-start; /* Meratakan item ke kiri */
  justify-content: flex-start; /* Meratakan item ke atas */
  gap: 2px; /* Memberi jarak antar item file */
}
/* --- AKHIR BLOK .csv-preview YANG DIREVISI --- */

/* --- ATURAN BARU UNTUK SETIAP ITEM FILE --- */
.file-item {
  width: 100%; /* Memastikan setiap item mengambil lebar penuh */
  padding: 5px 8px; /* Padding internal untuk setiap item */
  background-color: transparent; /* Menghilangkan latar belakang putih */
  color: white !important; /* <--- PERBAIKAN: Tambahkan !important di sini */
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap; /* Mencegah teks melompat ke baris baru */
  overflow: hidden; /* Sembunyikan jika terlalu panjang */
  text-overflow: ellipsis; /* Tampilkan elipsis jika terpotong */
  box-sizing: border-box; /* Memastikan padding tidak menambah lebar */
}

.file-item:hover {
  background-color: rgba(255, 255, 255, 0.1); /* Efek hover */
}

.file-item.selected-file-item {
  background-color: #003366; /* Warna latar belakang untuk file yang dipilih */
  font-weight: bold;
}
/* --- AKHIR ATURAN BARU --- */


/* Tombol */
.export-btn {
  background-color: #ffffff30;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* KOLOM KANAN */
.right-column {
  flex: 1; /* Mengambil semua ruang horizontal yang tersisa di dashboard-layout */
  height: 100%; /* Memastikan right-column mengambil tinggi penuh dari dashboard-layout */
  display: flex; /* Mengaktifkan Flexbox untuk right-column */
  flex-direction: column; /* Mengatur item Flexbox di dalamnya secara vertikal */
  min-height: 0; /* Penting untuk Flexbox agar item dapat menyusut jika perlu */
  box-sizing: border-box; /* Pastikan padding dihitung dalam tinggi */
}

/* KONTEN UTAMA DI KOLOM KANAN (Tempat logo/judul dan kartu) */
.main-display {
  flex: 1; /* Mengambil semua ruang vertikal yang tersisa di right-column */
  display: flex; /* Mengaktifkan Flexbox untuk main-display */
  flex-direction: column; /* Mengatur item Flexbox (hero-box dan bottom-section) secara vertikal */
  justify-content: space-between; /* Ini adalah kunci: menempatkan hero-box di atas dan bottom-section di bawah, dengan ruang kosong di antaranya */
  min-height: 0; /* Penting untuk Flexbox agar item dapat menyusut jika perlu */
  overflow-y: hidden; /* <--- DIKEMBALIKAN KE PENGATURAN AWAL */
  background-color: #fff; /* Memberi latar belakang putih untuk area konten utama */
  border-radius: 12px; /* Menyesuaikan border-radius agar konsisten */
  padding: 1.5rem; /* Memberi padding internal agar konten tidak menempel tepi */
  box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* Menambahkan bayangan agar terlihat seperti kartu */
  box-sizing: border-box; /* Pastikan padding dihitung dalam tinggi */
}

/* LOGO & JUDUL (Kolom Kanan - Atas) */
.hero-box {
  flex: 1; /* Mengambil semua ruang vertikal yang tersisa di hero-box */
  display: flex; /* Mengaktifkan Flexbox untuk hero-box */
  flex-direction: column; /* Mengatur konten di dalamnya secara vertikal */
  align-items: center; /* Menengahkan konten secara horizontal */
  justify-content: center; /* Menengahkan konten secara vertikal (jika ada ruang) */
  padding: 2rem 0; /* Memberi padding atas dan bawah */
  text-align: center; /* Memastikan teks di tengah */
}

.hero-logo {
  max-height: 300px; /* Sesuaikan ukuran logo */
  width: auto;
  margin-bottom: 1rem;
}

.hero-box h1 {
  font-size: 2.2rem;
  color: #002147;
  margin: 0;
}

/* Tambahkan margin untuk judul "File Explorer" jika itu adalah H2 langsung di main-display */
.main-display h2 {
  margin-top: 0; /* Reset margin default */
  padding-bottom: 0.5rem; /* <--- PERUBAHAN: Tambahkan padding di bawah judul */
  border-bottom: 1px solid rgba(0,0,0,0.1); /* <--- PERUBAHAN: Tambahkan garis bawah */
  margin-bottom: 1rem; /* <--- PERUBAHAN: Sesuaikan margin bawah untuk jarak yang pas */
  color: #333; /* Pastikan warna teks sesuai */
}

/* PQA & PW SECTION (Kolom Kanan - Bawah) */
.bottom-section {
  flex-shrink: 0; /* Mempertahankan flex-shrink: 0 agar kartu tidak menyusut */
  margin-bottom: 0; /* Memastikan tidak ada margin bawah yang mengganggu */
}

.bottom-grid {
  display: grid; /* Menggunakan Grid untuk menata kartu PQA dan PW secara horizontal */
  grid-template-columns: 2fr 1fr; /* Dua kolom dengan lebar yang sama */
  gap: 1.5rem; /* Jarak antar kartu */
  justify-content: space-between;
}

.bottom-card {
  background-color: #fff;
  padding: 0.3rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
}

.bottom-card h3 {
  color: #002147;
  /* margin-bottom: 0.3rem; */ /* <--- DIHAPUS */
  padding-bottom: 0.5rem; /* <--- PERUBAHAN: Tambahkan padding di bawah judul */
  border-bottom: 1px solid rgba(0,0,0,0.1); /* <--- PERUBAHAN: Tambahkan garis bawah */
  margin-bottom: 1rem; /* <--- PERUBAHAN: Sesuaikan margin bawah untuk jarak yang pas */
  font-size: 1.2rem;
}

/* --- PERUBAHAN UTAMA UNTUK GAMBAR DAN FORM UPLOAD --- */
.upload-flex {
  display: flex;
  flex-direction: column; /* Mengubah arah flex menjadi kolom agar gambar dan form tersusun vertikal */
  align-items: flex-start; /* Menyelaraskan item (gambar dan form) ke kiri */
  gap: 1rem; /* Memberi jarak antara gambar dan form */
  padding: 0.5rem;
}

.image-wrapper {
  margin-bottom: 1rem; /* Memberi jarak di bawah gambar agar tidak terlalu dekat dengan form */
}

.image-wrapper img {
  max-height: 80px; /* Memperbesar ukuran tinggi gambar menjadi 70px */
  width: auto; /* Mempertahankan rasio aspek gambar */
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
/* --- AKHIR PERUBAHAN UTAMA --- */

.upload-box {
  flex: 1;
  width: 100%;
  background-color: #f9f9f9;
  padding: 0.8rem;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Aturan untuk form upload agar isinya sejajar horizontal */
#pqaUploadForm {
  display: flex;
  flex-direction: row; /* Item sejajar horizontal */
  justify-content: space-between; /* Label ke kiri, grup tombol ke kanan */
  align-items: center; /* Sejajarkan item secara vertikal di tengah */
  gap: 0.5rem; /* Jarak antar label dan grup tombol */
  flex-wrap: wrap; /* Agar tombol bisa pindah baris di layar kecil jika perlu */
}

/* Modifikasi .file-display agar hanya mengambil lebar yang dibutuhkan */
#pqaUploadForm .file-display {
  white-space: nowrap; /* Mencegah teks melompat ke baris baru */
  overflow: hidden; /* Sembunyikan jika terlalu panjang */
  text-overflow: ellipsis; /* Tampilkan elipsis jika terpotong */
}

/* Container untuk kedua tombol agar berdampingan */
.pw-buttons {
  display: flex;
  gap: 0.5rem; /* Jarak antar tombol */
  flex-shrink: 0; /* Mencegah grup tombol menyusut */
}

/* Gaya untuk tombol di dalam form upload */
#pqaUploadForm button {
  width: auto; /* Biarkan lebar tombol sesuai kontennya */
  padding: 0.5rem 1rem; /* Sesuaikan padding agar tombol terlihat bagus */
  font-size: 0.9rem; /* Sesuaikan ukuran font */
  border: 1px solid #002147; /* Border disesuaikan dengan warna background */
  border-radius: 5px;
  background-color: #002147; /* Ubah warna latar belakang menjadi biru tua */
  color: white; /* Ubah warna teks menjadi putih */
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#pqaUploadForm button:hover {
  background-color: #003366; /* Sedikit lebih terang atau gelap saat hover */
  border-color: #003366; /* Sesuaikan warna border saat hover */
}

/* --- STYLING UNTUK FILE EXPLORER (DIKEMBALIKAN KE 1 KOLOM) --- */
.file-explorer-container {
  background-color: #f8f9fa; /* Latar belakang terang untuk kontainer explorer */
  padding: 10px; /* Padding default 10px untuk kontainer */
  border-radius: 8px;
  min-height: 200px; /* Tinggi minimum agar terlihat */
  max-height: 200px; /* INI PENTING UNTUK MEMBATASI TINGGI KOTAK */
  overflow-y: auto; /* INI PENTING UNTUK SCROLLBAR VERTIKAL OTOMATIS */
  overflow-x: auto; /* Ini untuk scrollbar horizontal jika ada konten yang terlalu lebar */
  color: #333; /* Warna teks default */
  font-family: 'Segoe UI', sans-serif;
  flex-grow: 1;
  border: 1px solid #e0e0e0; /* Border tipis */
}

.explorer-item {
  /* Common styles for both folder and file items */
  padding: 3px 0; /* Padding vertikal saja */
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.75rem;
}

.explorer-item:hover {
  background-color: #e9ecef; /* Warna hover */
}

/* Style for the folder header (icon + name) */
.explorer-folder-header {
  display: flex; /* To align icon and text horizontally */
  align-items: center;
  font-weight: bold; /* Folder names are bold */
  white-space: nowrap; /* Prevent text wrap */
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 0; /* Padding vertikal saja */
}

.explorer-folder-header:hover {
    background-color: #e9ecef; /* Hover effect for the header part */
}

/* Style for file items */
.explorer-item.explorer-file {
  display: flex; /* To align icon and text horizontally */
  align-items: center;
  color: #555; /* Default file text color */
  white-space: nowrap; /* Prevent text wrap */
  overflow: hidden;
  text-overflow: ellipsis;
  /* Padding sudah ada di .explorer-item */
}

.explorer-item.explorer-file.selected {
  background-color: #007bff; /* Warna latar belakang untuk file yang dipilih */
  color: white;
}

.folder-icon, .file-icon {
  margin-right: 5px;
  color: #007bff; /* Warna ikon */
  flex-shrink: 0; /* Prevent icon from shrinking */
}

.folder-content {
  /* Kontainer ini tidak lagi menggunakan grid, kembali ke default */
}
/* --- AKHIR STYLING UNTUK FILE EXPLORER --- */
/* Custom Modal Styles */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it's on top of other content */
  visibility: hidden; /* Hidden by default */
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s ease-in-out;
}

.custom-modal-overlay.show {
  visibility: visible;
  opacity: 1;
}

.custom-modal-container {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%; /* Responsive width */
  max-width: 450px; /* Max width for larger screens */
  padding: 25px;
  text-align: center;
  transform: translateY(-20px); /* Slight animation effect */
  transition: transform 0.3s ease-out;
}

.custom-modal-overlay.show .custom-modal-container {
  transform: translateY(0);
}

.custom-modal-title {
  font-size: 1.5rem;
  color: #002147;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: bold;
}

.custom-modal-message {
  font-size: 1rem;
  color: #555;
  margin-bottom: 25px;
  line-height: 1.5;
}

.custom-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.custom-modal-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-weight: 600;
}

.custom-modal-btn:hover {
  transform: translateY(-1px);
}

.custom-modal-btn-ok {
  background-color: #007bff; /* Primary blue */
  color: white;
}

.custom-modal-btn-ok:hover {
  background-color: #0056b3;
}

.custom-modal-btn-cancel {
  background-color: #6c757d; /* Grey */
  color: white;
}

.custom-modal-btn-cancel:hover {
  background-color: #5a6268;
}

/* Hide cancel button for alert-like modals */
.custom-modal-overlay.alert-mode .custom-modal-btn-cancel {
  display: none;
}


/* FOOTER */
footer {
  background-color: #002147;
  color: white;
  text-align: right;
  font-size: 0.95rem;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  flex-shrink: 0; /* Mencegah footer menyusut secara vertikal */
  height: var(--footer-height);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.footer-container {
  max-width: 1850px;
  margin: 0 auto;
  text-align: right;
  width: 100%;
  padding: 0 2rem;
}

/* RESPONSIF */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
    --footer-height: 30px;
    --main-padding-vertical: 1rem;
    --main-padding-horizontal: 1rem;
    --dashboard-gap: 1rem;
  }

  /* --- REVISI HEADER UNTUK MOBILE --- */
  header.navbar > .nav-container {
      flex-direction: column !important; /* Tumpuk logo dan navigasi secara vertikal */
      align-items: center !important; /* Pusatkan item secara horizontal */
      padding: 0.5rem 1rem !important; /* Sesuaikan padding */
  }

  .logo-wrapper {
      margin-bottom: 10px !important; /* Beri jarak di bawah logo */
      flex-shrink: 0 !important; /* Pastikan tidak menyusut */
  }

  .logo-wrapper span {
      font-size: 1.2em !important; /* Sedikit perkecil ukuran teks logo */
  }

  nav {
      width: 100% !important; /* Navigasi mengambil lebar penuh */
      justify-content: center !important; /* Pusatkan daftar navigasi */
  }

  nav ul {
      flex-direction: column !important; /* Tumpuk item navigasi secara vertikal */
      gap: 5px !important; /* Kurangi jarak antar item */
      width: 100% !important; /* Daftar navigasi mengambil lebar penuh */
      align-items: center !important; /* Pusatkan setiap item navigasi */
  }

  nav a {
      width: fit-content !important; /* Lebar tautan sesuai kontennya */
      padding: 8px 15px !important; /* Sesuaikan padding agar mudah diklik */
      font-size: 0.95rem !important; /* Sedikit perkecil ukuran font */
  }
  /* --- AKHIR REVISI HEADER --- */

  .navbar-container {
    padding: 0 1rem;
  }
  .logo-img {
    height: 24px;
  }

  .dashboard-layout {
    flex-direction: column; /* Di layar kecil, tumpuk kolom secara vertikal */
    gap: 1rem;
  }

  .explorer-panel {
    width: 100%; /* Ambil lebar penuh */
    margin-bottom: 1rem;
    padding: 1rem;
    height: auto; /* <--- PERUBAHAN: Biarkan tinggi sesuai konten, bukan 100% */
    max-height: 200px; /* <--- PERUBAHAN: Batasi tinggi agar tidak terlalu panjang, tapi bisa di-scroll */
    min-width: 0; /* Izinkan menyusut */
    overflow-y: auto; /* <--- PASTIKAN: Bisa di-scroll internal */
  }
  .explorer-top h3 {
    font-size: 1.5rem;
  }
  .explorer-list li button, .explorer-list li a {
    font-size: 0.9rem;
  }
  .uploaded-card h4 {
    font-size: 0.9rem;
  }
  .csv-preview {
    max-height: 100px; /* Di mobile, kita mungkin ingin membatasi tingginya lagi */
  }
  .export-btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  /* Styling hero-box untuk responsif */
  .right-column {
    flex: 1; /* Mengambil semua ruang vertikal yang tersisa di dashboard-layout */
    height: auto; /* <--- PERUBAHAN: Biarkan tinggi sesuai konten */
    overflow-y: auto; /* <--- KRUSIAL: Memungkinkan seluruh kolom kanan di-scroll */
    min-width: 0;
  }

  .main-display {
    padding: 1rem; /* Kurangi padding di mobile */
    min-width: 0;
    flex: 0 0 auto; /* <--- PERUBAHAN KRUSIAL: Hanya mengambil tinggi yang dibutuhkan kontennya */
    overflow-y: visible; /* <--- PERUBAHAN: Jangan sembunyikan overflow di sini */
    margin-bottom: 1.5rem; /* Tambahkan margin untuk memisahkan dari bottom-section */
  }
  .hero-box {
    padding: 0.5rem 0; /* <--- PERUBAHAN: Kurangi padding di mobile */
    flex: 0 0 auto; /* <--- PERUBAHAN KRUSIAL: Hanya mengambil tinggi yang dibutuhkan kontennya */
  }
  .hero-logo {
    max-height: 80px; /* <--- PERUBAHAN: Batasi tinggi logo lebih kecil */
  }
  .hero-box h1 {
    font-size: 1.8rem;
  }

  .bottom-section {
    margin-top: 0; /* <--- PERUBAHAN: Margin sudah di main-display, jadi ini 0 */
    min-width: 0; /* Izinkan menyusut */
  }
  .bottom-grid {
    grid-template-columns: 1fr; /* Di layar kecil, tumpuk kartu secara vertikal */
    gap: 1.5rem;
    min-width: 0; /* Izinkan menyusut */
  }
  .bottom-card h3 {
    font-size: 1.5rem;
  }
  .image-wrapper img {
    max-height: 100px; /* Sesuaikan ukuran gambar di mobile */
  }
  .upload-box {
    padding: 0.8rem;
  }
  /* Aturan #pqaUploadForm di media query agar tetap sejajar horizontal di mobile jika cukup ruang */
  #pqaUploadForm {
    flex-direction: row; /* Tetap horizontal di mobile jika ada ruang */
    flex-wrap: wrap; /* Izinkan wrapping jika tidak cukup ruang */
  }
  .pw-buttons {
    flex: 1 1 auto; /* Grup tombol bisa mengambil sisa ruang */
    justify-content: flex-end; /* Rata kanan di mobile juga */
  }
  
  /* Pastikan bottom-card juga bisa menyusut */
  .bottom-card {
    min-width: 0;
  }

  footer {
    font-size: 0.85rem;
    padding: 0.1rem 1.5rem;
  }

/* --- Custom Modal Styles (Notifikasi Elegan) --- */
/* (Bagian ini sudah ada dan tidak diubah, hanya memastikan ia tetap ada) */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it's on top of other content */
  visibility: hidden; /* Hidden by default */
  opacity: 0;
  transition: visibility 0.3s, opacity 0.3s ease-in-out;
}

.custom-modal-overlay.show {
  visibility: visible;
  opacity: 1;
}

.custom-modal-container {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%; /* Responsive width */
  max-width: 450px; /* Max width for larger screens */
  padding: 25px;
  text-align: center;
  transform: translateY(-20px); /* Slight animation effect */
  transition: transform 0.3s ease-out;
}

.custom-modal-overlay.show .custom-modal-container {
  transform: translateY(0);
}

.custom-modal-title {
  font-size: 1.5rem;
  color: #002147;
  margin-top: 0;
  margin-bottom: 15px;
  font-weight: bold;
}

.custom-modal-message {
  font-size: 1rem;
  color: #555;
  margin-bottom: 25px;
  line-height: 1.5;
}

.custom-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.custom-modal-btn {
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  font-weight: 600;
}

.custom-modal-btn:hover {
  transform: translateY(-1px);
}

.custom-modal-btn-ok {
  background-color: #007bff; /* Primary blue */
  color: white;
}

.custom-modal-btn-ok:hover {
  background-color: #0056b3;
}

.custom-modal-btn-cancel {
  background-color: #6c757d; /* Grey */
  color: white;
}

.custom-modal-btn-cancel:hover {
  background-color: #5a6268;
}

/* Hide cancel button for alert-like modals */
.custom-modal-overlay.alert-mode .custom-modal-btn-cancel {
  display: none;
}

} /* AKHIR DARI MEDIA QUERY max-width: 768px */

/* --- MEDIA QUERY UNTUK LAYAR SANGAT KECIL (Ponsel Kecil) --- */
@media (max-width: 480px) {
  :root {
    --main-padding-vertical: 0.75rem;
    --main-padding-horizontal: 0.75rem;
    --dashboard-gap: 0.75rem;
  }

  /* Header */
  header.navbar > .nav-container {
      padding: 0.5rem !important;
  }
  .logo-wrapper span {
      font-size: 1em !important; /* Lebih kecil lagi untuk teks logo */
  }
  nav a {
      font-size: 0.85rem !important; /* Lebih kecil lagi untuk tautan navigasi */
      padding: 6px 12px !important;
  }

  /* Main Container */
  main.container {
    padding: var(--main-padding-vertical) var(--main-padding-horizontal);
  }

  /* Explorer Panel */
  .explorer-panel {
    max-height: 150px; /* <--- PERUBAHAN: Batasi tinggi explorer panel lebih lanjut */
    padding: 0.8rem;
    min-width: 0; /* Izinkan menyusut */
  }
  .explorer-top h3 {
    font-size: 1.3rem;
  }
  .explorer-list li button, .explorer-list li a {
    font-size: 0.85rem;
  }
  .uploaded-card h4 {
    font-size: 0.8rem;
  }
  .csv-preview {
    max-height: 80px; /* Batasi tinggi daftar file lebih lanjut */
  }
  .export-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  /* Main Display */
  .main-display {
    padding: 0.8rem;
    min-width: 0;
    margin-bottom: 1rem; /* Sesuaikan margin untuk layar yang lebih kecil */
  }
  .hero-logo {
    max-height: 50px; /* <--- PERUBAHAN: Batasi tinggi logo lebih kecil lagi */
  }
  .hero-box h1 {
    font-size: 1.5rem;
  }
  .hero-box {
    padding: 0.25rem 0; /* <--- PERUBAHAN: Kurangi padding lebih lanjut */
  }

  /* Bottom Section */
  .bottom-card h3 {
    font-size: 1.2rem;
  }
  .image-wrapper img {
    max-height: 80px; /* Sesuaikan ukuran gambar */
  }
  
  /* Form Upload PQA */
  #pqaUploadForm {
    flex-direction: column !important; /* Pastikan label dan tombol menumpuk vertikal */
    align-items: flex-start !important; /* Rata kiri */
    gap: 0.5rem !important;
  }
  #pqaUploadForm .file-display {
    width: 100% !important; /* Label mengambil lebar penuh */
    text-align: left !important;
  }
  .pw-buttons {
    width: 100% !important; /* Tombol mengambil lebar penuh */
    justify-content: space-around !important; /* Sebarkan tombol secara merata */
  }
  #pqaUploadForm button {
    flex: 1 1 0 !important; /* Setiap tombol mengambil ruang yang sama */
    min-width: unset !important; /* Hapus batasan lebar minimum */
  }

  /* File Explorer */
  .file-explorer-container {
    min-height: 150px;
    max-height: 150px;
    padding: 8px;
  }
  .explorer-item, .explorer-folder-header {
    font-size: 0.7rem;
  }

  /* Pastikan right-column juga bisa menyusut */
  .right-column {
    min-width: 0;
  }
  
  /* Pastikan bottom-card juga bisa menyusut */
  .bottom-card {
    min-width: 0;
  }

  footer {
    font-size: 0.75rem;
    padding: 0.1rem 1rem;
  }
}

/* ==================================================================== */
/* --- FINAL FIX (ULTRA-SPESIFIK): MEMASTIKAN NAMA FILE UPLOAD BERWARNA PUTIH --- */
/* ==================================================================== */

/* Target the selected file item itself and its direct text content */
/* Ini akan menangani file yang tidak terpilih dan terpilih */
#uploadedFilesList.csv-preview .file-item,
#uploadedFilesList.csv-preview .file-item.selected-file-item {
    color: white !important;
}

/* Target all child elements within the file item (selected or not) */
#uploadedFilesList.csv-preview .file-item *,
#uploadedFilesList.csv-preview .file-item.selected-file-item * {
    color: white !important;
}

/* Target pseudo-elements (like icons) within the file item (selected or not) */
#uploadedFilesList.csv-preview .file-item::before,
#uploadedFilesList.csv-preview .file-item::after,
#uploadedFilesList.csv-preview .file-item.selected-file-item::before,
#uploadedFilesList.csv-preview .file-item.selected-file-item::after {
    color: white !important;
}

/* Target any links within the file item (selected or not) */
#uploadedFilesList.csv-preview .file-item a,
#uploadedFilesList.csv-preview .file-item a:link,
#uploadedFilesList.csv-preview .file-item a:visited,
#uploadedFilesList.csv-preview .file-item a:hover,
#uploadedFilesList.csv-preview .file-item a:active,
#uploadedFilesList.csv-preview .file-item.selected-file-item a,
#uploadedFilesList.csv-preview .file-item.selected-file-item a:link,
#uploadedFilesList.csv-preview .file-item.selected-file-item a:visited,
#uploadedFilesList.csv-preview .file-item.selected-file-item a:hover,
#uploadedFilesList.csv-preview .file-item.selected-file-item a:active {
    color: white !important;
}

/* ==================================================================== */
/* --- AKHIR FINAL FIX (ULTRA-SPESIFIK) --- */
/* ==================================================================== */
