/* System Design System - Agrega+ (PWA Dark Mode Premium) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0b0b0e;
  --bg-secondary: rgba(20, 20, 27, 0.7);
  --bg-accent: #1e1e28;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --color-primary: #6366f1;
  /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.15);
  --color-success: #10b981;
  /* Emerald */
  --color-success-glow: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b;
  /* Amber */
  --color-warning-glow: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444;
  --border-glass: rgba(255, 255, 255, 0.05);
  --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  --header-bg: rgba(11, 11, 14, 0.8);
  --bottom-nav-bg: rgba(15, 15, 20, 0.9);

  /* Modern Card CSS Variables */
  --card-bg: linear-gradient(135deg, rgba(30, 30, 48, 0.55) 0%, rgba(18, 18, 28, 0.65) 100%);
  --card-border: 1px solid rgba(99, 102, 241, 0.12);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  --card-hover-bg: linear-gradient(135deg, rgba(42, 42, 66, 0.7) 0%, rgba(22, 22, 36, 0.8) 100%);
  --card-hover-border: rgba(99, 102, 241, 0.35);
  --card-hover-shadow: 0 8px 24px rgba(99, 102, 241, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.08);

  --card-success-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(6, 95, 70, 0.05) 100%);
  --card-success-border: rgba(16, 185, 129, 0.25);
  
  --card-danger-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(153, 27, 27, 0.04) 100%);
  --card-danger-border: rgba(239, 68, 68, 0.25);

  --card-warning-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.04) 0%, rgba(146, 64, 14, 0.04) 100%);
  --card-warning-border: rgba(245, 158, 11, 0.25);
}

body.light-mode {
  --bg-primary: #f3f4f6;
  --bg-secondary: rgba(255, 255, 255, 0.75);
  --bg-accent: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --color-primary: #4f46e5;
  --color-primary-glow: rgba(79, 70, 229, 0.15);
  --color-success: #10b981;
  --color-success-glow: rgba(16, 185, 129, 0.15);
  --color-warning: #d97706;
  --color-warning-glow: rgba(217, 119, 6, 0.15);
  --color-danger: #dc2626;
  --border-glass: rgba(0, 0, 0, 0.08);
  --glass-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  --header-bg: rgba(243, 244, 246, 0.8);
  --bottom-nav-bg: rgba(255, 255, 255, 0.95);

  /* Modern Card CSS Variables - Light Mode */
  --card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 246, 255, 0.96) 100%);
  --card-border: 1px solid rgba(99, 102, 241, 0.14);
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --card-hover-bg: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(235, 240, 255, 1) 100%);
  --card-hover-border: rgba(99, 102, 241, 0.35);
  --card-hover-shadow: 0 8px 24px rgba(79, 70, 229, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);

  --card-success-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.02) 100%);
  --card-success-border: rgba(16, 185, 129, 0.25);

  --card-danger-bg: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.01) 100%);
  --card-danger-border: rgba(239, 68, 68, 0.2);

  --card-warning-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.01) 100%);
  --card-warning-border: rgba(245, 158, 11, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 80px;
  /* Space for bottom navigation on mobile */
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--bg-secondary);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
}

.glass-panel:hover {
  border-color: rgba(99, 102, 241, 0.2);
}

/* Header & Status Bar */
header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.logo-text {
  font-weight: 700;
  font-size: 20px;
  background: linear-gradient(135deg, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 50px;
  background: var(--color-success-glow);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
}

.status-badge.offline {
  background: var(--color-warning-glow);
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-badge.syncing {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.25);
}

.status-badge.sync-error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

@keyframes sync-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}

.status-badge.syncing .status-dot {
  animation: sync-dot-pulse 1s ease-in-out infinite;
  box-shadow: none;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* Dashboard Layout */
.container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.kpi-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-title {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-footer {
  font-size: 11px;
  color: var(--color-success);
}

/* Form Styles */
.form-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pending-sync-badge {
  font-size: 11px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 2px 8px;
  border-radius: 8px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input,
select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-accent);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.3s;
}

input:focus,
select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #4338ca 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ffffff !important;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--color-primary-glow), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  filter: brightness(1.15);
  color: #ffffff !important;
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-accent);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text-secondary) !important;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--text-primary) !important;
  background: var(--color-primary-glow);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: scale(0.96);
}

.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 5px 0;
}

/* History / Lists */
.section-header {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.history-item:hover {
  background: var(--card-hover-bg);
  border-color: var(--card-hover-border);
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* Card Specific Theme Variants */
.history-item.card-success {
  background: var(--card-success-bg) !important;
  border-color: var(--card-success-border) !important;
}

.history-item.card-success:hover {
  background: var(--card-success-bg) !important;
  border-color: var(--card-success-border) !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15) !important;
}

.history-item.card-danger {
  background: var(--card-danger-bg) !important;
  border-color: var(--card-danger-border) !important;
}

.history-item.card-danger:hover {
  background: var(--card-danger-bg) !important;
  border-color: var(--card-danger-border) !important;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15) !important;
}

