/* styles.css */
:root {
  --primary-color: #1976d2;
  --secondary-color: #f8f8f8;
  --text-color: #333;
  --border-color: #ddd;
  --header-height: 56px;
  --nav-height: 56px;

  /* Light theme (default) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-modal: #ffffff;
  --bg-input: #ffffff;
  --bg-button: #1976d2;
  --bg-button-hover: #1565c0;
  --bg-button-secondary: #f5f5f5;
  --bg-success: #4caf50;
  --bg-warning: #ff9800;
  --bg-error: #f44336;
  --bg-info: #2196f3;

  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-on-primary: #ffffff;
  --text-on-dark: #ffffff;
  --text-accent: #1976d2;

  --border-primary: #e0e0e0;
  --border-secondary: #dee2e6;
  --border-input: #ccc;
  --border-focus: #1976d2;

  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);

  --accent-primary: #1976d2;
  --accent-secondary: #2196f3;
  --accent-success: #4caf50;
  --accent-warning: #ff9800;
  --accent-error: #f44336;
}

[data-theme="dark"] {
  /* Dark theme */
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --bg-card: #1e1e1e;
  --bg-modal: #2d2d2d;
  --bg-input: #3a3a3a;
  --bg-button: #3a8dff;
  --bg-button-hover: #5ba0ff;
  --bg-button-secondary: #3a3a3a;
  --bg-success: #66bb6a;
  --bg-warning: #ffa726;
  --bg-error: #ef5350;
  --bg-info: #42a5f5;

  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-tertiary: #999999;
  --text-on-primary: #000000;
  --text-on-dark: #ffffff;
  --text-accent: #3a8dff;

  --border-primary: #444444;
  --border-secondary: #555555;
  --border-input: #555555;
  --border-focus: #3a8dff;

  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.6);

  --accent-primary: #3a8dff;
  --accent-secondary: #42a5f5;
  --accent-success: #66bb6a;
  --accent-warning: #ffa726;
  --accent-error: #ef5350;
}

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

body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overscroll-behavior-x: none; /* Prevent horizontal swipe navigation */
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.main-header {
  height: var(--header-height);
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  );
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.main-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 50%,
    rgba(255, 255, 255, 0.08) 100%
  );
  pointer-events: none;
  opacity: 0;
  animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

.header-center {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.header-center::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 20%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.4) 80%,
    transparent 100%
  );
  border-radius: 1px;
  opacity: 0.7;
}

.header-icon {
  width: 32px;
  height: 32px;
  stroke: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: iconPulse 4s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Spinner animation for Performance Insights loading */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.header-left,
.header-right {
  min-width: 80px;
  text-align: center;
  font-family: "SF Mono", "Monaco", "Cascadia Code", "Roboto Mono", monospace;
  font-size: 1.05rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.header-left {
  /* Plain clock - just basic text styling */
  color: white;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
}

.header-left:hover {
  /* No hover effects for plain clock */
}

#currentTime {
  display: inline-block;
  position: relative;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* Modern Sync Status Indicator */
.sync-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.sync-status-indicator:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.sync-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
  animation: syncPulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.sync-status-dot.checking {
  background: #ff9800;
  box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}

.sync-status-dot.error {
  background: #f44336;
  box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

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

.sync-status-text {
  font-size: 0.85rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.sync-quick-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sync-quick-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(180deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sync-quick-btn svg {
  width: 14px;
  height: 14px;
  stroke: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  margin-top: var(--header-height);
  margin-bottom: var(--nav-height);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-panel {
  display: none;
  height: 100%;
  width: 100%;
  position: relative;
  overflow-y: auto;
  background: transparent;
  padding-bottom: 1rem;
}

.tab-panel.active {
  display: block;
}

/* Add specific styles for map tab */
#tab-map.tab-panel {
  overflow: hidden; /* Prevent scrolling on map tab */
  padding-bottom: 0; /* Remove padding for map tab */
}

.delivery-card {
  margin: 2rem 1rem 0 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 2.5rem 2rem 2rem 2rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 70px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.delivery-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1976d2 0%, #2196f3 100%);
  border-radius: 20px 20px 0 0;
}

.delivery-card .delivery-info {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #1976d2;
  text-shadow: 0 1px 2px rgba(25, 118, 210, 0.1);
}

.delivery-card .no-delivery {
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.02);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.delivery-card .action-btn,
.delivery-actions .action-btn {
  width: 100%;
  padding: 1.2rem 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.8rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  outline: none;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid #1565c0;
}

.delivery-card .action-btn::before,
.delivery-actions .action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.delivery-card .action-btn:hover::before,
.delivery-actions .action-btn:hover::before {
  left: 100%;
}

.delivery-card .action-btn:hover,
.delivery-actions .action-btn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  box-shadow: 0 8px 24px rgba(25, 118, 210, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-bottom: 3px solid #0d47a1;
}

.delivery-card .action-btn:active,
.delivery-actions .action-btn:active {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
  transform: translateY(0);
  border-bottom: 3px solid #0d47a1;
}

.delivery-card .action-btn:disabled,
.delivery-actions .action-btn:disabled {
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  color: #b0b0b0;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid #ccc;
  transform: none;
}

.delivery-actions .cancel-btn {
  width: 75% !important;
  padding: 1.2rem 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #d32f2f 0%, #ff5252 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.5rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  outline: none;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 44px !important;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid #b71c1c;
}

.delivery-actions .cancel-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.delivery-actions .cancel-btn:hover::before {
  left: 100%;
}

.delivery-actions .cancel-btn:hover {
  background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
  box-shadow: 0 8px 24px rgba(211, 47, 47, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-bottom: 3px solid #8e0000;
}

.delivery-actions .cancel-btn:active {
  background: linear-gradient(135deg, #8e0000 0%, #b71c1c 100%);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
  transform: translateY(0);
  border-bottom: 3px solid #8e0000;
}

.delivery-actions .cancel-btn:disabled {
  background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
  color: #b0b0b0;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-bottom: 3px solid #ccc;
  transform: none;
}

.delivery-card .timer {
  font-family: monospace;
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-top: 0.5rem;
}

.map-container {
  width: 100vw;
  height: calc(100vh - var(--header-height) - var(--nav-height));
  min-height: 300px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  margin: 0;
  position: relative; /* Ensure proper positioning */
}

#map {
  height: 100%;
  width: 100vw;
  min-height: 300px;
  touch-action: pan-x pan-y; /* Enable natural touch movement */
}

.delivery-log {
  background: #f4f7fb;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(25, 118, 210, 0.13),
    0 1.5px 4px rgba(0, 0, 0, 0.08);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  margin: 2rem 1rem 0 1rem;
  margin-bottom: 2.1rem;
}

.log-entry {
  background: #f4f7fb;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(25, 118, 210, 0.13),
    0 1.5px 4px rgba(0, 0, 0, 0.08);
  padding: 1.2rem 1rem 1.1rem 1rem;
  margin-bottom: 2.1rem;
  position: relative;
  transition: box-shadow 0.18s, background 0.18s;
}
.log-entry:hover {
  box-shadow: 0 8px 28px rgba(25, 118, 210, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #e9f1fa;
}

.log-entry:last-child {
  border-bottom: none;
}

.bottom-nav {
  height: var(--nav-height);
  background: #fff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.nav-btn {
  flex: 1 1 0;
  background: none;
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  color: #888;
  font-size: 0.85rem;
  padding: 0.3rem 0 0.1rem 0;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-btn.active {
  color: var(--primary-color);
  font-weight: bold;
}

.nav-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

@media (min-width: 768px) {
  /* Remove desktop-specific styles */
}

/* Modern Settings Page */
.options-section {
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-radius: 16px;
  margin: 1.5rem;
  margin-bottom: 80px;
  width: calc(100% - 3rem);
  box-sizing: border-box;
  box-shadow: 0 8px 32px rgba(25, 118, 210, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(25, 118, 210, 0.08);
  position: relative;
  overflow: hidden;
}

.options-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1976d2 0%, #2196f3 50%, #1976d2 100%);
  border-radius: 16px 16px 0 0;
}

/* Modern Settings Title */
.settings-title {
  font-size: 1.8rem;
  margin: 0 0 2.5rem 0;
  color: #1976d2;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  position: relative;
  text-shadow: 0 2px 4px rgba(25, 118, 210, 0.15);
}

.settings-title::before {
  content: "⚙️";
  font-size: 2rem;
  margin-right: 0.6rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  animation: settingsRotate 8s linear infinite;
}

@keyframes settingsRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.settings-title::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #1976d2 30%,
    #1976d2 70%,
    transparent 100%
  );
  border-radius: 2px;
  opacity: 0.7;
}

/* Modern Settings Group */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
  background: white;
  padding: 1.8rem;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.08);
  border: 1px solid rgba(25, 118, 210, 0.06);
  margin-bottom: 2rem;
  position: relative;
}

.settings-group::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #1976d2 50%,
    transparent 100%
  );
  border-radius: 14px 14px 0 0;
}

/* Modern Toggle Labels */
.toggle-label {
  display: flex;
  align-items: center;
  /* Removed justify-content to allow absolute-positioned switch */
  position: relative; /* enable absolute positioning for switch */
  width: 100%;
  padding: 1rem 1.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid rgba(25, 118, 210, 0.08);
  overflow: hidden;
  margin-bottom: 0.4rem;
  min-height: 48px;
}

/* Absolute-positioned switch for perfect alignment */
.toggle-label .switch {
  position: absolute;
  right: 1.4rem; /* match label padding */
  top: calc(50% + 3px); /* further nudge down */
  transform: translateY(-50%);
}

.toggle-label .setting-label {
  font-size: 1.05rem;
  color: #333;
  font-weight: 500;
  flex: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* Clean iOS-Style Toggle Switches */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  flex-shrink: 0;
  margin-left: auto;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: all 0.4s ease;
  border-radius: 34px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.slider:before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: all 0.4s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #4caf50;
  box-shadow: inset 0 0 5px rgba(76, 175, 80, 0.3);
}

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

.slider:hover {
  opacity: 0.9;
}

input:focus + .slider {
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.app-version {
  font-size: 0.9rem;
  color: #666;
  margin-top: 1rem;
  text-align: center;
}

.settings-divider {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

.dev-settings-group {
  margin-top: 0.5rem;
}

.location-status {
  font-size: 0.95rem;
  margin: 0.8rem 0;
  padding: 0.6rem;
  border-radius: 8px;
  background: #f0f0f0;
  color: #444;
}

/* Legacy rules removed to prevent conflicts with modern styling */

.slip-section {
  margin: 1.5rem 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
#slipPreview img {
  max-width: 220px;
  max-height: 180px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: 0.3rem;
}
.ocr-result {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 0.875rem;
  color: #6c757d;
  white-space: pre-wrap;
  max-height: 100px;
  overflow-y: auto;
  position: relative;
}

.ocr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 2px dashed #1976d2;
  background: #e3f2fd;
}

.ocr-loading::after {
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid #1976d2;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ocr-spin 0.8s linear infinite;
  background: #fff;
  margin-left: 0.5rem;
}

@keyframes ocr-spin {
  to {
    transform: rotate(360deg);
  }
}

.ocr-success {
  color: #28a745;
  background: #f1f8e9;
  border-color: #d4edda;
}

.ocr-error {
  color: #dc3545;
  background: #f8d7da;
  color: #33691e;
  font-size: 0.98rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 320px;
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  display: none;
}

.address-section {
  margin: 1.2rem 1rem 0 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: stretch;
}
.address-section label {
  font-size: 1rem;
  font-weight: 500;
}
.address-section input {
  padding: 0.7rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}
.delivery-actions {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  background: none;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin: 0 1rem 70px 1rem;
}
.delivery-actions .action-btn {
  width: calc(100vw - 2rem);
  max-width: 480px;
  margin: 0 auto;
  pointer-events: auto;
}
@media (min-width: 768px) {
  .delivery-actions .action-btn {
    width: 400px;
  }
}

.clear-log-btn {
  margin-top: 1rem;
  background: linear-gradient(90deg, #e53935 60%, #ff5252 100%);
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 32px;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.1);
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  border-bottom: 3px solid #b71c1c;
}
.clear-log-btn:active {
  background: linear-gradient(90deg, #b71c1c 60%, #e53935 100%);
  box-shadow: 0 1px 4px rgba(229, 57, 53, 0.12);
  transform: scale(0.98);
}
.dev-hide {
  display: none !important;
}

.hustle-avg {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8f8f8;
  border-radius: 10px;
  position: relative;
}
.clear-log-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.dev-options-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #e3e8ef;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(25, 118, 210, 0.08);
  padding: 2rem 1.7rem 1.8rem 1.7rem;
  margin-top: 1.5rem;
}

.dev-options-section h3 {
  color: #1976d2;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1.4rem;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 1px 2px rgba(25, 118, 210, 0.12);
}

/* Add subtle divider between blocks inside dev options */
.dev-options-section > * + * {
  margin-top: 1.2rem;
}

/* Make all buttons inside developer section consistent */
.dev-options-section button {
  width: 100%;
  padding: 0.9rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.18);
  transition: all 0.25s ease;
  outline: none;
}

.dev-options-section button:hover {
  background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.25);
  transform: translateY(-2px);
}

.dev-options-section button:active {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
  box-shadow: 0 3px 10px rgba(25, 118, 210, 0.18);
  transform: translateY(0);
}

/* Danger buttons */
.dev-options-section button.danger,
.dev-options-section .clear-log-btn,
.dev-options-section .reset-prices-btn {
  background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
  box-shadow: 0 4px 16px rgba(244, 67, 54, 0.18);
}

.dev-options-section button.danger:hover,
.dev-options-section .clear-log-btn:hover,
.dev-options-section .reset-prices-btn:hover {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.25);
}

