body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  /*display: flex;*/
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 10px;
}

.box {
  background: rgb(250, 230, 208, 0.9);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 300px;
}

input {
  width: 100%;
  padding: 10px;
  margin: 5px 0 15px 0;
  box-sizing: border-box;
}

button {
  width: 100%;
  padding: 10px;
  background-color: #28a745;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

button:hover {
  background-color: #218838;
}

.error {
  color: red;
  font-size: 12px;
}
.success {
  color: green;
  font-size: 12px;
}

/* Styling untuk Index */
.container {
  text-align: center;
  background: rgb(130, 110, 235);
  padding: 50px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.logout-btn {
  background-color: #dc3545;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
}
.logout-btn:hover {
  background-color: #c82333;
}

/* Styling untuk Logo */
/*.logo {
  width: 80px; /* Ukuran lebar logo */
/* margin-bottom: 15px; /* Jarak ke bawah (ke judul) */
/* display: block;
  margin-left: auto; /* Posisi tengah */
/*margin-right: auto; /* Posisi tengah */
/*}

/* 1. Styling Logo Sejajar dengan Judul (Login & Register) */
.header-box {
  display: flex; /* Membuat elemen sejajar kesamping */
  align-items: center; /* Posisi tegak lurus (tengah) */
  justify-content: center; /* Posisi horizontal (tengah) */
  margin-bottom: 20px; /* Jarak ke form di bawahnya */
}

.header-box .logo {
  width: 80px; /* Ukuran logo (kecil) */
  height: auto;
  margin-right: 15px; /* Jarak logo ke tulisan */
}

.header-box h2 {
  margin: 0; /* Hilangkan margin bawaan h2 */
  font-size: 24px;
}

/* 2. Styling Latar Belakang Index */
body.bg-login {
  background-size: cover; /* Gambar menutupi seluruh layar */
  background-position: center; /* Gambar di tengah */
  background-repeat: no-repeat;
  background-attachment: fixed; /* Gambar diam saat di-scroll (efek parallax) */
  /* Hapus baris background-image dari sini karena sudah dihandle oleh PHP */
}

/* Agar kotak di index transparan agar background kelihatan */
.container {
  /* Mengubah warna putih jadi transparan putih */
  background: rgba(134, 238, 129, 0.9);
  /* 0.9 artinya 90% transparan, ubah jadi 0.8 jika ingin lebih tembus pandang */
}

body.bg-register {
  background-image: url("Jeri3.jpg"); /* Nama file gambar Anda */
  background-size: cover; /* Gambar menutupi seluruh layar */
  background-position: center; /* Gambar di tengah */
  background-repeat: no-repeat;
  background-attachment: fixed; /* Gambar diam saat di-scroll (efek parallax) */
}

/* Agar kotak di index transparan agar background kelihatan */
.container {
  /* Mengubah warna putih jadi transparan putih */
  background: rgba(134, 238, 129, 0.9);
  /* 0.9 artinya 90% transparan, ubah jadi 0.8 jika ingin lebih tembus pandang */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background-color: #ecf0f1;
}

/* Layout */
.sidebar {
  width: 280px;
  height: 100vh;
  background-color: var(--primary);
  position: fixed;
  left: 0;
  top: 0;
  color: white;
  padding-top: 20px;
  overflow-y: auto;
  z-index: 1000;
}
.sidebar h2 {
  text-align: center;
  font-size: 1.1rem;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 20px;
}
.sidebar a {
  display: block;
  color: #dcdcdc;
  text-decoration: none;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar a:hover {
  background-color: #002244;
  color: white;
}
.sidebar a.active {
  background-color: var(--info);
  color: white;
  font-weight: bold;
}

.main-content {
  margin-left: 280px;
  padding: 20px;
}

/* Header */
.page-header {
  background: white;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-info h1 {
  margin: 0;
  color: var(--primary);
  font-size: 1.4rem;
}

/* Bandara Display */
.bandara-display {
  background: #e9ecef;
  padding: 10px 15px;
  border-radius: 5px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary);
}
.bandara-display h4 {
  margin: 0 0 5px 0;
  color: var(--primary);
}

.card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}
.card-title {
  font-size: 1.1rem;
  font-weight: bold;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 15px;
  color: var(--primary);
  display: flex;
  justify-content: space-between;
}

/* --- GRID SYSTEM YANG DIPERBAIKI (RESPONSIF & AMAN) --- */
.grid-2 {
  display: grid;
  /* 2 kolom, minimal lebar 250px, jika layar sempit otomatis turun ke bawah */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 15px;
}

.grid-3 {
  display: grid;
  /* 3 kolom, minimal lebar 220px agar input teks muat */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.grid-4 {
  display: grid;
  /* 4 kolom, minimal lebar 200px */
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.grid-5 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.grid-6 {
  display: grid;
  /* 6 kolom, minimal lebar 160px (cocok untuk dashboard angka) */
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

/* --- FORM CONTROL (PASTIKAN INI BENAR) --- */
.form-group {
  margin-bottom: 15px;
  width: 100%; /* Pastikan group mengikuti lebar grid */
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.form-control {
  width: 100%; /* Ini sudah benar */
  max-width: 100%; /* TAMBAHAN PENTING: Cegah overflow */
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* PENTING: Agar padding tidak menambah lebar */
  font-size: 14px;
}

/* Input Read Only */
.form-control-read-only {
  background-color: #f1f1f1;
}
/* Perbaikan khusus untuk container Flex di dalam form-group (misal input Tanggal + Tombol) */
.form-group > div[style*="display: flex"] {
  display: flex !important;
  flex-wrap: wrap !important; /* Agar turun ke bawah di layar HP */
  gap: 5px !important;
  width: 100%;
}

.form-group > div[style*="display: flex"] input,
.form-group > div[style*="display: flex"] button,
.form-group > div[style*="display: flex"] select {
  flex: 1 1 auto; /* Mengisi sisa ruang */
}
/* Status */
.status-badge {
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  min-width: 60px;
  text-align: center;
  display: inline-block;
}
.pass {
  background-color: #d4edda;
  color: #155724;
}
.fail {
  background-color: #f8d7da;
  color: #721c24;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}
th {
  background-color: #f8f9fa;
  color: #333;
}
.comparison-table input {
  width: 100%;
  padding: 5px;
}
.comparison-table .std-col {
  color: var(--grey);
  font-style: italic;
  font-size: 0.85rem;
}

/* Row grouping style */
.shift-group {
  background-color: #f1f8ff;
  font-weight: bold;
}

.btn {
  padding: 8px 15px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  color: white;
  background-color: var(--primary);
  font-weight: bold;
  font-size: 0.9rem;
}
.btn:hover {
  opacity: 0.9;
}
.btn-success {
  background-color: var(--success);
}
.btn-warning {
  background-color: var(--warning);
  color: #333;
}

/* Info Box Dashboard */
.info-box {
  padding: 20px;
  border-radius: 8px;
  color: white;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.info-box h3 {
  margin: 0;
  font-size: 1.8rem;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #printArea,
  #printArea * {
    visibility: visible;
  }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin-left: 0;
  }
  .no-print {
    display: none !important;
  }
  .sidebar {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
}

/* CSS Modal */
.modal-bg {
  display: none; /* Tersembunyi secara default */
  position: fixed;
  z-index: 2000; /* Paling atas */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6); /* Latar belakang gelap transparan */
}

.modal-content {
  background-color: #fff;
  margin: 5% auto; /* Jarak dari atas */
  padding: 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 800px; /* Lebar maksimal */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-header {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 1.3rem;
}

.modal-close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.modal-close:hover {
  color: black;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 Kolom */
  gap: 10px;
  font-size: 0.9rem;
}
@media (max-width: 600px) {
  .detail-grid {
    grid-template-columns: 1fr;
  } /* 1 Kolom di HP */
}

.detail-item {
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
}
.detail-label {
  font-weight: bold;
  color: #555;
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.detail-value {
  color: #000;
  font-size: 1rem;
}

.section-title-modal {
  grid-column: 1 / -1; /* Lebarkan penuh */
  background: #f0f4f8;
  padding: 8px 15px;
  margin-top: 15px;
  font-weight: bold;
  color: var(--primary);
  border-left: 4px solid var(--info);
  border-radius: 4px;
}

/* === CUSTOM CSS UNTUK SISTEM ARFF === */

:root {
  --primary: #003366;
  --secondary: #f0f4f8;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --grey: #6c757d;
}

/* CSS untuk Tanda Tangan & Foto */
.signature-container {
  border: 2px dashed #ccc;
  background: #f9f9f9;
  position: relative;
}
#signature-canvas {
  width: 100%; /* Memenuhi lebar layar HP */
  max-width: 500px; /* Agar tidak terlalu lebar di tablet/iPad */
  height: 200px; /* Tinggi tetap, tapi bisa diubah pakai vw (misal: 30vw) */
  border: 2px dashed #ccc;
  border-radius: 8px;
  background-color: #fff;
  touch-action: none; /* SANGAT PENTING: Mencegah scroll saat menggambar di HP */
  display: block;
  margin: 0 auto;
}
.foto-preview {
  width: 150px;
  height: 180px;
  object-fit: cover;
  border: 2px solid #003366;
  border-radius: 5px;
}
.btn-clear-sign {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #dc3545;
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* === TOMBOL AKSI RIWAYAT INSPEKSI (KOMPAT) === */
.tombol-aksi {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px !important;
  height: 30px !important;
  padding: 0 !important;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  margin: 0 2px;
}
.tombol-aksi:hover {
  transform: scale(1.15);
  filter: brightness(1.1);
}
.tombol-aksi.aksi-edit {
  background: #ffc107 !important;
  color: #333 !important;
}
.tombol-aksi.aksi-hapus {
  background: #dc3545 !important;
  color: #fff !important;
}
.tombol-aksi.aksi-cetak {
  background: #17a2b8 !important;
  color: #fff !important;
}
.tombol-aksi.aksi-korektif {
  background: #6f42c1 !important;
  color: #fff !important;
}
.tombol-aksi.aksi-selesai {
  background: #28a745 !important;
  color: #fff !important;
}
.tombol-aksi.aksi-tolak {
  background: #6c757d !important;
  color: #fff !important;
}

/* Batas lebar kolom aksi */
#tabelLaporan th:last-child,
#tabelLaporan td:last-child {
  width: auto !important;
  min-width: 120px !important;
  white-space: nowrap;
}
/* ==========================================
   RESPONSIVE & MOBILE FIRST (PWA)
   ========================================== */
@media screen and (max-width: 768px) {
  .sidebar {
    width: 100% !important;
    height: auto !important;
    position: relative !important;
    display: none; /* Sidebar disembunyikan di HP */
  }
  .sidebar.active-mobile {
    display: block; /* Muncul jika tombol menu diklik */
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 15px !important;
  }
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr !important; /* Kolom jadi 1 di HP */
  }
  /* Tampilkan Tombol Menu Hamburger di HP */
  .mobile-menu-btn {
    display: block !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #003366;
    color: white;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    cursor: pointer;
  }
  .page-header h1 {
    font-size: 1.2rem !important;
  }
  .comparison-table {
    font-size: 0.8rem;
  }
  .comparison-table th,
  .comparison-table td {
    padding: 5px !important;
  }
  .tombol-aksi {
    width: 35px;
    height: 35px;
  }
}

/* Sembunyikan tombol menu jika di layar komputer */
.mobile-menu-btn {
  display: none;
}
/* === CSS NOTIFIKASI PENOLAKAN ATASAN === */
.notifikasi-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  overflow: hidden;
  font-family: Arial, sans-serif;
  border: 2px solid #dc3545;
}

.notifikasi-header {
  background: #dc3545;
  color: white;
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.notifikasi-badge {
  background: white;
  color: #dc3545;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}

.notifikasi-body {
  background: #f8d7da;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #f5c6cb;
}

.notifikasi-body ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notifikasi-body ul li {
  padding: 15px;
  border-bottom: 1px solid #f5c6cb;
  background: white;
}

.notifikasi-body ul li:last-child {
  border-bottom: none;
}

.notif-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}

.notif-item-title {
  font-weight: bold;
  color: #721c24;
  font-size: 0.95rem;
}

.notif-item-date {
  font-size: 0.8rem;
  color: #6c757d;
}

.notif-item-reason {
  background: #fff3cd;
  padding: 8px;
  border-radius: 5px;
  font-size: 0.85rem;
  color: #856404;
  border-left: 4px solid #ffc107;
  margin-top: 8px;
}

.notif-btn-detail {
  margin-top: 10px;
  background: #003366;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.notif-btn-detail:hover {
  background: #004080;
}

@media (max-width: 768px) {
  .notifikasi-container {
    width: calc(100vw - 20px);
    right: 10px;
    top: 10px;
  }
}
/* =========================================
       1. STYLE TABEL (MODERN & RAPI)
       ========================================= */
#tabelLaporan {
  width: 100%;
  border-collapse: collapse; /* Menghilangkan jarak antar sel */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Bayangan halus di bawah tabel */
  background: white;
  border-radius: 8px;
  overflow: hidden; /* Melengkungkan sudut tabel */
}

/* Header Tabel */
#tabelLaporan thead {
  background-color: #2c3e50; /* Warna Biru Gelap Elegan */
  color: #ffffff;
}

#tabelLaporan th {
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.8rem;
  border-bottom: 2px solid #34495e;
}

/* Baris Data */
#tabelLaporan tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background-color 0.2s ease;
}

/* Warna Selang-seling (Zebra Striping) */
#tabelLaporan tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Efek Hover saat mouse di atas baris */
#tabelLaporan tbody tr:hover {
  background-color: #e8f4fd; /* Biru sangat muda */
  cursor: default;
}

#tabelLaporan td {
  padding: 10px 15px;
  color: #333;
  vertical-align: middle; /* Teks vertikal di tengah */
}

