@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-surface: rgba(22, 29, 49, 0.7);
  --bg-surface-solid: #161d31;
  --border-color: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-success: #10b981; /* Emerald */
  --accent-success-hover: #059669;
  --accent-warning: #f59e0b; /* Amber */
  --accent-danger: #ef4444; /* Rose */
  --font-family: 'Outfit', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius-lg: 16px;
  --border-radius-md: 12px;
  --glow-indigo: 0 0 20px rgba(99, 102, 241, 0.25);
  --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 80px; /* Space for sticky bottom nav */
}

/* Glassmorphism Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* Header */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(11, 15, 25, 0.8);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-success));
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

.brand-text h1 {
  font-size: 1.2rem;
  font-weight: 600;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.branch-badge {
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Main Container */
main {
  flex: 1;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

/* Views Wrapper */
.view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards & Glass Containers */
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--glow-indigo);
  background-color: rgba(15, 23, 42, 0.9);
}

/* Scan Input & Button Row */
.input-btn-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.input-btn-row input {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  color: white;
  box-shadow: var(--glow-indigo);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-success), var(--accent-success-hover));
  color: white;
  box-shadow: var(--glow-emerald);
}

.btn-success:hover {
  transform: translateY(-2px);
}

.btn-success:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-icon-only {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--border-radius-md);
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Toggle Switch / Checkboxes */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-top: 10px;
}

.checkbox-container input {
  display: none;
}

.checkbox-checkmark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  background-color: rgba(15, 23, 42, 0.6);
}

.checkbox-container input:checked + .checkbox-checkmark {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary);
}

.checkbox-checkmark::after {
  content: '✓';
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
  display: none;
}

.checkbox-container input:checked + .checkbox-checkmark::after {
  display: block;
}

.checkbox-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.checkbox-container input:checked ~ .checkbox-label {
  color: var(--text-primary);
}

/* Camera Barcode Container */
#scanner-container {
  display: none;
  position: relative;
  width: 100%;
  background-color: #000;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  border: 2px solid var(--accent-primary);
  box-shadow: var(--glow-indigo);
}

#reader {
  width: 100%;
  min-height: 250px;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  z-index: 10;
}

.scan-line {
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: var(--accent-primary);
  top: 0;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* Photo Capture UI */
.photo-capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.photo-box {
  border: 2.5px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition-smooth);
  background-color: rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.photo-box:hover {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

.photo-box.has-image {
  border-style: solid;
  border-color: var(--accent-success);
}

.photo-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--border-radius-md) - 3px);
}

.photo-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
  color: var(--text-secondary);
}

.photo-box.has-image .photo-label {
  display: none;
}

.photo-icon {
  font-size: 1.8rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.photo-box:hover .photo-icon {
  color: var(--accent-primary);
  transform: scale(1.1);
}

.photo-box.has-image .photo-icon {
  display: none;
}

.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* GPS Badge */
.gps-badge {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.gps-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gps-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  position: relative;
}

.gps-dot.acquiring {
  background-color: var(--accent-warning);
  animation: pulse 1.5s infinite;
}

.gps-dot.success {
  background-color: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
}

.gps-dot.failed {
  background-color: var(--accent-danger);
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.gps-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.gps-coords {
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text-primary);
}

/* History Logs */
.log-item {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  position: relative;
}

.log-images {
  display: flex;
  gap: 6px;
}

.log-thumbnail {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: #000;
}

.log-details {
  flex: 1;
  min-width: 0; /* Prevents overflow */
}

.log-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.log-eq {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.log-eq.no-eq {
  color: var(--accent-warning);
}

.log-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.log-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-badge-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.log-city-badge {
  background-color: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-gps-badge {
  background-color: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.log-delete-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.log-delete-btn:hover {
  color: var(--accent-danger);
  background-color: rgba(239, 68, 68, 0.1);
}

.empty-logs {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Sticky Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 64px;
  height: 54px;
  border-radius: 10px;
  gap: 4px;
}

.nav-item:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.08);
}

.nav-icon {
  font-size: 1.3rem;
  transition: var(--transition-smooth);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
}

/* Database Info Panel */
.db-info-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.db-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.db-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-danger);
}