.dev-options-section button.danger:active,
.dev-options-section .clear-log-btn:active,
.dev-options-section .reset-prices-btn:active {
  background: linear-gradient(135deg, #b71c1c 0%, #a31515 100%);
  box-shadow: 0 3px 10px rgba(244, 67, 54, 0.18);
}

/* Inputs inside dev options */
.dev-options-section input[type="number"],
.dev-options-section input[type="time"],
.dev-options-section input[type="date"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border 0.2s ease;
}

.dev-options-section input[type="number"]:focus,
.dev-options-section input[type="time"]:focus,
.dev-options-section input[type="date"]:focus {
  border-color: #1976d2;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05),
    0 0 0 3px rgba(25, 118, 210, 0.15);
}

.confirm-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: #fff;
  color: #1976d2;
  border: 2px solid #1976d2;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.06);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border 0.15s;
}
.confirm-btn:hover,
.confirm-btn:focus {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #0d47a1;
}
.confirm-btn:active {
  background: #bbdefb;
  color: #0d47a1;
  border-color: #1565c0;
}
.confirm-btn:disabled {
  background: #f5f5f5;
  color: #b0b0b0;
  border-color: #b0b0b0;
  cursor: not-allowed;
}

.slip-preview {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 1rem;
  overflow: hidden;
}

.slip-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.slip-preview-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #495057;
}

.clear-slip-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #6c757d;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}

.clear-slip-btn:hover {
  color: #dc3545;
}

.slip-preview-content {
  padding: 1rem;
  text-align: center;
}

.slip-preview-content img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ocr-result {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  font-size: 0.875rem;
  color: #6c757d;
  white-space: pre-wrap;
  max-height: 100px;
  overflow-y: auto;
}

.eta-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2.5px solid #1976d2;
  border-top: 2.5px solid transparent;
  border-radius: 50%;
  animation: eta-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 0.3em;
}
@keyframes eta-spin {
  to {
    transform: rotate(360deg);
  }
}

.action-btn.dev {
  background: linear-gradient(90deg, #43a047 60%, #66bb6a 100%) !important;
  border-bottom: 3px solid #2e7031 !important;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(67, 160, 71, 0.12);
  margin-top: 0.5rem;
  border-radius: 32px;
  padding: 1.1rem;
  width: 100%;
  font-size: 1.08rem;
}
.action-btn.dev:active {
  background: linear-gradient(90deg, #2e7031 60%, #43a047 100%) !important;
}
.action-btn.danger {
  background: linear-gradient(90deg, #e53935 60%, #ff5252 100%) !important;
  border-bottom: 3px solid #b71c1c !important;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.12);
  margin-top: 0.5rem;
  border-radius: 32px;
  padding: 1.1rem;
  width: 100%;
  font-size: 1.08rem;
}
.action-btn.danger:active {
  background: linear-gradient(90deg, #b71c1c 60%, #e53935 100%) !important;
}

.delivery-type-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.delivery-type-modal-content {
  background: #fff;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  max-width: 90vw;
  width: 320px;
  position: relative;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
  animation: modal-pop 0.18s cubic-bezier(0.4, 1.6, 0.6, 1) 1;
}
@keyframes modal-pop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.modal-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: #888;
  cursor: pointer;
  z-index: 10;
  transition: color 0.15s;
}
.modal-close-btn:hover {
  color: #e53935;
}

.map-delivery-info-box {
  position: absolute;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  min-width: 380px;
  max-width: 99vw;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(25, 118, 210, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.4rem 2.1rem 1.3rem 2.1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 1.13rem;
  font-weight: 500;
  gap: 0.7rem;
  opacity: 0.98;
}
.map-delivery-info-box .address-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: nowrap;
  width: 100%;
  overflow: hidden;
}
.map-delivery-info-box .address-label {
  white-space: nowrap;
  flex-shrink: 0;
}
.map-delivery-info-box .address-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1976d2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 0;
  min-width: 0;
}
.map-delivery-info-box .new-badge {
  background: #43a047;
  color: #fff;
  font-size: 0.92rem;
  font-weight: bold;
  border-radius: 6px;
  padding: 0.18em 0.7em;
  margin-right: 0.5em;
  letter-spacing: 0.03em;
}
.map-delivery-info-box .map-eta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 1.5rem;
  margin-top: 0.5rem;
  font-size: 1.08rem;
  width: 100%;
}
.map-delivery-info-box .eta-label {
  color: #666;
  font-size: 0.98em;
  margin-right: 0.2em;
}
.map-delivery-info-box .eta-value {
  color: #1976d2;
  font-weight: 600;
  margin-right: 1.2em;
  font-size: 1.08em;
}

.toggle-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.toggle-btn {
  background: none;
  border: none;
  color: #1976d2;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.9rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  opacity: 0.7;
}
.toggle-btn.active {
  background: #e3f2fd;
  color: #0d47a1;
  opacity: 1;
}
.toggle-btn .arrow {
  font-size: 1.1em;
  margin-left: 0.2em;
}

/* --- Delivery Stats Section --- */
.delivery-stats-section {
  background: #f8f9fa;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.07);
  padding: 1.2rem 1.2rem 1.1rem 1.2rem;
  margin: 1.2rem 0 1.2rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.5rem;
  align-items: center;
  justify-items: center;
}
.delivery-timer-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 0.2rem;
}
.timer-label {
  color: #1976d2;
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
.timer-value {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: bold;
  color: #1976d2;
  background: #fff;
  border-radius: 8px;
  padding: 0.18em 0.7em;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
  border: 1px solid #e3eaf3;
}
.stats-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.06);
  padding: 0.5rem 0.7rem;
  min-width: 120px;
}
.stats-label {
  color: #888;
  font-size: 0.98rem;
  font-weight: 500;
  margin-bottom: 0.1em;
}
.stats-value {
  color: #1976d2;
  font-size: 1.13rem;
  font-weight: bold;
  letter-spacing: 0.01em;
}