/* =========================================
       2. STYLE PAGINATION (TOMBOL NAVIGASI)
       ========================================= */
#paginationControls {
  display: flex;
  justify-content: flex-end; /* Taruh di kanan */
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px;
  font-family: "Segoe UI", sans-serif;
}

/* Info Halaman (Teks "Halaman 1 dari 2") */
.pagination-info {
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}

/* Tombol Pagination Default */
.btn-pag {
  background-color: #fff;
  border: 1px solid #ddd;
  color: #333;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-pag:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #ccc;
  transform: translateY(-1px);
}

/* Tombol Disabled (Abu-abu) */
.btn-pag:disabled {
  background-color: #f1f1f1;
  color: #aaa;
  cursor: not-allowed;
  border-color: #eee;
}

/* Tombol Aktif/Utama (Warna Biru sesuai tema) */
.btn-pag.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}
.btn-pag.active:hover {
  background-color: #0056b3;
}

/* =========================================
       3. STYLE BADGE STATUS (PERCANTIK YANG SUDAH ADA)
       ========================================= */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.status-badge.pass {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.fail {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Tambahan untuk tombol aksi di tabel */
.tombol-aksi {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 5px;
  border-radius: 4px;
  transition: transform 0.1s;
}
.tombol-aksi:active {
  transform: scale(0.9);
}
