/* ==========================================================================
   FuelSplit — Daily Petrol Expense Tracker & 50-50 Split Calculator
   Design System: Premium Dark Modern Mobile-First Dashboard
   100% Fluid & Fully Responsive Across Mobile, Tablet, and Desktop
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #090d16;
  --bg-surface: #0f172a;
  --bg-card: rgba(17, 24, 39, 0.92);
  --bg-card-hover: rgba(30, 41, 59, 0.75);
  --bg-input: #111827;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;

  /* Accent Colors */
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --accent-gold: #eab308;
  --whatsapp-color: #25d366;
  --whatsapp-hover: #1ebd5a;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Blur */
  --glass-blur: blur(14px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Prevent Horizontal Overflow */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 2.5rem;
}

/* Background Ambient Lighting */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
}

.bg-glow-1 {
  width: 400px;
  height: 400px;
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, var(--accent-amber), transparent 70%);
}

.bg-glow-2 {
  width: 450px;
  height: 450px;
  bottom: 50px;
  right: -150px;
  background: radial-gradient(circle, var(--accent-emerald), transparent 70%);
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
}

/* ========================================================
   1. TOOL ACCESS GATE (Full Screen Protection on Visit)
   ======================================================== */

.access-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #111827 0%, #090d16 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  overflow-y: auto;
}

.access-gate-overlay.gate-unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.access-gate-card {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gate-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-amber), #ea580c);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto;
  box-shadow: 0 6px 20px var(--accent-amber-glow);
}

.gate-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.gate-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
}

.gate-security-notice {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.gate-security-notice i {
  color: var(--accent-amber);
}

.gate-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.65rem;
}

.gate-pin-input {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 0.65rem 1rem;
  border-color: rgba(245, 158, 11, 0.4);
}

.gate-pin-input:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px var(--accent-amber-glow);
}

.gate-numpad {
  margin-bottom: 0.65rem;
}

/* ========================================================
   APP HEADER
   ======================================================== */

.app-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
  width: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px var(--accent-amber-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Header Responsive Grid on Mobile */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    width: 100%;
  }

  .header-actions .btn,
  .header-actions .badge-admin-status {
    width: 100%;
    padding: 0.5rem 0.5rem;
    font-size: 0.775rem;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Admin Status Badge */
.badge-admin-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  user-select: none;
}

.badge-admin-status.locked {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.35);
}

.badge-admin-status.locked:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: #fde047;
}

.badge-admin-status.unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* ========================================================
   BUTTONS
   ======================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-amber), #ea580c);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--accent-amber-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.75);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.btn-admin {
  background: rgba(234, 179, 8, 0.18);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.4);
  font-weight: 700;
}

.btn-admin:hover {
  background: rgba(234, 179, 8, 0.3);
  border-color: #fde047;
}

.btn-whatsapp {
  background: linear-gradient(135deg, var(--whatsapp-color), #128c7e);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #2ae06e, #149c8c);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--accent-amber);
  border: 1px dashed rgba(245, 158, 11, 0.4);
}

.btn-ghost:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-amber);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color var(--transition-fast);
}

.btn-link:hover {
  color: var(--text-main);
}