.db-indicator.loaded {
  background-color: var(--accent-success);
  box-shadow: 0 0 6px var(--accent-success);
}

.db-row-count {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* File Input Hack */
.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Notification Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  background: rgba(22, 29, 49, 0.95);
  backdrop-filter: blur(8px);
  border-left: 4px solid var(--accent-primary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  color: white;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  animation: slideDown 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  transition: all 0.3s ease;
}

.toast.success { border-left-color: var(--accent-success); }
.toast.warning { border-left-color: var(--accent-warning); }
.toast.danger { border-left-color: var(--accent-danger); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.fade-out {
  opacity: 0;
  transform: translate(-50%, -20px) scale(0.9);
  pointer-events: none;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
}

.toast-close:hover {
  color: white;
}

/* Help text */
.help-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Offline Banner */
.offline-banner {
  display: none;
  background-color: var(--accent-warning);
  color: #000;
  text-align: center;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 1001;
  position: sticky;
  top: 0;
}

body.offline .offline-banner {
  display: block;
}

/* Gemini AI Loader Overlay */
.ai-loader-overlay {
  display: none; /* Controlled by JS */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
}

.ai-loader-overlay.active {
  display: flex;
}

.ai-loader-card {
  background: var(--bg-surface-solid);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  width: 90%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), var(--glow-indigo);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.ai-pulse-glow {
  font-size: 2.5rem;
  margin-bottom: 15px;
  animation: pulseGlow 1.5s infinite ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.2)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.7)); }
  100% { transform: scale(0.95); filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.2)); }
}

.ai-spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid rgba(255, 255, 255, 0.05);
  border-top: 3.5px solid var(--accent-primary);
  border-right: 3.5px solid var(--accent-success);
  border-radius: 50%;
  animation: rotateSpinner 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes rotateSpinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-loader-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}

.ai-loader-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Input Highlights */
.input-ai-highlight {
  border-color: var(--accent-success) !important;
  box-shadow: var(--glow-emerald) !important;
}

/* AI Badge for Image Box */
.photo-box::after {
  content: '🤖 AUTO-AI';
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  pointer-events: none;
}

#box-photo-machine::after {
  content: '📷 MACHINE';
  background-color: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}

/* Password Gate Style */
.password-gate {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.password-gate.active {
  display: flex;
}

.lock-card {
  background: var(--bg-surface-solid);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius-lg);
  padding: 40px 30px;
  width: 90%;
  max-width: 350px;
  text-align: center;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
  animation: slideInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lock-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
  animation: lockPulse 2s infinite ease-in-out;
}

@keyframes lockPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.db-indicator.syncing {
  background-color: var(--accent-warning);
  box-shadow: 0 0 6px var(--accent-warning);
  animation: pulse 1s infinite;
}

/* Double Count Warning Card */
.double-count-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--border-radius-md);
  padding: 16px;
  animation: shake 0.3s ease;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.warning-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-warning);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
}

/* Audit Form Checklist */
.audit-checklist-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 14px 16px;
}

.checklist-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checklist-item {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.checklist-item.completed {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.checklist-item.uncompleted {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

/* Branch Completion Progress */
.progress-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 18px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-success), #34d399);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.missing-assets-scroll {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.missing-asset-row {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.missing-asset-eq {
  font-weight: 700;
  color: var(--text-primary);
}

.missing-asset-info {
  color: var(--text-secondary);
  text-align: right;
}

/* Scrollbar styling for missing assets list */
.missing-assets-scroll::-webkit-scrollbar {
  width: 4px;
}
.missing-assets-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.missing-assets-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}
.missing-assets-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- High-Contrast Sunlight Mode Overrides --- */
body.sunlight-mode {
  --bg-primary: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-solid: #ffffff;
  --border-color: #000000;
  --text-primary: #000000;
  --text-secondary: #2d3748;
  --accent-primary: #0000ff;
  --accent-primary-hover: #00008b;
  --accent-success: #007000;
  --accent-success-hover: #005000;
  --accent-warning: #c27807;
  --accent-danger: #b91c1c;
  --glow-indigo: none;
  --glow-emerald: none;
  background-color: #ffffff !important;
  color: #000000 !important;
}

body.sunlight-mode::before {
  display: none !important;
}