/* --- Cancel Button Timer --- */
.cancel-section {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cancel-btn .countdown-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: #fff;
  color: #e53935;
  font-weight: bold;
  font-size: 1.1em;
  margin-left: 0.7em;
  box-shadow: 0 1px 4px rgba(229, 57, 53, 0.1);
  border: 2px solid #ffcdd2;
  transition: background 0.18s, color 0.18s;
}
.cancel-btn:disabled .countdown-circle {
  background: #f5f5f5;
  color: #aaa;
  border-color: #eee;
}

/* --- Map Info Box --- */
@media (max-width: 480px) {
  .map-delivery-info-box {
    min-width: 95vw;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

@media (max-width: 600px) {
  .container {
    max-width: 100vw;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }

  main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    margin-top: var(--header-height);
    margin-bottom: var(--nav-height);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: calc(100vh - var(--header-height) - var(--nav-height));
  }

  .tab-panel {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4rem;
  }

  .main-header {
    height: 52px;
    padding: 0 0.8rem;
    box-shadow: 0 2px 12px rgba(25, 118, 210, 0.2), 0 1px 4px rgba(0, 0, 0, 0.1);
  }

  .header-center {
    font-size: 1.1rem;
    gap: 0.5rem;
  }

  .header-icon {
    width: 28px;
    height: 28px;
  }

  .header-left,
  .header-right {
    min-width: 70px;
    font-size: 0.95rem;
  }

  .header-left {
    /* Plain clock - no mobile styling either */
  }

  .main-header::before {
    animation-duration: 6s;
  }

  .sync-status-indicator {
    padding: 0.25rem 0.5rem;
    gap: 0.4rem;
  }

  .sync-status-text {
    font-size: 0.8rem;
  }

  .sync-quick-btn {
    padding: 0.25rem;
  }

  .sync-quick-btn svg {
    width: 12px;
    height: 12px;
  }
  .bottom-nav {
    height: 54px;
  }
  .delivery-card {
    margin: 1.1rem 0.3rem 0 0.3rem;
    padding: 1.2rem 0.7rem 1rem 0.7rem;
    border-radius: 12px;
    min-height: 120px;
    margin-bottom: 70px;
  }
  .delivery-card .action-btn,
  .delivery-actions .action-btn {
    width: 100%;
    padding: 1.2rem 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0.8rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid #1565c0;
  }
  .delivery-card .action-btn::before,
  .delivery-actions .action-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: left 0.5s ease;
  }
  .delivery-card .action-btn:hover::before,
  .delivery-actions .action-btn:hover::before {
    left: 100%;
  }
  .delivery-card .action-btn:hover,
  .delivery-actions .action-btn:hover {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    box-shadow: 0 8px 24px rgba(25, 118, 210, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-bottom: 3px solid #0d47a1;
  }
  .delivery-card .action-btn:active,
  .delivery-actions .action-btn:active {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
    transform: translateY(0);
    border-bottom: 3px solid #0d47a1;
  }
  .delivery-card .action-btn:disabled,
  .delivery-actions .action-btn:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    color: #b0b0b0;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid #ccc;
    transform: none;
  }
  .delivery-actions .cancel-btn {
    width: 75% !important;
    padding: 1.2rem 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #d32f2f 0%, #ff5252 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    outline: none;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 44px !important;
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid #b71c1c;
  }
  .delivery-actions .cancel-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );
    transition: left 0.5s ease;
  }
  .delivery-actions .cancel-btn:hover::before {
    left: 100%;
  }
  .delivery-actions .cancel-btn:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
    box-shadow: 0 8px 24px rgba(211, 47, 47, 0.3),
      0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-bottom: 3px solid #8e0000;
  }
  .delivery-actions .cancel-btn:active {
    background: linear-gradient(135deg, #8e0000 0%, #b71c1c 100%);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.25);
    transform: translateY(0);
    border-bottom: 3px solid #8e0000;
  }
  .delivery-actions .cancel-btn:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    color: #b0b0b0;
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid #ccc;
    transform: none;
  }
  .address-section {
    margin: 0.7rem 0.3rem 0 0.3rem;
    padding: 0.7rem;
    border-radius: 8px;
  }
  .options-section {
    margin: 1.1rem 0.3rem 1rem 0.3rem;
    padding: 0.8rem 0.5rem 0.8rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 70px;
  }
  .dev-options-section {
    margin: 1.1rem 0.3rem 1rem 0.3rem;
    padding: 0.8rem 0.5rem 0.8rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 70px;
  }
  .delivery-log {
    margin: 1.1rem 0.3rem 0 0.3rem;
    padding: 1rem 0.5rem;
    border-radius: 10px;
  }
  .month-group-block {
    margin-bottom: 1.2rem;
    padding-bottom: 0.2rem;
    border-radius: 10px;
  }
  .section-header {
    font-size: 1.08rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
  }
  .averages-section {
    padding: 0.7rem 0.5rem 1rem 0.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
  }
  .weekly-totals {
    padding: 0.7rem;
    border-radius: 8px;
    margin-top: 1.1rem;
  }
  .collapsible-log-header,
  .month-group-header {
    padding: 0.7rem 0.7rem;
    font-size: 1rem;
    border-radius: 8px;
  }
  .day-header {
    padding: 0.6rem 0.7rem;
    font-size: 0.98rem;
    border-radius: 7px;
  }
  .log-entry {
    padding: 0.4rem 0;
    font-size: 0.97rem;
    border-radius: 7px;
  }
  .pro-delivery-log {
    padding: 0.7rem 0.7rem 0.5rem 0.7rem;
    border-radius: 8px;
    max-width: 100vw;
  }
  .slip-preview {
    margin: 0.5rem;
    border-radius: 7px;
  }
  .slip-preview-content img {
    max-width: 98vw;
    max-height: 120px;
    border-radius: 4px;
  }
  .ocr-result {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    max-width: 98vw;
  }
  .bottom-nav {
    height: 54px;
    border-radius: 0;
    font-size: 0.97rem;
    box-shadow: 0 -2px 8px rgba(25, 118, 210, 0.07);
  }
  .nav-btn {
    font-size: 0.93rem;
    padding: 0.2rem 0 0.1rem 0;
    min-width: 0;
  }
  .map-container,
  #map {
    min-height: 220px;
    height: calc(100vh - 52px - 54px);
    border-radius: 0;
    margin: 0;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }
  .map-delivery-info-box {
    min-width: 95vw;
    max-width: 99vw;
    padding: 0.7rem 0.5rem;
    font-size: 1.01rem;
    border-radius: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
  .dev-controls,
  .backup-restore-card {
    padding: 0.5rem 0.3rem 0.5rem 0.3rem !important;
    border-radius: 7px !important;
  }
  .dev-btn {
    font-size: 0.97rem !important;
    padding: 0.5rem 0.7rem !important;
    border-radius: 8px !important;
  }
  /* Removed conflicting old toggle styles - modern responsive styles handle mobile */
  .app-version {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.8rem;
    text-align: center;
  }
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
    font-size: 16px;
  }
  .map-delivery-info-box .address-text {
    font-size: 0.97rem;
  }
}

/* Collapsible Delivery Log Styles */
.delivery-log-collapsible {
  margin: 1.5rem 1rem 0 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  background: #fff;
}
.collapsible-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  border-radius: 12px 12px 0 0;
  background: #f8f9fa;
  font-weight: 600;
  font-size: 1.1rem;
  user-select: none;
  transition: background 0.18s;
}
.collapsible-header:hover {
  background: #e3eaf6;
}
.collapsible-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.08);
}
.collapsible-arrow {
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.collapsible-header.expanded .collapsible-arrow {
  transform: rotate(180deg);
}
.collapsible-content {
  padding: 0 1.2rem 1.2rem 1.2rem;
  background: #fff;
  border-radius: 0 0 12px 12px;
  box-shadow: none;
}

/* Averages Section Modern Look */
.averages-section {
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  margin-bottom: 1.5rem;
  padding: 0.9em 1.1em 0.7em 1.1em;
}
.averages-section h3 {
  font-size: 1.07em;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  letter-spacing: 0.01em;
}
.averages-section .avg-row,
.averages-section .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7em 1.1em;
  margin-top: 0.5em;
}
.averages-section .avg-col,
.averages-section .stats-item {
  background: #fff;
  padding: 0.7em 0.9em;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e3eaf6;
  text-align: center;
}
.averages-section .avg-label,
.averages-section .stats-label {
  color: #666;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 0.2em;
  display: block;
}
.averages-section .avg-value,
.averages-section .stats-value {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.13em;
  display: block;
  margin-top: 0.2em;
}