.history-item.card-warning {
  background: var(--card-warning-bg) !important;
  border-color: var(--card-warning-border) !important;
}

.history-item.card-warning:hover {
  background: var(--card-warning-bg) !important;
  border-color: var(--card-warning-border) !important;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15) !important;
}

/* Indicators and clean decorations for Route stops */
.history-item.card-partida {
  border-left: 4px solid var(--color-success) !important;
}

.history-item.card-retorno {
  border-left: 4px solid var(--color-danger) !important;
}

.history-item.card-entrega {
  border-left: 4px solid var(--color-primary) !important;
}

.history-item.card-abastecimento {
  border-left: 4px solid var(--color-primary) !important;
}

.history-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-vehicle {
  font-weight: 600;
  font-size: 14px;
}

.history-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

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

.history-liters {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 16px;
}

.history-km {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Sync Indicator Icons */
.sync-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-left: 6px;
}

.sync-status-icon.pending {
  color: var(--color-warning);
}

.sync-status-icon.done {
  color: var(--color-success);
}

/* Navigation Drawer / Bottom bar for Mobile */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  transition: color 0.3s;
}

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

.nav-icon {
  font-size: 20px;
}

/* Toast Notification for Updates */
.toast-update {
  position: fixed;
  bottom: 80px;
  left: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--bg-accent), #27273a);
  border: 1px solid var(--color-primary);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-update.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-avatar-header {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s;
}

.user-avatar-header:hover {
  transform: scale(1.06);
  border-color: #a855f7;
}

/* Autocomplete Suggestions dropdown styling */
.autocomplete-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-accent);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-top: 6px;
  max-height: 250px;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.autocomplete-suggestion {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-glass);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-suggestion:last-child {
  border-bottom: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.autocomplete-suggestion:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.autocomplete-suggestion:hover {
  background: var(--color-primary-glow);
  color: #ffffff;
}

.autocomplete-no-results {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.autocomplete-loading {
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.toast-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.toast-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--color-primary-glow);
}

/* Micro-animations */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.spinning {
  animation: spin 1s linear infinite;
}

/* Auth Centered Cards */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 24px;
  margin: 0 auto 12px auto;
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer-link a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.auth-footer-link a:hover {
  opacity: 0.8;
}

.error-text {
  font-size: 12px;
  color: var(--color-danger);
  margin-top: 4px;
}

/* Custom PWA Install Banner */
.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(20, 20, 27, 0.95), rgba(30, 30, 45, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-primary);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2000;
  transform: translateY(150px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-install-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.pwa-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
  font-size: 18px;
}

.pwa-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-title {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.pwa-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

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

.btn-install {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--color-primary-glow);
}

.btn-close-pwa {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

/* User Profile & Address Styling */
.scrollable-auth-card {
  max-height: 90vh;
  overflow-y: auto;
  padding-right: 8px;
}

.scrollable-auth-card::-webkit-scrollbar {
  width: 6px;
}

.scrollable-auth-card::-webkit-scrollbar-track {
  background: transparent;
}

.scrollable-auth-card::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.align-center-y {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.photo-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 5px;
}

.profile-photo-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px dashed var(--border-glass);
  background-color: var(--bg-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.profile-photo-preview:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.preview-placeholder {
  font-size: 32px;
  color: var(--text-secondary);
  font-weight: 300;
}

.btn-photo-select {
  padding: 6px 14px;
  background: var(--bg-accent);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-photo-select:hover {
  border-color: var(--color-primary);
  color: #fff;
}

.address-section-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 24px 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.loading-field {
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}

.user-avatar-header {
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
}

/* Vehicles Panel & Cards Styling */
.vehicles-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 10px;
}

.vehicles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

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

.vehicle-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* overflow: visible para permitir dropdown extravasar o card */
  overflow: visible;
  cursor: pointer;
}

.vehicle-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 30px var(--color-primary-glow);
}

.vehicle-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.vehicle-brand-model {
  display: flex;
  flex-direction: column;
}

.vehicle-brand {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  font-weight: 500;
}

.vehicle-model {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.vehicle-plate-badge {
  background: #1e3a8a;
  /* Brazilian Mercosul Blue Plate */
  color: #fff;
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.vehicle-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.detail-value {
  font-weight: 600;
  color: var(--text-primary);
}

.vehicle-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  margin-top: auto;
}

.fipe-badge {
  font-size: 9px;
  background: var(--color-success-glow);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 2px 6px;
  border-radius: 6px;
}

.vehicle-prices {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.price-buy {
  font-size: 10px;
  color: var(--text-secondary);
}

.price-fipe {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-success);
}

/* Modal Backdrop & Window Styling */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 80%;
  max-width: 900px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

.modal-container form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  margin: 0;
}

.modal-backdrop.show .modal-container {
  transform: translateY(0);
}

.modal-container::-webkit-scrollbar {
  width: 5px;
}

.modal-container::-webkit-scrollbar-track {
  background: transparent;
}

.modal-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
  margin-top: 16px;
  flex-shrink: 0;
}