body.sunlight-mode header {
  background-color: #ffffff !important;
  border-bottom: 3px solid #000000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sunlight-mode .brand-icon {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #000000 !important;
}

body.sunlight-mode .brand-text h1 {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .brand-text p {
  color: #000000 !important;
  font-weight: 600 !important;
}

body.sunlight-mode .branch-badge {
  background-color: #f3f4f6 !important;
  border: 2px solid #000000 !important;
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .card {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sunlight-mode .card-title {
  color: #000000 !important;
  border-bottom: 2.5px solid #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .form-group label {
  color: #000000 !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
}

body.sunlight-mode input[type="text"],
body.sunlight-mode input[type="number"],
body.sunlight-mode select,
body.sunlight-mode textarea {
  background-color: #ffffff !important;
  border: 2.5px solid #000000 !important;
  color: #000000 !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

body.sunlight-mode input[type="text"]:focus,
body.sunlight-mode input[type="number"]:focus,
body.sunlight-mode select:focus,
body.sunlight-mode textarea:focus {
  border-color: #0000ff !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 255, 0.45) !important;
  background-color: #ffffff !important;
}

body.sunlight-mode ::placeholder {
  color: #4b5563 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

body.sunlight-mode .checkbox-checkmark {
  border: 2.5px solid #000000 !important;
  background-color: #ffffff !important;
}

body.sunlight-mode .checkbox-container input:checked + .checkbox-checkmark {
  background-color: #000000 !important;
  border-color: #000000 !important;
}

body.sunlight-mode .checkbox-label {
  color: #2d3748 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .btn {
  border: 2.5px solid #000000 !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.sunlight-mode .btn-primary {
  background: #0000ff !important;
  color: #ffffff !important;
}

body.sunlight-mode .btn-primary:hover {
  background: #0000cc !important;
}

body.sunlight-mode .btn-success {
  background: #007000 !important;
  color: #ffffff !important;
}

body.sunlight-mode .btn-success:hover {
  background: #005000 !important;
}

body.sunlight-mode .btn-secondary {
  background: #f3f4f6 !important;
  color: #000000 !important;
}

body.sunlight-mode .btn-secondary:hover {
  background: #e5e7eb !important;
}

body.sunlight-mode .gps-badge {
  background-color: #f9fafb !important;
  border: 2px solid #000000 !important;
}

body.sunlight-mode .gps-text {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .gps-coords {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .photo-box {
  border: 3px dashed #000000 !important;
  background-color: #f9fafb !important;
}

body.sunlight-mode .photo-box.has-image {
  border: 3px solid #007000 !important;
}

body.sunlight-mode .photo-label {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .photo-icon {
  color: #000000 !important;
}

body.sunlight-mode .audit-checklist-card {
  background-color: #f9fafb !important;
  border: 2px solid #000000 !important;
}

body.sunlight-mode .checklist-item.completed {
  background-color: #d1fae5 !important;
  border: 2px solid #047857 !important;
  color: #065f46 !important;
}

body.sunlight-mode .checklist-item.uncompleted {
  background-color: #f3f4f6 !important;
  border: 2px solid #374151 !important;
  color: #374151 !important;
}

body.sunlight-mode .double-count-card {
  background: #fffbeb !important;
  border: 2.5px solid #c27807 !important;
  color: #000000 !important;
}

body.sunlight-mode .double-count-card p {
  color: #000000 !important;
}

body.sunlight-mode .warning-header {
  color: #b45309 !important;
}

body.sunlight-mode .bottom-nav {
  background-color: #ffffff !important;
  border-top: 3.5px solid #000000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sunlight-mode .nav-item {
  color: #2d3748 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .nav-item.active {
  background-color: #f3f4f6 !important;
  color: #0000ff !important;
  border: 1px solid #000000 !important;
}

body.sunlight-mode .progress-card {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
}

body.sunlight-mode .progress-card span {
  color: #000000 !important;
}

body.sunlight-mode .progress-bar-container {
  background-color: #e5e7eb !important;
  border: 1.5px solid #000000 !important;
}

body.sunlight-mode .progress-bar-fill {
  background: #007000 !important;
}

body.sunlight-mode #progress-pct-text {
  color: #007000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .missing-asset-row {
  background-color: #f9fafb !important;
  border: 1.5px solid #000000 !important;
}

body.sunlight-mode .missing-asset-eq {
  color: #000000 !important;
}

body.sunlight-mode .missing-asset-info {
  color: #000000 !important;
  font-weight: 600 !important;
}

body.sunlight-mode .log-item {
  background-color: #ffffff !important;
  border: 2.5px solid #000000 !important;
}

body.sunlight-mode .log-eq {
  color: #000000 !important;
  font-weight: 800 !important;
}

body.sunlight-mode .log-meta {
  color: #000000 !important;
  font-weight: 600 !important;
}

body.sunlight-mode .log-time {
  color: #2d3748 !important;
  font-weight: 600 !important;
}

body.sunlight-mode .log-city-badge {
  background-color: #f3f4f6 !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
}

body.sunlight-mode .log-gps-badge {
  background-color: #d1fae5 !important;
  color: #065f46 !important;
  border: 1.5px solid #047857 !important;
}

body.sunlight-mode .db-info-panel {
  background-color: #f9fafb !important;
  border: 2px solid #000000 !important;
}

body.sunlight-mode .db-row-count {
  color: #000000 !important;
  font-weight: 700 !important;
}

body.sunlight-mode .password-gate {
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.sunlight-mode .lock-card {
  background-color: #ffffff !important;
  border: 3px solid #000000 !important;
  color: #000000 !important;
  box-shadow: none !important;
}

body.sunlight-mode .lock-icon {
  animation: none !important;
  filter: none !important;
  color: #000000 !important;
}

body.sunlight-mode .toast {
  background: #ffffff !important;
  border: 2.5px solid #000000 !important;
  color: #000000 !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

body.sunlight-mode #scanner-container {
  border: 3px solid #0000ff !important;
  box-shadow: none !important;
}

body.sunlight-mode .scan-line {
  background-color: #0000ff !important;
  box-shadow: none !important;
}

/* --- Multi-Photo Uploader Previews Layout --- */
.multi-photo-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  padding: 4px 0;
  width: 100%;
}

.equipment-previews-container {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;
}

.equipment-preview-box {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius-md);
  border: 1.5px solid var(--border-color);
  overflow: hidden;
  flex-shrink: 0;
  background-color: #000;
  animation: scaleUp 0.2s ease;
}

.equipment-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.equipment-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.add-photo-box {
  width: 90px;
  height: 90px;
  min-height: 90px !important;
  border: 2.5px dashed var(--border-color);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: rgba(15, 23, 42, 0.4);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.add-photo-box:hover {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

/* --- Live Regional Dashboard Panel Styles --- */
.branch-progress-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.branch-progress-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.4);
}

.branch-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.branch-dashboard-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-dashboard-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #9ca3af;
}

.branch-dashboard-status-dot.not-started {
  background-color: var(--accent-danger);
}

.branch-dashboard-status-dot.in-progress {
  background-color: var(--accent-warning);
}

.branch-dashboard-status-dot.completed {
  background-color: var(--accent-success);
  box-shadow: 0 0 6px var(--accent-success);
}

.branch-dashboard-ratio {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.branch-dashboard-pct {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-success);
}

/* --- Sunlight Mode Dashboard/Photo Overrides --- */
body.sunlight-mode .add-photo-box {
  border: 2.5px dashed #000000 !important;
  background-color: #f9fafb !important;
  color: #000000 !important;
}

body.sunlight-mode .equipment-preview-box {
  border: 2px solid #000000 !important;
}

body.sunlight-mode .branch-progress-card {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  box-shadow: none !important;
  color: #000000 !important;
}

body.sunlight-mode .branch-dashboard-title {
  color: #000000 !important;
}

body.sunlight-mode .branch-dashboard-ratio {
  color: #000000 !important;
}

body.sunlight-mode .branch-dashboard-pct {
  color: #007000 !important;
}

body.sunlight-mode .branch-dashboard-status-dot.completed {
  box-shadow: none !important;
  border: 1px solid #000000 !important;
}

body.sunlight-mode .branch-dashboard-status-dot {
  border: 1px solid #000000 !important;
}

body.sunlight-mode #dashboard-total-pct {
  color: #000000 !important;
}