.mini-delivery-log {
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
  padding: 0.7rem 1rem 0.7rem 1rem;
  margin: 0.7rem 0 0.2rem 0;
  font-size: 1.01rem;
  color: #1976d2;
  text-align: left;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.mini-log-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.mini-delivery-log-collapsible {
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
  padding: 0.2rem 0.7rem 0.2rem 0.7rem;
  margin: 0.7rem 0 0.2rem 0;
  width: 100%;
  max-width: 340px;
}
.mini-log-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.01rem;
  font-weight: 600;
  color: #1976d2;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 0.2rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.mini-log-toggle:hover {
  background: #e3eaf6;
}
.mini-log-arrow {
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mini-log-toggle.expanded .mini-log-arrow {
  transform: rotate(180deg);
}
.mini-log-content {
  font-size: 0.98rem;
  color: #1976d2;
  padding: 0.2rem 0.2rem 0.5rem 0.2rem;
  text-align: left;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.pro-delivery-log {
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  padding: 0.9rem 1.1rem 0.7rem 1.1rem;
  margin: 1.1rem 0 0.2rem 0;
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.pro-log-title {
  font-size: 1.01rem;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
  text-align: left;
}
.pro-log-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.99rem;
  color: #1976d2;
  padding: 0.18rem 0;
  border-bottom: 1px solid #e3eaf6;
}
.pro-log-row:last-child {
  border-bottom: none;
}
.pro-log-icon {
  font-size: 1.13em;
  margin-right: 0.2em;
  opacity: 0.85;
}
.pro-log-label {
  flex: 1 1 0;
  font-weight: 500;
  color: #1976d2;
  letter-spacing: 0.01em;
}
.pro-log-time {
  font-family: monospace;
  font-size: 1.01em;
  color: #222;
  font-weight: 600;
  background: #fff;
  border-radius: 6px;
  padding: 0.08em 0.7em;
  box-shadow: 0 1px 2px rgba(25, 118, 210, 0.04);
  border: 1px solid #e3eaf3;
}

.collapsible-log-header {
  display: flex;
  align-items: center;
  background: #f3f4f7;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  color: #1976d2;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.2rem;
  margin-top: 0;
  width: 100%;
  text-align: center;
  font-size: 1.08rem;
  display: block;
  transition: background 0.18s, box-shadow 0.18s;
}
.collapsible-log-header > * {
  white-space: nowrap;
  min-width: 0;
}
.collapsible-log-title {
  font-weight: 700;
  font-size: 1.08rem;
  color: #1976d2;
  margin-right: 0.7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  max-width: 40vw;
}

.month-group-block {
  margin-bottom: 2.5rem;
  padding-bottom: 0.5rem;
  border-radius: 12px;
  background: none;
}
.month-group-header {
  background: #e3eaf0;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  color: #1976d2;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.1rem;
  margin-top: 0.7rem;
  width: 100%;
  text-align: center;
  font-size: 1.13rem;
  display: block;
}
.collapsible-log-header {
  background: #f3f4f7;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  color: #1976d2;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.2rem;
  margin-top: 0;
  width: 100%;
  text-align: center;
  font-size: 1.08rem;
  display: block;
  transition: background 0.18s, box-shadow 0.18s;
}
.collapsible-log-header.expanded {
  background: #d1e3fa;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
}
.day-header {
  background: #f8f9fa;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  color: #1976d2;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 1rem 1.2rem;
  margin-bottom: 0.7rem;
  width: 100%;
  text-align: center;
  font-size: 1.07rem;
  display: block;
}

.log-day-ordinal {
  font-size: inherit;
  font-weight: 700;
  color: #1565c0;
  margin-left: 0.25em;
  letter-spacing: 0.01em;
}

.section-header {
  background: #f3f4f7;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
  color: #1976d2;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.2rem;
  margin: 1.2rem 0 1.1rem 0;
  width: 100%;
  text-align: center;
  font-size: 1.25rem;
  display: block;
}

.delivery-stats-block {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 0.9em 1.1em 0.7em 1.1em;
  margin-bottom: 0.7em;
  margin-top: 0.2em;
  box-shadow: 0 1px 6px rgba(25, 118, 210, 0.08);
  border: 1.5px solid #e3eaf6;
}

.delivery-stats-title {
  font-size: 1.07em;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.5em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  letter-spacing: 0.01em;
}

.stats-icon {
  font-size: 1.15em;
  margin-right: 0.2em;
}

.delivery-timer-row {
  background: #fff;
  padding: 0.7em 0.9em;
  border-radius: 8px;
  margin-bottom: 0.8em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e3eaf6;
}

.timer-label {
  color: #666;
  font-weight: 600;
  font-size: 0.95em;
}

.timer-value {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7em;
}

.stats-item {
  background: #fff;
  padding: 0.7em 0.9em;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid #e3eaf6;
}

.stats-item .stats-label {
  color: #666;
  font-size: 0.9em;
  font-weight: 600;
  margin-bottom: 0.2em;
}

.stats-item .stats-value {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.05em;
}

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

.double-delivery-time {
  grid-column: 1 / -1;
}

.editable-address {
  cursor: text;
  outline: none;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.editable-address.editing {
  border-bottom: 1px dashed #1976d2;
}
.edit-pencil {
  visibility: hidden;
  transition: visibility 0.15s;
}
.editable-address.editing + .edit-pencil {
  visibility: visible;
}

.small-cancel-btn {
  background: linear-gradient(90deg, #e53935 60%, #ff5252 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.97rem;
  font-weight: 700;
  padding: 0.35rem 1.1rem;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.1);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  outline: none;
  display: block;
  margin: 0 auto 0.7rem auto;
}
.small-cancel-btn:hover {
  background: linear-gradient(90deg, #b71c1c 60%, #e53935 100%);
  box-shadow: 0 4px 16px rgba(229, 57, 53, 0.13);
  transform: translateY(-1px) scale(1.01);
}
.small-cancel-btn:active {
  background: linear-gradient(90deg, #a31515 60%, #b71c1c 100%);
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.12);
  transform: scale(0.98);
}
.small-cancel-btn:disabled {
  background: #e0e0e0;
  color: #b0b0b0;
  cursor: not-allowed;
  box-shadow: none;
}

.delivery-actions-bottom {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0 0.2rem 0; /* reduce bottom padding */
  width: 100%;
  margin: 0 auto 0 auto; /* remove bottom margin */
  background: none;
}
.delivery-actions-bottom .action-btn {
  width: 90%;
  max-width: 320px;
  margin: 0 auto;
  pointer-events: auto;
  border-radius: 12px;
}
@media (max-width: 600px) {
  .delivery-actions-bottom {
    padding: 0.3rem 0 0.1rem 0; /* reduce bottom padding */
    margin-bottom: 0;
  }
  .delivery-actions-bottom .action-btn {
    font-size: 1.01rem;
    padding: 0.8rem;
    border-radius: 18px;
    max-width: 95vw;
  }
}

.action-box {
  background: #f8f9fa;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
  padding: 1.1rem 1rem 1rem 1rem; /* reduce bottom padding */
  max-width: 420px;
  width: 100%;
  border-top: 2.5px solid #e3eaf6;
  border-bottom: none;
  z-index: 110;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0 auto 0 auto; /* remove bottom margin */
}
.action-box-title {
  font-size: 1.13rem;
  font-weight: 800;
  color: #888;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: relative;
}
.action-box-title::after {
  content: "";
  display: block;
  margin: 0.6em auto 0 auto;
  width: 60%;
  height: 2.5px;
  background: linear-gradient(90deg, #e3eaf6 0%, #cfd8dc 100%);
  border-radius: 2px;
  opacity: 0.8;
}
.action-box-btns {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
@media (max-width: 600px) {
  .action-box {
    max-width: 98vw;
    padding: 0.8rem 0.5rem 1.1rem 0.5rem;
    border-radius: 10px;
    margin: 0 auto;
  }
  .action-box-title {
    font-size: 1.04rem;
    margin-bottom: 0.4rem;
  }
  .action-box-title::after {
    margin: 0.5em auto 0 auto;
    width: 70%;
    height: 2px;
  }
  .action-box-btns {
    gap: 0.5rem;
  }
}

#confirmAddressBtn {
  width: 100%;
  padding: 1.05rem 0;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #1856b3 60%, #2196f3 100%);
  color: #fff;
  font-size: 1.13rem;
  font-weight: 700;
  margin-top: 0.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(25, 86, 179, 0.1), 0 1.5px 4px rgba(0, 0, 0, 0.07);
  letter-spacing: 0.01em;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  outline: none;
}
#confirmAddressBtn:hover {
  background: linear-gradient(90deg, #1560a8 60%, #1976d2 100%);
  box-shadow: 0 4px 16px rgba(25, 86, 179, 0.13);
  transform: translateY(-1px) scale(1.01);
}
#confirmAddressBtn:active {
  background: linear-gradient(90deg, #144a8a 60%, #1856b3 100%);
  box-shadow: 0 2px 8px rgba(25, 86, 179, 0.12);
  transform: scale(0.98);
}
#confirmAddressBtn:disabled {
  background: #e0e0e0;
  color: #b0b0b0;
  cursor: not-allowed;
  box-shadow: none;
}

.map-eta-row.single-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35em;
  margin-top: 0.1rem;
  font-size: 0.93rem;
  width: 100%;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0.1em 0.2em;
}
.map-eta-row .eta-label {
  color: #b0bec5;
  font-size: 0.91em;
  margin-right: 0.12em;
}
.map-eta-row .eta-value {
  color: #1976d2;
  font-weight: 700;
  margin-right: 0.4em;
  font-size: 0.97em;
}
@media (max-width: 600px) {
  .map-eta-row.single-line {
    font-size: 0.89rem;
    gap: 0.22em;
    padding: 0.05em 0.1em;
  }
  .map-eta-row .eta-label {
    font-size: 0.89em;
  }
  .map-eta-row .eta-value {
    font-size: 0.93em;
  }
}

.weekly-stats-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 0.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--bg-color);
  border-radius: 8px;
  overflow: hidden;
}

.stats-table th,
.stats-table td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.stats-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
  white-space: nowrap;
}