.btn-icon-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-accent {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-primary {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-regular {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-ot {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.badge-locked {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.badge-unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Main Content Layout */
.main-content {
  margin-top: 1.25rem;
}

/* ========================================================
   METRICS KPI CARDS
   ======================================================== */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
}

@media (max-width: 360px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.card-glow-amber .metric-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.card-glow-cyan .metric-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.card-glow-emerald .metric-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.card-glow-purple .metric-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.metric-data {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.metric-label {
  display: block;
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-value .unit {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-sub {
  display: block;
  font-size: 0.725rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-sub strong {
  color: var(--text-muted);
}

/* ========================================================
   CONTENT LAYOUT: GRID & CARD RESPONSIVENESS
   ======================================================== */

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 992px) {
  .content-layout {
    grid-template-columns: 460px minmax(0, 1fr);
    align-items: start;
  }
}

.right-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 600px) {
  .card {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.card-title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-accent {
  color: var(--accent-amber);
}

.text-admin-gold {
  color: var(--accent-gold);
}

.text-rose {
  color: var(--accent-rose);
}

.section-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ========================================================
   FORM STYLES & INPUTS
   ======================================================== */

.entry-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

label i {
  color: var(--accent-amber);
  font-size: 0.825rem;
}

.form-control {
  width: 100%;
  max-width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  transition: all var(--transition-fast);
  outline: none;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px var(--accent-amber-glow);
}

.form-control-lg {
  font-size: 1.1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.75rem 0.85rem;
}

.form-control-sm {
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.form-textarea {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  resize: vertical;
  line-height: 1.5;
}

/* Input Prefix & Buttons */
.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix {
  position: absolute;
  left: 0.85rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-amber);
  pointer-events: none;
}

.input-with-prefix input {
  padding-left: 2.1rem;
}

.input-with-button {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
  width: 100%;
}

.input-with-button input {
  flex: 1;
  min-width: 0;
}

/* OCR Camera Trigger Button */
.btn-ocr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.15);
  user-select: none;
  flex-shrink: 0;
}

.btn-ocr:hover {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

/* Quick Amount Pills */
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
  width: 100%;
}

.btn-pill {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-pill:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
}

.prev-odo-badge {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Live Calc Bar */
.live-calc-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  margin-top: 0.35rem;
  text-align: center;
  gap: 0.35rem;
  width: 100%;
}

.calc-item {
  display: flex;
  flex-direction: column;
}

.calc-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calc-val {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.calc-val.highlight {
  color: var(--accent-amber);
}

/* Duty Toggle Wrapper */
.duty-toggle-wrapper {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.duty-info {
  flex: 1;
  min-width: 0;
}

.duty-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.duty-desc {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Custom Switch Toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #f97316;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.ot-badge-row {
  display: flex;
  align-items: center;
  margin-top: -0.35rem;
}

/* Holiday Alert Banner */
.alert-banner {
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.alert-warning {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecdd3;
}

.alert-icon {
  font-size: 1.2rem;
  color: #ef4444;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-content strong {
  color: #f87171;
  font-size: 0.825rem;
  display: block;
}

.alert-content p {
  font-size: 0.775rem;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.alert-hint {
  font-size: 0.725rem;
  color: #fcd34d;
  font-style: italic;
  display: block;
  margin-top: 0.25rem;
}

.field-help {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-green {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.dot-red {
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

/* OCR Preview Card */
.ocr-preview-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  animation: fadeIn 0.3s ease;
  width: 100%;
}

.ocr-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.ocr-status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #60a5fa;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ocr-body {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.img-preview-wrap {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  flex-shrink: 0;
}

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

.ocr-details {
  flex: 1;
  min-width: 0;
}

.ocr-progress-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.ocr-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.2s ease;
}

.ocr-detected-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ocr-detected-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ocr-detected-digits {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #38bdf8;
}

.ocr-hint-box {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Split Preview Card */
.split-preview-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.75));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  width: 100%;
}

.split-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.split-boxes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

@media (max-width: 420px) {
  .split-boxes {
    flex-direction: column;
  }
  .split-divider {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
}

.split-user-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  min-width: 0;
  width: 100%;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-ana {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
}

.user-nat {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #0f172a;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-share {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.split-divider {
  color: var(--text-subtle);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
  width: 100%;
}

/* ========================================================
   HISTORY CARD & RESPONSIVE DATA TABLE
   ======================================================== */

.history-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.history-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.history-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  width: 100%;
}

.history-filter-bar .filter-item {
  flex: 1;
  min-width: 110px;
}

.table-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.65rem;
}

.filtered-total {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-amber);
}

/* Robust Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  min-width: 600px; /* guarantees readable tabular columns on mobile without shrinking */
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.data-table th {
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.td-datetime {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.td-date {
  font-weight: 600;
  color: var(--text-main);
}

.td-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.td-mono {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.td-cost {
  color: var(--accent-amber);
  font-weight: 700;
}

.td-split-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.725rem;
  white-space: nowrap;
}

.split-person {
  color: var(--text-muted);
}

.split-person span {
  color: #ffffff;
  font-weight: 600;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.btn-table-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.btn-table-action.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
}

.text-right {
  text-align: right;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-main);
}

.empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 300px;
}

/* History Footer */
.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
}

.data-storage-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.725rem;
}

/* ========================================================
   PROTECTED ADMIN PANEL (FLUID MOBILE DESIGN)
   ======================================================== */

.admin-panel-card {
  border-color: rgba(234, 179, 8, 0.25);
  background: linear-gradient(175deg, rgba(20, 27, 45, 0.95), rgba(15, 23, 42, 0.98));
  width: 100%;
  min-width: 0;
}

.admin-card-header {
  border-bottom-color: rgba(234, 179, 8, 0.2);
}

.admin-panel-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  min-width: 0;
}

.admin-session-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  width: 100%;
  box-sizing: border-box;
}

.admin-session-box.locked {
  background: rgba(234, 179, 8, 0.08);
  border-color: rgba(234, 179, 8, 0.3);
}

.admin-session-box.unlocked {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.admin-box-icon {
  font-size: 1.35rem;
  color: var(--accent-gold);
  flex-shrink: 0;
}

.admin-session-box.unlocked .admin-box-icon {
  color: var(--accent-emerald);
}

.admin-box-text {
  flex: 1;
  min-width: 0;
}

.admin-box-text h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.admin-box-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  word-break: break-word;
}

.admin-subgroup {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-subgroup-title {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-subgroup-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.admin-actions-bar {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-direction: column;
  width: 100%;
}

@media (min-width: 500px) {
  .admin-actions-bar {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-actions-bar .btn,
  .admin-actions-bar a {
    flex: 1;
    min-width: 140px;
  }
}

.admin-actions-bar .btn,
.admin-actions-bar a {
  width: 100%;
  box-sizing: border-box;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mb-0 {
  margin-bottom: 0;
}

/* ========================================================
   MODALS
   ======================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
  overflow-y: auto;
}

.modal-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: scaleUp 0.25s ease;
  box-sizing: border-box;
}

.modal-pin-card {
  max-width: 400px;
  border-color: rgba(234, 179, 8, 0.35);
}

.modal-danger-card {
  max-width: 460px;
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.modal-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.text-whatsapp {
  color: var(--whatsapp-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .modal-footer {
    flex-direction: column;
  }
  .modal-footer .btn {
    width: 100%;
  }
}

/* WhatsApp Group Info Pill */
.wa-group-info-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: #86efac;
  word-break: break-word;
}

/* PIN Field */
.pin-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pin-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pin-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pin-field-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--accent-gold);
}

.pin-input {
  padding-left: 2.2rem;
  padding-right: 2.5rem;
  font-size: 1.1rem;
  font-family: var(--font-mono);
  width: 100%;
}

.btn-pin-eye {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem;
}

.btn-pin-eye:hover {
  color: var(--text-main);
}

/* Numpad */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.45rem;
  width: 100%;
}

.btn-num {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.65rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-num:hover {
  background: rgba(51, 65, 85, 0.95);
}

.btn-num:active {
  transform: scale(0.96);
  background: var(--accent-amber);
  color: #0f172a;
}

.btn-num-clear {
  color: var(--accent-rose);
  font-size: 1rem;
}

.btn-num-back {
  color: var(--text-muted);
  font-size: 1rem;
}

.pin-modal-footer {
  margin-top: 0.45rem;
}

/* Safe Reset Steps Box */
.reset-steps-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  width: 100%;
}

.reset-steps-box h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.reset-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reset-steps-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.text-success {
  color: var(--accent-emerald);
}

/* Shake Animation for Invalid PIN */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.35s ease;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
  max-width: 360px;
  margin-left: auto;
}

@media (max-width: 480px) {
  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: 100%;
  }
}

.toast {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.825rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast-info {
  border-left: 4px solid var(--accent-cyan);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.hidden {
  display: none !important;
}

.cursor-pointer {
  cursor: pointer;
}

/* ========================================================
   Backend Connection Status Badge
   ======================================================== */
.badge-backend-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.badge-backend-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.badge-backend-status.connected {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}
.badge-backend-status.connected .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.badge-backend-status.connecting {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}
.badge-backend-status.connecting .status-dot {
  background: #f59e0b;
  animation: pulseDot 1.2s infinite ease-in-out;
}

.badge-backend-status.local {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
}
.badge-backend-status.local .status-dot {
  background: #0ea5e9;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

/* Button Icon Only */
.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  cursor: pointer;
}

/* ========================================================
   Live Continuous Camera Odometer Scanner Modal & Reticle
   ======================================================== */
.modal-camera-card {
  max-width: 520px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 35px rgba(14, 165, 233, 0.2);
}

.modal-camera-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.camera-stream-wrapper {
  position: relative;
  width: 100%;
  height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

#camera-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Viewfinder Mask & Target Box */
.viewfinder-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.45);
}

.viewfinder-reticle {
  position: relative;
  width: 82%;
  max-width: 320px;
  height: 85px;
  border: 2px dashed rgba(14, 165, 233, 0.65);
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.04);
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

/* Target Box Four Glowing Corners */
.reticle-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: #0ea5e9;
  border-style: solid;
  pointer-events: none;
  transition: border-color 0.25s ease;
}

.corner-tl {
  top: -2px;
  left: -2px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 4px;
}
.corner-tr {
  top: -2px;
  right: -2px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 4px;
}
.corner-bl {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 4px;
}
.corner-br {
  bottom: -2px;
  right: -2px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 4px;
}

/* Scanning Laser Animation */
.scan-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #0ea5e9, #38bdf8, #0ea5e9, transparent);
  box-shadow: 0 0 10px #0ea5e9, 0 0 18px rgba(14, 165, 233, 0.8);
  animation: laserSweep 2s ease-in-out infinite alternate;
}