/* Modal Tabs (Segmented Control style) */
.modal-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.modal-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-tab.active {
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.modal-tab:hover:not(.active):not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tab-content {
  display: none;
}

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

/* Botão Excluir Veículo */
.btn-delete-vehicle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.45) !important;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-delete-vehicle:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #ef4444 !important;
}

body.light-mode .btn-delete-vehicle {
  color: rgba(0, 0, 0, 0.45) !important;
}

/* Botão Opções do Card (Três Pontinhos) */
.btn-options-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.45) !important;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-options-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

body.light-mode .btn-options-card {
  color: rgba(0, 0, 0, 0.45) !important;
}

body.light-mode .btn-options-card:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #000000 !important;
}

/* Options Dropdown do Card de Veículo */
.options-container {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.options-dropdown {
  display: none;
  position: absolute;
  right: -4px;
  top: calc(100% + 6px);
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 9999;
  min-width: 140px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

body.light-mode .options-dropdown {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.options-dropdown.show {
  display: block;
  animation: fadeInDropdown 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes fadeInDropdown {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.options-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  transition: background 0.18s ease;
  white-space: nowrap;
}

.options-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.75;
}

.options-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.light-mode .options-dropdown-item {
  color: #1f2937;
}

body.light-mode .options-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.options-dropdown-item + .options-dropdown-item {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-mode .options-dropdown-item + .options-dropdown-item {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.options-dropdown-item.delete {
  color: #f87171;
}

.options-dropdown-item.delete svg {
  opacity: 1;
}

.options-dropdown-item.delete:hover {
  background: rgba(239, 68, 68, 0.12);
}

body.light-mode .options-dropdown-item.delete {
  color: #dc2626;
}

/* Tema Seletor (Segmented Toggle) */
.theme-toggle-container {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.btn-theme-select {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: var(--bg-accent);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-theme-select:hover {
  border-color: var(--color-primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-theme-select.active {
  border-color: var(--color-primary);
  background: var(--color-primary-glow);
  color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.user-avatar-header {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s;
}

.user-avatar-header:hover {
  transform: scale(1.06);
  border-color: #a855f7;
}
/* =========================================================
   TELA DE CONFIGURAÇÕES — Accordion + Toggle Switch
   ========================================================= */

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 10px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-primary);
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 4px;
}

.settings-accordion-item {
  background: var(--card-bg);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.settings-accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  text-align: left;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.settings-accordion-trigger:hover {
  background: rgba(99, 102, 241, 0.05);
}

.settings-accordion-trigger[aria-expanded="true"] {
  background: rgba(99, 102, 241, 0.06);
}

.settings-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.settings-item-icon.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: var(--color-primary);
}

.settings-item-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.settings-item-icon.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

.settings-item-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settings-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-item-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
}

.settings-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-accordion-trigger[aria-expanded="true"] .settings-chevron {
  transform: rotate(180deg);
}

.settings-accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.settings-accordion-panel.open {
  max-height: 1200px;
  opacity: 1;
}

.settings-panel-content {
  padding: 0 18px 18px 18px;
  border-top: 1px solid var(--border-glass);
}

.settings-panel-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 14px;
  margin-bottom: 16px;
}

.settings-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.settings-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.settings-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.settings-toggle input:checked + .settings-toggle-track {
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.settings-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-toggle input:checked + .settings-toggle-track::after {
  transform: translateX(24px);
}

.settings-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
}

.settings-status-badge.active {
  background: var(--color-success-glow);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.settings-status-badge.inactive {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.settings-resource-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-warning-glow);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--color-warning);
  line-height: 1.5;
}

.settings-resource-warning svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.settings-saved-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-success);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 3000;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 7px;
}

.settings-saved-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.light-mode .settings-toggle-track {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .settings-toggle input:checked + .settings-toggle-track {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* Global Fullscreen Loader Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 11, 14, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.light-mode .loading-overlay {
  background: rgba(243, 244, 246, 0.85);
}

.loading-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  max-width: 280px;
  width: 90%;
  text-align: center;
}

body.light-mode .loading-spinner-container {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.loading-spinner-ring {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(99, 102, 241, 0.1);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loading-spinner-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