.stats-table th:first-child {
  text-align: left;
}

.stats-table td:first-child {
  text-align: left;
  font-weight: 500;
}

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

.table-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-bottom: 2px;
}

.table-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.stats-key {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.key-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.key-label {
  font-weight: 600;
  color: var(--primary-color);
}

.key-value {
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .weekly-stats-section {
    padding: 1rem;
    margin: 0.5rem 0;
  }

  .stats-table {
    font-size: 0.9rem;
  }

  .stats-table th,
  .stats-table td {
    padding: 0.6rem 0.8rem;
  }

  .table-icon {
    width: 18px;
    height: 18px;
  }

  .table-label {
    font-size: 0.8rem;
  }

  .stats-key {
    padding: 0.6rem;
    gap: 0.75rem;
  }

  .key-item {
    font-size: 0.85rem;
  }
}

.settings-divider {
  border: none;
  border-top: 1.5px solid #e3eaf6;
  margin: 1.2em 0 1.2em 0;
}
.dev-settings-group {
  margin-top: 0.5em;
  padding-top: 0.5em;
}

.mobile-settings {
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(25, 118, 210, 0.1);
  padding: 1.2rem 1.1rem 1.2rem 1.1rem;
  margin: 1.5rem 0.7rem 1.5rem 0.7rem;
  background: #fff;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
@media (max-width: 600px) {
  .mobile-settings {
    padding: 1.1rem 0.3rem 1.1rem 0.3rem;
    margin: 1.1rem 0.1rem 1.1rem 0.1rem;
    border-radius: 12px;
    width: 100%;
    max-width: none;
  }
}
.settings-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #1976d2;
  margin-bottom: 1.1rem;
  letter-spacing: 0.01em;
  text-align: center;
}
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  margin-bottom: 0.7em;
}
.setting-label {
  margin-left: 0.9em;
  font-size: 1.07em;
  color: #222;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.app-version {
  margin-top: 1.1rem;
  color: #b0b0b0;
  font-size: 0.98rem;
  text-align: right;
  letter-spacing: 0.01em;
}
/* Removed final conflicting toggle styles - modern toggle styles now fully in control */
.settings-divider {
  border: none;
  border-top: 1.5px solid #e3eaf6;
  margin: 1.2em 0 1.2em 0;
}
.dev-settings-group {
  margin-top: 0.5em;
  padding-top: 0.5em;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}
@media (max-width: 600px) {
  .mobile-settings {
    padding: 1.1rem 0.3rem 1.1rem 0.3rem;
    margin: 1.1rem 0.1rem 1.1rem 0.1rem;
    border-radius: 12px;
    max-width: none;
  }
  .settings-title {
    font-size: 1.09rem;
    margin-bottom: 0.7rem;
  }
  /* Removed another conflicting toggle rule - modern styles take precedence */
}

.quick-deliveries-section {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.08);
  padding: 1em 0.5em 1em 0.5em;
  margin: 1em 0.2em 1em 0.2em;
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: stretch;
}
.quick-deliveries-title {
  font-size: 1.13em;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.7em;
  text-align: center;
  letter-spacing: 0.01em;
}
.quick-delivery-group {
  background: #f8fafd;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
  padding: 0.7em 0.5em;
  margin-bottom: 0.5em;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.quick-delivery-group-title {
  font-size: 1.07em;
  font-weight: 600;
  margin-bottom: 0.3em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
}
.quick-delivery-group-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
  width: 100%; /* Added to ensure the grid takes full width */
}
.quick-delivery-btn-square {
  background: #e3f2fd;
  color: #1976d2;
  font-size: 1.09em;
  font-weight: 600;
  border: 1.5px solid #e3eaf6;
  border-radius: 9px;
  padding: 1em 1.2em;
  min-width: 0;
  min-height: 44px;
  box-shadow: 0 1px 3px rgba(25, 118, 210, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5em;
  width: 100%;
}
.quick-delivery-btn-square:active {
  background: #bbdefb;
}
.quick-btn-icon {
  font-size: 1.2em;
  margin-bottom: 0;
}
.quick-btn-title {
  font-weight: 700;
  font-size: 1.09em;
  color: #1976d2;
}
.quick-btn-subtitle {
  font-size: 0.97em;
  color: #666;
  margin-left: 0.2em;
  font-weight: 400;
}
@media (max-width: 600px) {
  .quick-deliveries-section {
    padding: 0.7em 0.1em 0.7em 0.1em;
    border-radius: 10px;
    margin: 0.7em 0.1em 0.7em 0.1em;
    gap: 0.7em;
  }
  .quick-delivery-group {
    padding: 0.5em 0.2em;
    border-radius: 8px;
    margin-bottom: 0.3em;
  }
  .quick-delivery-group-grid {
    gap: 0.3em;
  }
  .quick-delivery-btn-square {
    font-size: 1em;
    padding: 0.7em 0.7em;
    border-radius: 8px;
    min-width: 0;
    min-height: 44px;
    width: 100%;
  }
  .quick-btn-icon {
    font-size: 1.1em;
  }
  .quick-btn-title {
    font-size: 1em;
  }
}

.quick-deliveries-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.07);
  padding: 1.1em 1.2em 1.3em 1.2em;
  margin: 2em 0 0.7em 0; /* Adjusted margin to remove auto centering */
  width: 100%; /* Added to stretch to full width */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1em;
}
.quick-deliveries-header {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: 0.7em;
  margin-top: 1em; /* Added for spacing */
}
.quick-deliveries-bar-icon {
  font-size: 1.3em;
  color: #1976d2;
  margin-right: 0.5em;
}
.quick-deliveries-bar-title {
  font-size: 1.13em;
  font-weight: 700;
  color: #1976d2;
  letter-spacing: 0.01em;
}
.quick-deliveries-divider {
  border: none;
  height: 2px;
  background: linear-gradient(to right, #e3eaf6, #1976d2, #e3eaf6);
  box-shadow: 0 1px 3px rgba(25, 118, 210, 0.1);
  margin: 0.5em 0 1.5em 0; /* Adjusted to remove auto centering and ensure it's full width under the header */
  width: 100%;
}
.quick-deliveries-grid {
  display: flex;
  flex-direction: column;
  gap: 1.2em;
}
.quick-delivery-group {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.quick-delivery-group-title {
  font-size: 1.01em;
  font-weight: 600;
  margin-bottom: 0.3em;
  display: flex;
  align-items: center;
  gap: 0.4em;
}
.quick-delivery-group-icon {
  font-size: 1.1em;
}
.quick-delivery-group-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7em;
}
.quick-delivery-btn-square {
  background: #f8fafd;
  color: #1976d2;
  font-size: 1.05em;
  font-weight: 600;
  border: 1.5px solid #e3eaf6;
  border-radius: 10px;
  padding: 1em 1.2em;
  width: 100%;
  flex: 1 1 100%;
  min-height: 70px;
  box-shadow: 0 1px 3px rgba(25, 118, 210, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center; /* Changed to center horizontally */
  justify-content: center; /* Centers vertically */
  gap: 0.2em;
  text-align: center; /* Ensures text inside is centered */
}
.quick-delivery-btn-square:hover {
  background: #f0f7ff;
  border-color: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(25, 118, 210, 0.1);
}
.quick-delivery-btn-square:active {
  background: #e3f2fd;
  transform: scale(0.98);
}
.quick-btn-icon {
  font-size: 1.1em;
  margin-bottom: 0.2em;
}
.quick-btn-title {
  font-weight: 700;
  font-size: 1.05em;
  color: #1976d2;
}
.quick-btn-subtitle {
  font-size: 0.93em;
  color: #666;
  margin-left: 0.2em;
  font-weight: 400;
}
@media (max-width: 600px) {
  .quick-deliveries-card {
    padding: 1em 0.7em 1.1em 0.7em;
    border-radius: 12px;
    margin: 1em 0 0.7em 0;
    max-width: 99vw;
  }
  .quick-delivery-btn-square {
    font-size: 1em;
    padding: 0.8em 0.7em;
    border-radius: 8px;
    min-width: 110px;
    min-height: 60px;
  }
  .quick-deliveries-divider {
    max-width: 99vw;
  }
}

.stats-toggle-pro {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 340px;
  max-width: 95vw;
  height: 48px;
  background: #f3f6fa;
  border-radius: 28px;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.07);
  margin: 1.2em auto 1.2em auto;
  font-size: 1.13em;
  font-weight: 700;
  user-select: none;
}

.stats-toggle-pro .toggle-option {
  flex: 1 1 0;
  text-align: center;
  z-index: 2;
  cursor: pointer;
  color: #888;
  transition: color 0.22s;
  padding: 0.7em 0 0.7em 0;
  border-radius: 28px;
  position: relative;
}

.stats-toggle-pro .toggle-option.active {
  color: #1976d2;
}

.stats-toggle-pro .toggle-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 8px);
  height: 40px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
  transition: left 0.22s cubic-bezier(0.4, 0.6, 0.2, 1), background 0.18s;
  z-index: 1;
}