@keyframes laserSweep {
  0% { top: 6px; opacity: 0.85; }
  50% { opacity: 1; }
  100% { top: calc(100% - 8px); opacity: 0.85; }
}

.reticle-target-guide {
  position: absolute;
  bottom: -24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.675rem;
  font-weight: 600;
  color: #bae6fd;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* Locked State (Green Glow) */
.viewfinder-reticle.reticle-locked {
  border: 2px solid #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.55), 0 0 0 9999px rgba(2, 6, 23, 0.5);
}

.viewfinder-reticle.reticle-locked .reticle-corner {
  border-color: #10b981;
}

.viewfinder-reticle.reticle-locked .scan-laser {
  background: #10b981;
  box-shadow: 0 0 14px #10b981;
  animation: none;
  top: 50%;
  transform: translateY(-50%);
}

.viewfinder-reticle.reticle-locked .reticle-target-guide {
  color: #6ee7b7;
}

/* Camera Floating Status Pill */
.camera-status-pill {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #e2e8f0;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.725rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0ea5e9;
  animation: pulseDot 1s infinite alternate;
}

.pulse-indicator.locked {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: none;
}

/* Live Detected Digits Banner */
.camera-detected-banner {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(16, 185, 129, 0.5);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  animation: scaleUp 0.2s ease;
}

.camera-detected-banner .detected-label {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.camera-detected-banner .detected-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: #34d399;
  letter-spacing: 2px;
}

/* Controls Bar */
.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

@media (max-width: 480px) {
  .camera-stream-wrapper {
    height: 300px;
  }
  .viewfinder-reticle {
    width: 88%;
    height: 75px;
  }
  .camera-controls-bar {
    flex-direction: column;
    width: 100%;
  }
  .camera-controls-bar .btn {
    width: 100%;
  }
}
