:root { 
  --primary: #2563eb;          /* Blue Enterprise / Kota Serang */
  --primary-hover: #1d4ed8; 
  --primary-soft: #eff6ff; 
  --kir: #059669; 
  --kir-hover: #047857; 
  --kir-soft: #ecfdf5; 
  --info: #0284c7; 
  --info-hover: #0369a1; 
  --info-soft: #f0f9ff; 
  --bg: #f8fafc;               /* Slate netral modern */
  --card-bg: #ffffff; 
  --text: #0f172a;             /* Slate gelap pekat */
  --text-muted: #64748b; 
  --border: #e2e8f0;           /* Border tipis 1px halus */
  --border-strong: #cbd5e1;
  --success: #10b981; 
  --success-soft: #f0fdf4; 
  --danger: #ef4444; 
  --danger-dark: #b91c1c; 
  --danger-soft: #fef2f2; 
  --warning: #f59e0b; 
  --warning-soft: #fffbeb; 
  --indigo: #4f46e5; 
  --dark-panel: #0f172a; 
  --radius-sm: 8px;
  --radius-md: 12px; 
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif; 
  -webkit-tap-highlight-color: transparent; 
}

html, body { 
  height: 100%; 
  margin: 0; 
  padding: 0; 
}

body { 
  margin: 0;
  padding: 0;
  width: 100%;
  background-color: var(--bg); 
  background-image: none !important; /* HAPUS WATERMARK LOGO */
  color: var(--text); 
  line-height: 1.5; 
  display: flex; 
  flex-direction: column; 
  min-height: 100vh; 
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

/* Network Banner */
.network-banner { 
  background-color: #334155; 
  color: #fff; 
  font-size: 11.5px; 
  font-weight: 800; 
  text-align: center; 
  padding: 10px 12px; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  gap: 6px; 
}
.network-banner.offline { 
  background-color: var(--danger-dark); 
  display: flex; 
  position: sticky; 
  top: 0; 
  z-index: 9999; 
  box-shadow: var(--shadow-md); 
}
.network-banner.queue { 
  background-color: var(--warning); 
  display: flex; 
  color: #000; 
  flex-wrap: wrap; 
  z-index: 9999; 
}

/* Header */
header.app-header-nav { 
  background: var(--card-bg); 
  border-bottom: 1px solid var(--border); 
  box-shadow: var(--shadow-sm); 
  position: sticky; 
  top: 0; 
  z-index: 100; 
}
.app-header-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.app-header-logo {
  height: 38px;
  width: auto;
  max-width: 45px;
  object-fit: contain;
  flex-shrink: 0;
}
.app-header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.app-header-subtitle {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

/* Main Container */
.main-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 16px 16px 90px 16px;
}
.content-card { 
  background: var(--card-bg); 
  border: 1px solid var(--border); 
  border-radius: var(--radius-md); 
  padding: 20px 16px; 
  box-shadow: var(--shadow-sm); 
  transition: all 0.2s ease; 
}

/* Hero Section */
.beranda-hero { 
  text-align: center; 
  padding: 20px 16px; 
  background: var(--card-bg); 
  color: var(--text); 
  border-radius: var(--radius-md); 
  margin-bottom: 16px; 
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hero-title { 
  font-size: 18px; 
  font-weight: 900; 
  margin: 0 0 6px 0; 
  color: var(--text);
}
.hero-subtitle { 
  font-size: 12.5px; 
  color: var(--text-muted); 
  line-height: 1.5; 
  margin: 0; 
}

/* Stat Cards */
.beranda-stats { 
  margin-bottom: 16px; 
}
.stat-card { 
  position: relative; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 18px 20px; 
  border-radius: var(--radius-md); 
  color: white; 
  margin-bottom: 12px; 
  box-shadow: var(--shadow-md); 
}
.blue-gradient { 
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%); 
} 
.orange-gradient { 
  background: linear-gradient(135deg, #ea580c 0%, #d97706 100%); 
}
.stat-icon { 
  font-size: 24px; 
  background: rgba(255,255,255,0.18); 
  width: 48px; 
  height: 48px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: var(--radius-sm); 
  flex-shrink: 0; 
}
.stat-info { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  margin-left: 16px; 
}
.stat-label { 
  font-size: 10px; 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
  font-weight: 800; 
  opacity: 0.9; 
  margin-bottom: 4px; 
}
.stat-value { 
  font-size: 30px; 
  font-weight: 900; 
  line-height: 1; 
  letter-spacing: -0.5px; 
}
.btn-refresh-dash { 
  position: absolute; 
  right: 16px; 
  top: 16px; 
  background: rgba(255,255,255,0.2); 
  border: none; 
  color: white; 
  border-radius: 50%; 
  width: 32px; 
  height: 32px; 
  font-size: 12px; 
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  transition: background 0.2s;
}
.btn-refresh-dash:hover {
  background: rgba(255,255,255,0.3);
}

/* Search Bar */
.smart-search-container { position: relative; margin-bottom: 16px; width: 100%; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute !important; left: 16px !important; top: 50% !important; transform: translateY(-50%) !important; color: var(--text-muted) !important; font-size: 15px !important; pointer-events: none !important; }
.smart-search-input { width: 100%; padding: 12px 40px 12px 42px !important; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; background: #ffffff; border: 1px solid var(--border-strong); outline: none; color: var(--text); transition: all 0.2s; }
.smart-search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.smart-search-input::placeholder { color: #94a3b8; font-weight: 500; }
.btn-clear-search { position: absolute !important; right: 10px !important; top: 50% !important; transform: translateY(-50%) !important; background: none; border: none; color: var(--text-muted); padding: 8px; cursor: pointer; font-size: 14px; }

.smart-search-dropdown { position: absolute; top: calc(100% + 6px); left: 0; width: 100%; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 500; overflow: hidden; display: flex; flex-direction: column; }
.smart-search-results { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.smart-search-item { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.smart-search-item:hover, .smart-search-item:active { background: var(--bg); }
.smart-search-item:last-child { border-bottom: none; }
.ss-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--bg); border: 1px solid var(--border); margin-right: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 18px; }
.ss-info { flex: 1; min-width: 0; }
.ss-kode { font-family: monospace; font-size: 11px; font-weight: 800; color: var(--primary); margin-bottom: 2px; display: block; }
.ss-nama { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.smart-search-footer { padding: 10px; font-size: 10.5px; text-align: center; color: var(--text-muted); background: var(--bg); border-top: 1px solid var(--border); font-weight: 700; }

.section-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; font-weight: 800; }

/* ==========================================
   KONTENER GRID MENU PETUGAS (2 KOLOM SERAGAM)
   ========================================== */
.menu-petugas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

/* Sub-header Kategori Menu */
.menu-section-title {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 10px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}

/* KARTU TOMBOL MENU (AFFORDANCE & TOUCH-FRIENDLY) */
.btn-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 800;
  font-size: 12px;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: var(--shadow-md);
  min-height: 96px;
  text-align: center;
  gap: 8px;
  line-height: 1.25;
}

.btn-menu-card:active {
  transform: scale(0.96);
  opacity: 0.92;
  box-shadow: var(--shadow-sm);
}

.btn-menu-card i {
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* SKEMA WARNA HIGH CONTRAST */
.btn-theme-amber { background: linear-gradient(135deg, #d97706, #b45309); }
.btn-theme-cyan { background: linear-gradient(135deg, #0284c7, #0369a1); }
.btn-theme-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.btn-theme-emerald { background: linear-gradient(135deg, #059669, #047857); }
.btn-theme-teal { background: linear-gradient(135deg, #0d9488, #0f766e); }
.btn-theme-indigo { background: linear-gradient(135deg, #4f46e5, #4338ca); }

/* Area Tombol Akun & Logout */
.menu-petugas-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}

/* Animations & Badges */
.fade-in { animation: fadeIn 0.25s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.badge-stat-btn {
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 10px 14px; 
  border-radius: var(--radius-sm); 
  width: 100%; 
  box-sizing: border-box; 
  transition: opacity 0.2s;
  border: 1px solid transparent;
}
.badge-stat-btn:hover { opacity: 0.85; }

.badge-baik { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.badge-ringan { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge-berat { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Filter Card */
.filter-compact-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.filter-compact-card h3 { font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; text-transform: uppercase; }

.card-title { margin-bottom: 16px; }
.card-title h2 { font-size: 16px; color: var(--text); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.card-title p { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

/* Scanner Box */
.scanner-box { width: 100%; display: flex; flex-direction: column; align-items: center; transition: all 0.3s ease; }
#reader__dashboard, #reader__dashboard_section, #reader__status_span, #reader img, #reader__scan_region img, #reader__dashboard_section_csr { display: none !important; }

#reader { border: none !important; border-radius: var(--radius-md) !important; overflow: hidden !important; background-color: var(--dark-panel) !important; padding: 0 !important; width: 100% !important; box-shadow: var(--shadow-md) !important; }
#reader video { object-fit: cover !important; width: 100% !important; max-height: 280px !important; border-radius: var(--radius-md) !important; }

#cameraOverlay { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: #991b1b; color: white; padding: 20px; border-radius: var(--radius-sm); text-align: center; z-index: 100; width: 90%; border: 2px solid #fca5a5; }

.scanner-controls { display: flex; justify-content: center; gap: 8px; margin-top: 14px; width: 100%; }
.switch-container { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; padding: 12px; background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.switch-container.kir-mode { background: var(--kir-soft); border-color: var(--kir); }
.switch { position: relative; display: inline-block; width: 46px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .2s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .2s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
.switch-container.kir-mode input:checked + .slider { background-color: var(--kir); }
input:checked + .slider:before { transform: translateX(24px); }
.switch-label { font-size: 12.5px; font-weight: 700; color: var(--text); }

#batchResultContainer { display: none; width: 100%; margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
#batchResultContainer.active { display: block; }
.batch-header { background: var(--bg); padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 800; }
.batch-list { max-height: 200px; overflow-y: auto; padding: 0; margin: 0; list-style: none; }
.batch-item { padding: 10px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }

/* Buttons */
.btn { border: none; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; letter-spacing: 0.2px; }
.btn:active { opacity: 0.88; transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-kir { background-color: var(--kir); color: white; }
.btn-info { background-color: var(--info); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-danger-dark { background-color: var(--danger-dark); color: white; }
.btn-dark { background-color: var(--dark-panel); color: white; }
.btn-success { background-color: var(--success); color: white; }
.btn-indigo { background-color: var(--indigo); color: white; }
.btn-warning { background-color: var(--warning); color: #000; }

#btnStopCamera {
  background: #1e293b !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: var(--shadow-sm) !important;
}

.divider { position: relative; text-align: center; margin: 20px 0 14px 0; width: 100%; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: var(--border); }
.divider span { position: relative; background: var(--card-bg); padding: 0 10px; font-size: 10.5px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }

.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; outline: none; background: #ffffff; color: var(--text); transition: border-color 0.2s; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.info-card { background-color: transparent; border: none; border-radius: 0; padding: 0; }
.info-badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase; }
.status-good { background-color: var(--success); color: white; }
.status-bad { background-color: var(--danger-dark); color: white; }

.asset-section-card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.asset-section-title { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

.info-detail-grid { display: flex; flex-direction: column; gap: 8px; }
.info-item-clean { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.info-item-clean:last-child { border-bottom: none; padding-bottom: 0; }
.info-label-clean { font-size: 10px; color: var(--text-muted); font-weight: 800; text-transform: uppercase; display: flex; align-items: center; gap: 5px; letter-spacing: 0.3px; }
.info-value-clean { font-size: 13.5px; font-weight: 700; color: var(--text); word-break: break-word; }
.code-highlight { font-family: monospace; color: var(--primary); font-size: 12px; font-weight: 800; display: block; white-space: nowrap; overflow-x: auto; }

/* Modals */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.65); backdrop-filter: blur(2px); z-index: 2000; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity 0.2s; }
.modal.show { display: flex; opacity: 1; }
.modal-box { background: white; border-radius: var(--radius-md); padding: 20px; width: 100%; max-width: 400px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

/* FAB & Bottom Sheet Admin */
.fab-admin { position: fixed; bottom: 85px; right: 20px; width: 52px; height: 52px; background: var(--dark-panel); color: white; border-radius: 50%; align-items: center; justify-content: center; font-size: 18px; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; z-index: 1000; display: none; box-shadow: var(--shadow-lg); }
.fab-admin:active { transform: scale(0.92); }
.bottom-sheet-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1500; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet { position: fixed; bottom: -100%; left: 0; width: 100%; background: white; border-top-left-radius: 20px; border-top-right-radius: 20px; padding: 20px; z-index: 1501; transition: bottom 0.25s ease-out; max-width: 500px; left: 50%; transform: translateX(-50%); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.bottom-sheet.active { bottom: 0; }
.sheet-handle { width: 36px; height: 4px; background: var(--border-strong); border-radius: 2px; margin: 0 auto 16px auto; }

.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 4px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Bottom Nav Bar (Mobile) */
.gopay-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0 12px 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
  z-index: 1000;
}

.gopay-bottom-nav.hidden-mode {
  display: none !important;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  gap: 4px;
  transition: color 0.15s;
  flex: 1;
}

.nav-item i {
  font-size: 20px;
}

.nav-item.active {
  color: var(--primary);
}

#toastBox { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); background-color: var(--dark-panel); color: white; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 700; z-index: 9999; opacity: 0; pointer-events: none; text-align: center; white-space: nowrap; transition: all 0.2s ease-out; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,0.1); box-shadow: var(--shadow-lg); }
#toastBox.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toastBox.success { background-color: var(--success); }
#toastBox.error { background-color: var(--danger-dark); }

.kamera-container { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-sm); }
.bingkai-scanner { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 200px; height: 200px; pointer-events: none; z-index: 10; }
.bingkai-scanner::before, .bingkai-scanner::after, .bingkai-scanner-inner::before, .bingkai-scanner-inner::after { content: ""; position: absolute; width: 36px; height: 36px; border-color: #10b981; border-style: solid; border-width: 0; }
.bingkai-scanner::before { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.bingkai-scanner::after { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.bingkai-scanner-inner::before { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.bingkai-scanner-inner::after { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }
.garis-laser { position: absolute; top: 0; left: 2%; width: 96%; height: 2px; background: #10b981; box-shadow: 0 0 8px #10b981; animation: scanLaser 2s infinite alternate ease-in-out; }
@keyframes scanLaser { 0% { top: 0px; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 200px; opacity: 0; } }

/* Responsive Grid & List Items */
.view-list { display: flex !important; flex-direction: column !important; gap: 8px !important; width: 100% !important; }
.view-list .card-item-layout { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.15s; width: 100%; box-sizing: border-box; }
.view-list .card-item-layout:active { transform: scale(0.98); }
.view-list .card-img-wrapper { position: relative; width: 48px !important; height: 48px !important; flex-shrink: 0; }
.view-list .card-item-img { width: 48px !important; height: 48px !important; border-radius: 6px; object-fit: cover; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; }

.view-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; width: 100% !important; }
.view-grid .card-item-layout { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; align-items: flex-start; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform 0.15s; width: 100% !important; overflow: hidden !important; }
.view-grid .card-item-layout:active { transform: scale(0.98); }
.view-grid .card-img-wrapper { position: relative; width: 100% !important; height: 90px !important; margin-bottom: 8px; flex-shrink: 0; }
.view-grid .card-item-img { width: 100% !important; height: 90px !important; border-radius: 6px; object-fit: cover; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; }

.card-tag-merk { font-size: 10px !important; font-weight: 800 !important; color: #059669 !important; text-transform: uppercase !important; margin-bottom: 2px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }
.card-title-nama { font-size: 12.5px !important; font-weight: 800 !important; color: #0f172a !important; line-height: 1.3 !important; margin-bottom: 2px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }
.view-grid .card-title-nama { display: -webkit-box !important; -webkit-line-clamp: 2 !important; -webkit-box-orient: vertical !important; white-space: normal !important; }
.card-code-barang { font-size: 10px !important; font-family: monospace !important; color: #0284c7 !important; font-weight: 700 !important; margin-bottom: 2px !important; line-height: 1.25 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }
.card-location-text { font-size: 10px !important; font-weight: 700 !important; color: #64748b !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; width: 100% !important; }

#btnToggleLayoutSearch { width: 36px !important; height: 36px !important; padding: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; border-radius: 6px !important; font-size: 14px !important; }

#reader__scan_region, #reader__scan_region * { border: none !important; box-shadow: none !important; outline: none !important; }
#reader__scan_region img, #reader__scan_region svg { display: none !important; }

/* ==========================================
   DESKTOP OPTIMIZATIONS (min-width: 768px)
   ========================================== */
@media screen and (min-width: 768px) {
  /* Sembunyikan Navigasi Bawah di Desktop */
  .gopay-bottom-nav {
    display: none !important;
  }
  
  .main-container { 
    max-width: 768px; 
    padding: 24px 20px 40px 20px !important; /* Hapus ruang kosong bawah */
  }
  
  .app-header-container {
    max-width: 768px;
    padding: 14px 20px;
    gap: 16px;
  }
  
  .app-header-logo {
    height: 44px;
    max-width: 55px;
  }
  
  .app-header-title {
    font-size: 20px;
  }
  
  .app-header-subtitle {
    font-size: 9px;
  }

  .beranda-stats { 
    display: flex; 
    gap: 14px; 
  }
  
  .beranda-stats .stat-card { 
    flex: 1; 
    margin-bottom: 0 !important; 
  }

  .view-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .view-grid .card-img-wrapper,
  .view-grid .card-item-img {
    height: 110px !important;
  }

  .scanner-box { 
    max-width: 480px; 
    margin: 0 auto; 
    padding: 20px; 
    border: 1px solid var(--border); 
    border-radius: var(--radius-md); 
    background: #ffffff; 
    box-shadow: var(--shadow-sm);
  }
  
  .info-detail-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px 16px; 
  }
}

/* Pengaturan Posisi Header & Tombol Hamburger */
.app-header-container {
  justify-content: space-between !important;
}

.btn-hamburger {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-hamburger:active {
  background: var(--bg);
}

/* Perbaikan Tampilan Floating Dropdown Hamburger */
.top-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 16px;              /* Menempel melayang di pojok kanan di bawah tombol */
  left: auto;
  width: 220px;             /* Lebar menu yang ideal */
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  padding: 8px 0;
  z-index: 9999;            /* Memastikan menu tampil paling depan */
  overflow: hidden;
}

.top-dropdown-menu.show {
  display: flex;
  flex-direction: column;
}

.top-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

/* 🌟 TAMBAHKAN BLOK KODE INI UNTUK MERAPIKAN ALIGNMENT TEKS */
.top-dropdown-menu a i {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
}

.top-dropdown-menu a:hover {
  background: #f1f5f9;
  color: var(--primary, #2563eb);
}

/* ==========================================
   NAVIGASI KHUSUS DESKTOP (HAMBURGER MENU)
   ========================================== */

/* 1. Secara default di HP: Sembunyikan Tombol Hamburger & Dropdown */
.btn-hamburger,
.top-dropdown-menu {
  display: none !important;
}

/* 2. Khusus Tampilan Desktop (Layar Laptop/PC >= 768px): Tampilkan Hamburger Menu */
@media screen and (min-width: 768px) {
  .btn-hamburger {
    display: flex !important;
  }
  
  .top-dropdown-menu.show {
    display: flex !important;
  }
}

/* PENAMBAHAN PERBAIKAN: blok duplikat berhasil dibuang */

/* ==========================================
   2. IKON COPY KODE BARANG
   ========================================== */
.btn-copy-icon {
  cursor: pointer !important;
  margin-left: 6px;
  padding: 2px 5px;
  color: var(--text-muted);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-copy-icon:hover {
  color: var(--primary);
  background-color: var(--primary-soft);
}

.btn-copy-icon:active {
  transform: scale(0.85);
}

/* Helper Styling & Status Classes Global */
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-danger { color: var(--danger) !important; }
.uppercase { text-transform: uppercase; }

.modal-title { font-size: 16px; margin-bottom: 6px; color: var(--text); display: flex; align-items: center; gap: 8px; font-weight: 800; }
.modal-subtext { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.4; }
.modal-footer { display: flex; gap: 8px; margin-top: 16px; }
.modal-footer .btn { flex: 1; }

.form-group { margin-bottom: 12px; }
.form-group label { font-size: 11.5px; font-weight: 700; display: block; margin-bottom: 4px; color: var(--text); }
.form-control-file { width: 100%; padding: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 12px; background: var(--bg); color: var(--text-muted); }

/* Card Laporan Item */
.laporan-card { background: #ffffff; border-radius: 10px; padding: 15px; margin-bottom: 12px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary); }
.laporan-card.berat { border-left-color: var(--danger); }
.laporan-card.ringan { border-left-color: var(--warning); }
.laporan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.laporan-body { font-size: 12.5px; color: var(--text); background: var(--bg); padding: 10px; border-radius: 6px; border: 1px solid var(--border); font-style: italic; margin-bottom: 12px; }

/* ==========================================
   PERBAIKAN STICKY RKBMD & KIR DIGITAL (ANTI TEMBUS)
   ========================================== */

/* 🌟 STICKY HEADER KIR DIGITAL (DINDING PUTIH PEKAT ANTI TEMBUS) */
/* Sub-Header KIR Digital: Nempel pas di puncak layar HP */
/* 🌟 KUNCI STICKY KIR DIGITAL (PAS MENEMPEL DI PUNCAK LAYAR HP) */
.kir-header-sticky {
  position: sticky;
  top: 0 !important;             /* Tempelkan pas di puncak layar HP */
  z-index: 100;
  background: #ffffff !important;
  padding: 14px 16px 10px 16px;
  margin: -14px -16px 12px -16px; /* Samakan offset dengan RKBMD */
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

/* 🌟 KUNCI STICKY RKBMD (SEJAJAR PRESISI DENGAN KIR) */
.rkbmd-header-sticky {
  position: sticky;
  top: 0 !important;             /* Tempelkan pas di puncak layar HP */
  z-index: 100;
  background: #ffffff !important;
  padding: 14px 16px 10px 16px;
  margin: -14px -14px 12px -14px;
  border-bottom: 2px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
/* 🌟 CONTAINER TABEL RKBMD (SCROLL BOX INTERNAL LAYAR HP) */
.rkbmd-table-container {
  max-height: calc(100vh - 320px); /* Batas tinggi area scroll tabel di HP */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  position: relative;
}

/* 🌟 HEADER TABEL RKBMD (TERKUNCI DI DALAM TABELNYA SENDIRI) */
.rkbmd-table-container table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f172a !important; /* Latar gelap pekat agar baris tabel tidak tembus */
  color: #ffffff;
}

/* Penyesuaian saat mode Scan QR Langsung (Tanpa Header SI-ACEP) */
html.direct-scan-mode .rkbmd-header-sticky,
html.direct-scan-mode .kir-header-sticky {
  top: 0 !important;
}

/* 🌟 CONTAINER DAFTAR ASET KIR DIGITAL (SCROLL INTERNAL - PERSIS RKBMD) */
#wrapperKIRDetailContent {
  max-height: calc(100vh - 360px);   /* Batas tinggi area scroll di HP */
  overflow-y: auto !important;       /* Hanya daftar barang yang bisa di-scroll */
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px;
  border-radius: 8px;
}


/* Fix Posisi FAB Admin di Layar Komputer/Desktop agar tidak lepas dari container */
@media screen and (min-width: 768px) {
  .fab-admin {
    right: calc(50% - 370px) !important;
  }
}

/* ==========================================
   TAMBAHAN THEME: DARK / LIGHT MODE (FULL MOBILE SUPPORT)
   ========================================== */

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-strong: #475569;
  --primary-soft: #1e3a8a;
  --kir-soft: #064e3b;
  --info-soft: #082f49;
  --success-soft: #052e16;
  --danger-soft: #450a0a;
  --warning-soft: #451a03;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.55), 0 2px 4px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] body { background-color: #0f172a; color: #f1f5f9; }
[data-theme="dark"] header.app-header-nav { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .gopay-bottom-nav { background: #1e293b; border-top-color: #334155; box-shadow: 0 -2px 10px rgba(0,0,0,0.35); }
[data-theme="dark"] .nav-item { color: #94a3b8; }
[data-theme="dark"] .nav-item.active { color: #60a5fa; }

[data-theme="dark"] .smart-search-input { background: #0f172a; color: #f1f5f9; }
[data-theme="dark"] .smart-search-dropdown { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .smart-search-item:hover,
[data-theme="dark"] .smart-search-item:active { background: #334155; }

[data-theme="dark"] .form-control { background: #0f172a; color: #f1f5f9; border-color: #475569; }
[data-theme="dark"] .asset-section-card,
[data-theme="dark"] .laporan-card,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .bottom-sheet,
[data-theme="dark"] .scanner-box { background: #1e293b; border-color: #334155; color: #f1f5f9; }

/* Kartu Aset Grid & List di HP */
[data-theme="dark"] .view-list .card-item-layout,
[data-theme="dark"] .view-grid .card-item-layout { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .card-title-nama { color: #f1f5f9 !important; }
[data-theme="dark"] .card-location-text { color: #94a3b8 !important; }

/* Dropdown Menu */
[data-theme="dark"] .top-dropdown-menu { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .top-dropdown-menu a { color: #e2e8f0; }
[data-theme="dark"] .top-dropdown-menu a:hover { background: #334155; color: #60a5fa; }

/* Sticky Header & Tabel KIR / RKBMD */
[data-theme="dark"] .kir-header-sticky,
[data-theme="dark"] .rkbmd-header-sticky,
[data-theme="dark"] .rkbmd-table-container { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] #kirBoxPilihRuangan { background: #0f172a !important; border-color: #334155 !important; }
[data-theme="dark"] #kirBoxPilihRuangan label,
[data-theme="dark"] .kir-header-sticky h2,
[data-theme="dark"] .rkbmd-header-sticky h2,
[data-theme="dark"] #judulHalamanSearch { color: #f1f5f9 !important; }

/* Detail Aset (Menimpa inline background:#fff dari app.js) */
[data-theme="dark"] #infoDetailAset > div { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] #infoDetailAset > div > div { background: #1e293b !important; border-bottom-color: #334155 !important; }
[data-theme="dark"] #infoDetailAset span[style*="color: #0f172a"] { color: #f1f5f9 !important; }
[data-theme="dark"] #infoDetailAset span[style*="color: #64748b"] { color: #94a3b8 !important; }
[data-theme="dark"] #infoDetailAset div[style*="background:#f8fafc"],
[data-theme="dark"] #infoDetailAset div[style*="background: #f8fafc"] { background: #0f172a !important; }

/* Tombol Toggle Tema (Ukuran Terkunci Anti-Hilang) */
.btn-theme-toggle {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-theme-toggle:active { transform: scale(0.94); }