.stats-toggle-pro.dominos .toggle-indicator {
  left: calc(50% + 4px);
  background: #e3eaf6;
}

.stats-toggle-pro .toggle-option:first-child {
  margin-right: 0.2em;
}

.stats-toggle-pro .toggle-option:last-child {
  margin-left: 0.2em;
}

@media (max-width: 600px) {
  .stats-toggle-pro {
    width: 98vw;
    height: 40px;
    font-size: 1em;
  }
  .stats-toggle-pro .toggle-indicator {
    height: 32px;
    top: 4px;
    left: 4px;
    width: calc(50% - 8px);
  }
  .stats-toggle-pro.dominos .toggle-indicator {
    left: calc(50% + 4px);
  }
}

/* Ensure all tap targets are at least 44px tall */
.action-btn,
.delivery-actions .action-btn,
.delivery-actions .cancel-btn,
.clear-log-btn,
.small-cancel-btn,
.quick-delivery-btn,
.quick-delivery-btn-square {
  min-height: 44px;
}

/* Modern Quick Delivery Button Styles */
.quick-delivery-btn-modern {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-align: left;
  width: 100%;
  font-family: inherit;
  font-size: inherit;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quick-delivery-btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #1976d2;
}

.quick-delivery-btn-modern:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

@media (max-width: 600px) {
  .quick-delivery-btn-modern {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
}

/* Remove desktop min-widths/max-widths */
.container,
.map-container,
#map,
.delivery-card,
.quick-deliveries-card,
.pro-delivery-log,
.mini-delivery-log,
.mini-delivery-log-collapsible {
  max-width: 100vw !important;
  min-width: 0 !important;
}

/* Make scrollbars mobile-friendly */
::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* Remove any desktop-only overflow */
body,
html,
.container,
main {
  overflow-x: hidden !important;
}

.weekly-stats-cards {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  margin-top: 0.7em;
}
.weekly-stats-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.09);
  padding: 1.1em 1em 1em 1em;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  align-items: stretch;
}
.weekly-stats-card .week-label {
  font-size: 1.09em;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 0.3em;
  letter-spacing: 0.01em;
}
.weekly-stats-card .stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.01em;
  padding: 0.4em 0;
  border-bottom: 1px solid #e3eaf6;
}
.weekly-stats-card .stats-row:last-child {
  border-bottom: none;
}
.weekly-stats-card .stats-label {
  color: #888;
  font-size: 0.98em;
  font-weight: 500;
}
.weekly-stats-card .stats-value {
  color: #1976d2;
  font-weight: 700;
  font-size: 1.09em;
}
@media (max-width: 600px) {
  .weekly-stats-cards {
    gap: 0.7em;
  }
  .weekly-stats-card {
    padding: 0.8em 0.5em 0.8em 0.5em;
    border-radius: 9px;
  }
  .weekly-stats-card .week-label {
    font-size: 1em;
  }
}

.mobile-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.01em;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.07);
  margin-bottom: 1em;
}
.mobile-stats-table th,
.mobile-stats-table td {
  padding: 0.85em 0.5em;
  text-align: center;
  border-bottom: 1px solid #e3eaf6;
  font-weight: 500;
}
.mobile-stats-table th {
  background: #f3f6fa;
  color: #1976d2;
  font-weight: 700;
  font-size: 1.07em;
  letter-spacing: 0.01em;
}
.mobile-stats-table td:first-child,
.mobile-stats-table th:first-child {
  text-align: left;
  font-weight: 700;
  color: #1976d2;
  min-width: 90px;
}
.mobile-stats-table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 600px) {
  .mobile-stats-table th,
  .mobile-stats-table td {
    padding: 0.65em 0.3em;
    font-size: 0.97em;
  }
  .mobile-stats-table th {
    font-size: 1em;
  }
  .mobile-stats-table td:first-child,
  .mobile-stats-table th:first-child {
    min-width: 70px;
    font-size: 0.98em;
  }
}

.joystick-container {
  position: absolute;
  right: 80px; /* Move it left of the button stack */
  bottom: 18px;
  z-index: 1001;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.13);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.joystick-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #1976d2;
  text-align: center;
  margin-bottom: 4px;
}

.joystick-base {
  width: 100px;
  height: 100px;
  background: #f5f5f5;
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.joystick-stick {
  width: 40px;
  height: 40px;
  background: #1976d2;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  cursor: grab;
  transition: background 0.15s;
}

.joystick-stick:active {
  background: #1565c0;
  cursor: grabbing;
}

.joystick-instructions {
  font-size: 0.8em;
  color: #666;
  text-align: center;
  margin-top: 4px;
  line-height: 1.3;
}

@media (max-width: 600px) {
  .joystick-container {
    left: 12px;
    bottom: 12px;
    padding: 8px;
  }

  .joystick-base {
    width: 80px;
    height: 80px;
  }

  .joystick-stick {
    width: 32px;
    height: 32px;
  }

  .joystick-title {
    font-size: 0.85em;
  }

  .joystick-instructions {
    font-size: 0.75em;
  }
}

.version-selector {
  padding: 6px 12px;
  border: 1px solid #1976d2;
  border-radius: 4px;
  background-color: white;
  color: #1976d2;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.version-selector:hover {
  background-color: #f5f5f5;
}

.version-selector:focus {
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.beta-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff9800;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.radius-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.radius-control input[type="number"] {
  width: 100px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.radius-control span {
  color: #666;
  font-size: 0.9em;
}

.radius-control-container {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
}

.radius-control-container h4 {
  color: #d32f2f;
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  letter-spacing: 0.01em;
  text-align: left;
  padding-left: 2px;
}

.radius-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 15px;
}

.radius-control input[type="range"] {
  width: 100%;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.radius-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #4caf50;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

.radius-control input[type="range"]::-webkit-slider-thumb:hover {
  background: #45a049;
}

.radius-value-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radius-value-display input[type="number"] {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-align: right;
}

.radius-value-display span {
  color: #666;
  font-size: 14px;
}

.radius-presets {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.radius-preset-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.radius-preset-btn:hover {
  background: #f0f0f0;
  border-color: #ccc;
}

.radius-preset-btn:active {
  background: #e0e0e0;
}

@media (max-width: 600px) {
  .radius-control-container {
    padding: 10px;
  }

  .radius-control-container h4 {
    font-size: 13px;
  }

  .radius-preset-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* Map Provider Toggle Styles */
.map-provider-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 8px 0;
  padding: 8px 0;
  background: #f3f6fa;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.04);
}
.map-provider-toggle label {
  font-weight: 600;
  color: #1976d2;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.map-provider-toggle input[type="radio"] {
  accent-color: #1976d2;
  width: 18px;
  height: 18px;
  margin: 0 4px 0 0;
}
.map-provider-toggle .toggle-title {
  color: #333;
  font-size: 1.01rem;
  font-weight: 700;
  margin-right: 12px;
  letter-spacing: 0.01em;
}

@media (max-width: 600px) {
  .map-provider-toggle {
    flex-direction: column;
    gap: 8px;
    padding: 6px 0;
  }
  .map-provider-toggle label {
    font-size: 0.97rem;
  }
}

.stat-completed {
  background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
  color: #fff !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
  border: 2px solid #4caf50;
  position: relative;
  overflow: hidden;
}

.stat-completed::before {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-completed .stat-label,
.stat-completed .stat-value,
.stat-completed .stat-icon {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

.stat-completed .stat-icon {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.stat-pending {
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  color: #666 !important;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stat-pending .stat-label,
.stat-pending .stat-value {
  color: #666 !important;
  font-weight: 500;
}

.stat-pending .stat-icon {
  opacity: 0.6;
  filter: grayscale(1);
}

.stat-just-completed {
  animation: statPop 0.6s ease-out;
}

@keyframes statPop {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.25);
  }
}

.temp-data-btn.danger:hover {
  background: #d32f2f;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.22);
}

.temp-delivery-data-section h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 1rem;
}

.temp-data-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  background: rgba(25, 118, 210, 0.05);
  border: 1px solid #e3e8ee;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-label {
  font-weight: 600;
  color: #333;
}

.status-value {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 70px;
  text-align: center;
}

.status-value.active {
  background: #4caf50;
  color: white;
}

.status-value.inactive {
  background: #9e9e9e;
  color: white;
}

.temp-data-display {
  margin-bottom: 1rem;
}

.temp-data-display textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  background: #fafafa;
  resize: vertical;
}

.temp-data-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

/* Floating Temp Data Panel */
.temp-delivery-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 320px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.temp-delivery-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background-color: var(--primary-color);
  color: #fff;
}

.temp-delivery-panel .panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.temp-delivery-panel .panel-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  padding: 0;
}

.temp-delivery-panel .panel-close-btn:hover {
  opacity: 1;
}

.temp-delivery-panel .panel-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.temp-delivery-panel textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.temp-delivery-panel .panel-update-status {
  font-size: 0.8rem;
  color: #666;
  text-align: right;
}

.temp-delivery-panel .panel-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.temp-delivery-panel .panel-action-btn {
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  background-color: #f8f8f8;
  color: var(--text-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: background-color 0.2s, color 0.2s;
}

.temp-delivery-panel .panel-action-btn:hover {
  background-color: #e0e0e0;
}

.temp-delivery-panel .panel-action-btn.danger {
  grid-column: 1 / -1;
  background-color: #f44336;
  border-color: #f44336;
  color: #fff;
  margin-top: 0.5rem;
}

.temp-delivery-panel .panel-action-btn.danger:hover {
  background-color: #d32f2f;
}

@media (max-width: 600px) {
  .temp-delivery-panel {
    top: 10px;
    right: 10px;
    width: calc(100% - 20px);
  }
}

.stat-completed .stat-label-pro,
.stat-completed .stat-value-pro,
.stat-completed .stat-icon {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* Modern Backup Section */
.backup-info {
  background: linear-gradient(135deg, #f0f7ff 0%, #e3f2fd 100%) !important;
  border-left: 4px solid #1976d2 !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.08) !important;
  border: 1px solid rgba(25, 118, 210, 0.12) !important;
  position: relative;
  overflow: hidden;
}

.backup-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #1976d2 50%,
    transparent 100%
  );
  border-radius: 12px 12px 0 0;
}

.backup-actions {
  display: flex !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  margin-bottom: 1.5rem !important;
}

/* Modern Action Buttons */
.settings-action-btn {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 1rem 1.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  min-width: 140px !important;
  flex: 1 !important;
}

.settings-action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.settings-action-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(25, 118, 210, 0.35) !important;
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
}

.settings-action-btn:hover::before {
  left: 100%;
}

.settings-action-btn:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3) !important;
}

#mainBackupBtn {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%) !important;
}

#mainBackupBtn:hover {
  background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
  box-shadow: 0 8px 24px rgba(25, 118, 210, 0.35) !important;
}

#mainRestoreBtn {
  background: linear-gradient(135deg, #f57c00 0%, #e65100 100%) !important;
  box-shadow: 0 4px 12px rgba(245, 124, 0, 0.25) !important;
}

#mainRestoreBtn:hover {
  background: linear-gradient(135deg, #e65100 0%, #bf360c 100%) !important;
  box-shadow: 0 8px 24px rgba(245, 124, 0, 0.35) !important;
}

#mainHistoryBtn {
  background: linear-gradient(135deg, #666 0%, #424242 100%) !important;
  box-shadow: 0 4px 12px rgba(102, 102, 102, 0.25) !important;
}

#mainHistoryBtn:hover {
  background: linear-gradient(135deg, #424242 0%, #212121 100%) !important;
  box-shadow: 0 8px 24px rgba(102, 102, 102, 0.35) !important;
}

/* Modern Settings Mobile Responsiveness */
@media (max-width: 600px) {
  .options-section {
    margin: 1rem;
    padding: 1.5rem;
    margin-bottom: 70px;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.1);
    border-radius: 14px;
  }

  .settings-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
  }

  .settings-title::before {
    font-size: 1.8rem;
    margin-right: 0.5rem;
  }

  .settings-title::after {
    width: 40px;
    bottom: -5px;
    height: 2px;
  }

  .settings-group {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 12px;
  }

  .toggle-label {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 10px;
    margin-bottom: 0.3rem;
    min-height: 50px;
  }

  .switch {
    width: 54px;
    height: 30px;
  }

  .slider {
    border-radius: 30px;
    background-color: #ccc;
  }

  .slider:before {
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.4s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

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

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

  .backup-info {
    padding: 1.2rem !important;
    margin-bottom: 1.2rem !important;
    border-radius: 10px !important;
  }

  .backup-actions {
    gap: 0.8rem !important;
    flex-direction: column !important;
  }

  .settings-action-btn {
    padding: 0.9rem 1.2rem !important;
    font-size: 0.9rem !important;
    border-radius: 10px !important;
    min-width: unset !important;
    flex: none !important;
    box-shadow: 0 3px 10px rgba(25, 118, 210, 0.2) !important;
  }

  .settings-action-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(25, 118, 210, 0.3) !important;
  }

  .app-version {
    font-size: 0.85rem;
    margin-top: 1.5rem;
    text-align: center;
    color: #666;
    padding: 0.5rem;
    background: rgba(25, 118, 210, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(25, 118, 210, 0.08);
  }

  /* Fix settings tab scrolling */
  #tab-settings {
    height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #tab-settings .container {
    padding-bottom: 150px !important;
    height: auto !important;
    min-height: calc(100vh - 120px) !important;
  }

  /* Force proper mobile viewport */
  body {
    overflow-x: hidden !important;
  }

  /* Fix main container on mobile */
  main {
    height: calc(100vh - 60px) !important;
    overflow: hidden !important;
  }

  .tab-panel {
    height: 100% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Make server sync section more compact */
  .settings-category {
    margin-bottom: 1rem !important;
  }

  /* Fix button layout in server sync */
  .settings-category button {
    width: 100% !important;
    margin: 0.25rem 0 !important;
    padding: 0.8rem !important;
    font-size: 0.85rem !important;
  }

  /* Ensure all content is visible */
  .settings-category:last-child {
    margin-bottom: 2rem !important;
  }

  /* Fix options section for mobile */
  .options-section {
    margin: 0.5rem !important;
    padding: 1rem !important;
    margin-bottom: 120px !important;
    width: calc(100% - 1rem) !important;
  }

  /* Fix toggle labels for mobile */
  .toggle-label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.8rem 1rem !important;
    min-height: 50px !important;
  }

  .switch {
    flex-shrink: 0 !important;
  }

  /* Mobile-specific fixes for server sync buttons */
  #serverSyncSectionHTML {
    padding: 1rem !important;
  }

  #serverSyncSectionHTML div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  #serverSyncSectionHTML button {
    width: 100% !important;
    padding: 0.75rem !important;
    font-size: 0.9rem !important;
    min-height: 44px !important;
  }

  /* Ensure all settings content is scrollable */
  .settings-category:last-child {
    margin-bottom: 3rem !important;
  }
}

/* Additional mobile fixes for very small screens */
@media (max-width: 400px) {
  #serverSyncSectionHTML button {
    padding: 0.6rem 0.5rem !important;
    font-size: 0.8rem !important;
  }

  .options-section {
    margin: 0.25rem !important;
    padding: 0.75rem !important;
  }

  .settings-group {
    padding: 0.75rem !important;
  }
}

/* Modern Settings Subtitle (Data Backup & Sync) */
.settings-subtitle {
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  color: #1976d2 !important;
  margin-bottom: 1.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.6rem !important;
  text-shadow: 0 1px 3px rgba(25, 118, 210, 0.15) !important;
  position: relative;
}

.settings-subtitle::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 50px;
  height: 2px;
  background: linear-gradient(
    90deg,
    #1976d2 0%,
    rgba(25, 118, 210, 0.3) 70%,
    transparent 100%
  );
  border-radius: 2px;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .settings-subtitle {
    font-size: 1.2rem !important;
    gap: 0.5rem !important;
  }

  .settings-subtitle::after {
    width: 40px;
    bottom: -3px;
    opacity: 0.7;
  }
}

/* Modern Header Animations */
@keyframes monthHeaderShimmer {
  0% {
    transform: translateX(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(300%) rotate(45deg);
  }
}

/* Mobile-friendly styling for ALL mobile screens */
@media (max-width: 480px) {
  /* Weekly Hustle Performance Chart - Mobile Fix */
  .chart-svg-container {
    padding: 0.5rem !important;
    overflow-x: hidden !important;
  }

  #weeklyChart {
    min-width: 280px !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .chart-legend {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: flex-start !important;
  }

  .chart-legend > div {
    font-size: 0.8rem !important;
  }
}

/* Mobile-friendly styling for Galaxy Z Fold 6 and narrow screens */
@media (max-width: 320px) {
  /* Clock styling for narrow screens */
  .header-left {
    font-size: 0.85rem !important;
    padding: 0.1rem 0.3rem !important;
  }

  /* Refresh App Button */
  #refreshAppBtn {
    font-size: 0.9rem !important;
    padding: 0.8rem !important;
    gap: 0.3rem !important;
  }

  #refreshAppBtn span {
    font-size: 1rem !important;
  }

  /* Auto Server Sync Section */
  #serverSyncSectionHTML {
    padding: 1rem !important;
    margin-top: 0.8rem !important;
  }

  #serverSyncSectionHTML h3 {
    font-size: 1rem !important;
    margin-bottom: 0.8rem !important;
  }

  #serverSyncSectionHTML > div {
    font-size: 0.8rem !important;
    margin-bottom: 0.3rem !important;
  }

  #serverSyncSectionHTML button {
    font-size: 0.85rem !important;
    padding: 10px 12px !important;
    min-width: 120px !important;
  }

  /* Delivery Tracker About Section */
  .app-version-pro {
    padding: 1rem !important;
    border-radius: 12px !important;
  }

  .ver-title {
    font-size: 1.1rem !important;
  }

  .ver-author {
    font-size: 0.8rem !important;
  }

  .ver-quote {
    font-size: 0.75rem !important;
    margin: 0.3rem 0 !important;
  }

  .ver-meta-row {
    gap: 0.5rem !important;
  }

  .ver-badge {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.5rem !important;
  }

  .ver-pro {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
  }
}

/* === STATS TAB – FULL-WIDTH CARD FIX === */
/* Force each stats card inside the delivery log to take the full available width
   (mobile & desktop) and stack vertically similar to the live beta design. */
.address-card,
.delivery-stats-card,
.nerds-stats-card,
.hustle-breakdown-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Ensure the day content container flows vertically */
.day-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Individual delivery entry - stacked vertically layout */
.log-entry {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  align-items: stretch !important;
}

/* Make each card take full width and restore bottom margins */
.log-entry .address-card,
.log-entry .delivery-stats-card,
.log-entry .nerds-stats-card,
.log-entry .hustle-breakdown-card {
  flex: none !important;
  width: 100% !important;
  margin-bottom: 1.5rem !important;
}

/* Improve grid alignment inside stats/nerds cards */
.stats-grid,
.nerds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

/* Remove any unintended fixed widths set on log entries in earlier mobile rules */
@media (max-width: 600px) {
  .log-entry {
    padding: 1rem 0.8rem !important;
  }
}

/* ============= 🌙 DARK THEME REMOVED - NOW IN SETTINGS ============= */
/* Dark theme toggle moved to Settings > UI Display section with scheduling */

/* Dark Mode Schedule Card Styles */
.dark-mode-schedule-card {
  transition: all 0.3s ease !important;
}

.dark-mode-schedule-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.dark-mode-schedule-card[data-value="manual"]:hover {
  border-color: rgba(25, 118, 210, 0.6) !important;
  background: linear-gradient(
    135deg,
    rgba(25, 118, 210, 0.15) 0%,
    rgba(25, 118, 210, 0.08) 100%
  ) !important;
}

.dark-mode-schedule-card[data-value="sunset"]:hover {
  border-color: rgba(255, 152, 0, 0.6) !important;
  background: linear-gradient(
    135deg,
    rgba(255, 152, 0, 0.15) 0%,
    rgba(255, 152, 0, 0.08) 100%
  ) !important;
}

.dark-mode-schedule-card[data-value="custom"]:hover {
  border-color: rgba(156, 39, 176, 0.6) !important;
  background: linear-gradient(
    135deg,
    rgba(156, 39, 176, 0.15) 0%,
    rgba(156, 39, 176, 0.08) 100%
  ) !important;
}

/* Selected state for schedule cards */
.dark-mode-schedule-card input[type="radio"]:checked ~ div {
  /* Additional styling for selected state can be added here */
}

/* Time input focus styles */
#darkModeStartTime:focus,
#darkModeEndTime:focus {
  border-color: rgba(156, 39, 176, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.1) !important;
  outline: none !important;
}

/* Pulse animation for status indicator */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* ============= SETTINGS TAB DARK MODE SUPPORT ============= */

/* Settings Categories */
[data-theme="dark"] .settings-subtitle {
  color: var(--text-primary) !important;
  text-shadow: 0 1px 3px rgba(58, 141, 255, 0.3) !important;
}

[data-theme="dark"] .settings-subtitle::after {
  background: linear-gradient(
    90deg,
    #3a8dff 0%,
    rgba(58, 141, 255, 0.3) 70%,
    transparent 100%
  ) !important;
}

/* Settings Groups */
[data-theme="dark"] .settings-group {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .settings-group::before {
  background: linear-gradient(
    135deg,
    rgba(58, 141, 255, 0.1) 0%,
    rgba(58, 141, 255, 0.05) 100%
  ) !important;
}

/* Toggle Labels */
[data-theme="dark"] .toggle-label {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .toggle-label .setting-label {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .toggle-label .setting-description {
  color: var(--text-secondary) !important;
}

/* Location Status Card */
[data-theme="dark"] .location-status {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .location-status h4 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .location-status p {
  color: var(--text-secondary) !important;
}

/* Server Sync Section */
[data-theme="dark"] #serverSyncSectionHTML {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] #serverSyncSectionHTML h3 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] #serverSyncSectionHTML > div {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] #serverSyncSectionHTML button {
  background: var(--bg-button) !important;
  color: var(--text-on-primary) !important;
  border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] #serverSyncSectionHTML button:hover {
  background: var(--bg-button-hover) !important;
}

/* About Section */
[data-theme="dark"] .app-version-pro {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .ver-title {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .ver-author {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .ver-quote {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .ver-badge {
  background: var(--bg-button-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .ver-pro {
  background: var(--accent-primary) !important;
  color: var(--text-on-primary) !important;
}

/* Professional Developer Console */
[data-theme="dark"] .dev-options-section {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .dev-options-section h3 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dev-options-section button {
  background: var(--bg-button-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .dev-options-section button:hover {
  background: var(--bg-button) !important;
  color: var(--text-on-primary) !important;
}

[data-theme="dark"] .dev-options-section button.danger {
  background: var(--bg-error) !important;
  color: var(--text-on-primary) !important;
}

[data-theme="dark"] .dev-options-section button.danger:hover {
  background: #d32f2f !important;
}

[data-theme="dark"] .dev-options-section input[type="number"] {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-input) !important;
}

[data-theme="dark"] .dev-options-section input[type="number"]:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 2px rgba(58, 141, 255, 0.2) !important;
}

/* Dark Mode Cards in Dark Theme */
[data-theme="dark"] .dark-mode-schedule-card {
  background: var(--bg-card) !important;
  border: 2px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .dark-mode-schedule-card[data-value="manual"] {
  background: linear-gradient(
    135deg,
    rgba(58, 141, 255, 0.1) 0%,
    rgba(58, 141, 255, 0.05) 100%
  ) !important;
  border: 2px solid rgba(58, 141, 255, 0.3) !important;
}

[data-theme="dark"] .dark-mode-schedule-card[data-value="sunset"] {
  background: linear-gradient(
    135deg,
    rgba(255, 167, 38, 0.1) 0%,
    rgba(255, 167, 38, 0.05) 100%
  ) !important;
  border: 2px solid rgba(255, 167, 38, 0.3) !important;
}

[data-theme="dark"] .dark-mode-schedule-card[data-value="custom"] {
  background: linear-gradient(
    135deg,
    rgba(156, 39, 176, 0.1) 0%,
    rgba(156, 39, 176, 0.05) 100%
  ) !important;
  border: 2px solid rgba(156, 39, 176, 0.3) !important;
}

[data-theme="dark"] .dark-mode-schedule-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Dark Mode Custom Time Settings */
[data-theme="dark"] #customTimeSettings {
  background: linear-gradient(
    135deg,
    rgba(156, 39, 176, 0.08) 0%,
    rgba(156, 39, 176, 0.03) 100%
  ) !important;
  border: 1px solid rgba(156, 39, 176, 0.2) !important;
}

[data-theme="dark"] #customTimeSettings > div > div {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] #darkModeStartTime,
[data-theme="dark"] #darkModeEndTime {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 2px solid rgba(156, 39, 176, 0.3) !important;
}

[data-theme="dark"] #darkModeStartTime:focus,
[data-theme="dark"] #darkModeEndTime:focus {
  border-color: rgba(156, 39, 176, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.2) !important;
}

/* Settings Action Buttons */
[data-theme="dark"] .settings-action-btn {
  background: var(--bg-button-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .settings-action-btn:hover {
  background: var(--bg-button) !important;
  color: var(--text-on-primary) !important;
}

[data-theme="dark"] .settings-action-btn::before {
  background: linear-gradient(
    135deg,
    rgba(58, 141, 255, 0.1) 0%,
    rgba(58, 141, 255, 0.05) 100%
  ) !important;
}

/* Backup Info */
[data-theme="dark"] .backup-info {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .backup-info::before {
  background: linear-gradient(
    135deg,
    rgba(58, 141, 255, 0.1) 0%,
    rgba(58, 141, 255, 0.05) 100%
  ) !important;
}

/* Toggle Switches in Dark Mode */
[data-theme="dark"] .slider {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-primary) !important;
}

[data-theme="dark"] .slider:before {
  background-color: var(--text-primary) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] input:checked + .slider {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}

[data-theme="dark"] input:checked + .slider:before {
  background-color: white !important;
}

[data-theme="dark"] .slider:hover {
  box-shadow: 0 0 8px rgba(58, 141, 255, 0.3) !important;
}

[data-theme="dark"] input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(58, 141, 255, 0.2) !important;
}

/* ============= SETTINGS TAB DARK MODE SUPPORT ============= */
/* Dark theme for main settings container */
[data-theme="dark"] .options-section {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-secondary) !important;
  box-shadow: var(--shadow-medium) !important;
}

/* Dark theme for the top stripe of settings container */
[data-theme="dark"] .options-section::before {
  background: linear-gradient(
    90deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 50%,
    var(--accent-primary) 100%
  ) !important;
}

/* Dark theme for the entire settings panel background */
[data-theme="dark"] .tab-panel {
  background: var(--bg-primary) !important;
}

/* ============= DELIVERY TAB DARK MODE SUPPORT ============= */

/* Main Delivery Card (AI Scan, Quick Delivery, Manual Entry buttons) */
[data-theme="dark"] .delivery-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .delivery-card::before {
  background: linear-gradient(
    90deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  ) !important;
}

/* Text within the delivery card */
[data-theme="dark"] .delivery-card .delivery-info {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .delivery-card .no-delivery {
  color: var(--text-secondary) !important;
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-secondary) !important;
}

/* Quick Deliveries Section Header */
[data-theme="dark"] .quick-deliveries-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: var(--shadow-light) !important;
}

[data-theme="dark"] .quick-deliveries-header {
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  ) !important;
}

[data-theme="dark"] .quick-deliveries-header::before {
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  ) !important;
}

[data-theme="dark"] .quick-deliveries-bar-title {
  color: var(--text-on-primary) !important;
}

/* Individual Quick Delivery Cards (Edgehill, Ormskirk) */
[data-theme="dark"] .quick-delivery-btn-square {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-primary) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .quick-delivery-btn-square:hover {
  background: var(--bg-tertiary) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .quick-btn-title {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .quick-btn-subtitle {
  color: var(--text-secondary) !important;
}
