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

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --dark-color: #1f2937;
  --light-color: #f9fafb;
  --login-start: #667eea;
  --login-end: #764ba2;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 15px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --bottom-nav-height: 64px;
  --browser-bar-height: 0px;
}

html.browser-mode {
  --browser-bar-height: 52px;
}

html {
  height: 100%;
  height: 100dvh;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-color);
  color: var(--dark-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#root {
  min-height: 100dvh;
}

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: clip;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
}

.page {
  min-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom) - 8px);
  padding:
    max(1rem, var(--safe-top))
    max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom))
    max(1rem, var(--safe-left));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-width: 0;
  overflow-x: clip;
}

@media (display-mode: standalone) {
  body {
    background: var(--light-color);
    user-select: none;
  }

  .bottom-nav {
    border-top-color: #e5e7eb;
  }

  .page-header,
  .field-header,
  .form,
  .card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}

/* Barra fixa quando aberto no navegador (não instalado) */
.browser-mode-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding:
    calc(8px + var(--safe-top))
    max(12px, var(--safe-right))
    8px
    max(12px, var(--safe-left));
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.browser-mode-bar > i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.browser-mode-bar p {
  flex: 1;
  margin: 0;
  min-width: 0;
}

.browser-mode-bar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  align-items: stretch;
}

.browser-mode-bar-btn {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 40px;
  background: white;
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.browser-mode-bar-btn--ghost {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.75);
  font-weight: 700;
}

html.browser-mode .app-shell,
html.browser-mode .login-page {
  padding-top: calc(var(--browser-bar-height) + var(--safe-top));
}

html.browser-mode .install-prompt--sheet {
  top: calc(var(--browser-bar-height) + var(--safe-top) + 8px);
  bottom: auto;
  max-height: calc(100dvh - var(--browser-bar-height) - var(--safe-top) - var(--bottom-nav-height) - var(--safe-bottom) - 24px);
  overflow-y: auto;
}

/* Prompt instalar PWA */
.install-prompt {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeInUp 0.4s ease;
}

.install-prompt--sheet {
  position: fixed;
  left: max(12px, var(--safe-left));
  right: max(12px, var(--safe-right));
  bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 12px);
  z-index: 1000;
}

.install-prompt--inline {
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

.install-prompt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, var(--login-start) 0%, var(--login-end) 100%);
  color: white;
}

.install-prompt-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: white;
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}

.install-prompt-header strong {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.install-prompt-header span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 2px;
}

.install-prompt-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-prompt-steps {
  list-style: none;
  padding: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-prompt-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--dark-color);
  line-height: 1.4;
}

.install-step-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.install-prompt-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--light-color);
  color: var(--dark-color);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.install-prompt-btn--primary {
  background: linear-gradient(135deg, var(--login-start) 0%, var(--login-end) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.install-prompt-actions {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.install-prompt-actions .install-prompt-btn,
.install-prompt-actions .install-prompt-dismiss {
  width: 100%;
  margin: 0;
}

.install-prompt-dismiss {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}

.install-prompt-footer {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-prompt-flag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  line-height: 1.3;
}

.install-prompt-flag span {
  color: var(--dark-color);
  font-weight: 500;
}

.install-prompt-note {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--dark-color);
  font-size: 0.82rem;
  line-height: 1.4;
}

.install-prompt-note--inline {
  margin: 0;
  flex: 1;
}

.install-prompt-flag input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary-color);
}

.install-prompt--inline .install-prompt-footer {
  padding: 0;
}

.install-prompt--android .install-prompt-actions {
  padding-top: 16px;
}

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  color: var(--text-muted);
}

/* Login — padrão ALCACHECK */
.login-page {
  position: fixed;
  inset: 0;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, var(--safe-top))
    max(16px, var(--safe-right))
    max(16px, var(--safe-bottom))
    max(16px, var(--safe-left));
  background: linear-gradient(135deg, var(--login-start) 0%, var(--login-end) 100%);
}

.login-shell {
  width: 100%;
  max-width: 400px;
  max-height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  -webkit-overflow-scrolling: touch;
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 36px 28px;
  width: 100%;
  flex-shrink: 0;
}

.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 12px;
}
.login-subtitle { color: var(--text-muted); font-size: 0.95rem; }
.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.login-form { display: flex; flex-direction: column; gap: 1rem; }

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-color);
  line-height: 1.3;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: white;
  color: var(--dark-color);
  transition: all 0.3s;
  min-height: 44px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}

.field-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  min-width: 0;
}

.row > .field {
  min-width: 0;
}

.arla-section {
  padding: 0.9rem 1rem;
  margin-bottom: 0.5rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  min-width: 0;
  overflow: hidden;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.checkbox-field input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary-color);
}

/* Buttons */
.btn {
  padding: 12px 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--login-start) 0%, var(--login-end) 100%);
  color: white;
}
.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.primary {
  background: var(--primary-color);
  color: white;
}
.btn.primary:hover { background: var(--secondary-color); }
.btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.danger {
  background: #fff;
  color: #dc2626;
  border: 1px solid #fecaca;
  margin-top: 0.75rem;
}
.btn.danger:hover:not(:disabled) { background: #fef2f2; }
.btn.danger:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.full { width: 100%; }

.btn-back {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
}

.btn-icon {
  background: rgba(37, 99, 235, 0.1);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--primary-color);
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.alert.error {
  background: #fef2f2;
  color: var(--danger-color);
  border: 1px solid #fecaca;
}
.input-erro {
  border-color: var(--danger-color) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.km-erro {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
}
.alert.success {
  background: #f0fdf4;
  color: var(--success-color);
  border: 1px solid #bbf7d0;
}
.alert.warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: white;
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.page-header h1 { font-size: 1.15rem; color: var(--dark-color); }

.page-header--simple {
  justify-content: center;
}

.page-header--simple h1 {
  font-size: 1.1rem;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding: 0 max(8px, var(--safe-left)) var(--safe-bottom) max(8px, var(--safe-right));
  background: white;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 4px;
  border: none;
  background: none;
  transition: color 0.2s;
  min-height: 44px;
}

.bottom-nav-item i {
  font-size: 1.35rem;
}

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

.bottom-nav-item.active i {
  transform: scale(1.05);
}

.bottom-nav-icon {
  position: relative;
  display: inline-flex;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--warning-color);
  color: #1f2937;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.nav-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning-color);
  box-shadow: 0 0 0 2px white;
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.offline-banner i {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.offline-banner div {
  flex: 1;
  min-width: 0;
}

.offline-banner strong,
.offline-banner span {
  display: block;
}

.offline-banner strong {
  font-size: 0.82rem;
}

.offline-banner--off {
  background: #fff7ed;
  color: #9a3412;
  border-bottom: 1px solid #fdba74;
}

.offline-banner--sync {
  background: #eff6ff;
  color: #1d4ed8;
  border-bottom: 1px solid #bfdbfe;
}

.offline-banner--ok {
  background: #f0fdf4;
  color: #047857;
  border-bottom: 1px solid #bbf7d0;
}

.offline-banner--wait {
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.offline-banner-btn {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: white;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.home-pendente--sync {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1e40af;
}

.home-pendente--sync .home-pendente-icon {
  background: #3b82f6;
}

.home-pendente--sync .home-pendente-body p {
  color: #1d4ed8;
}

.home-offline-hint {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lista-item--pendente {
  background: #fffbeb;
}

.lista-item--erro {
  background: #fef2f2;
}

.fila-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.fila-status--pendente {
  color: #b45309;
}

.fila-status--erro {
  color: var(--danger-color);
}

.fila-status-btn {
  margin-left: auto;
  border: none;
  background: white;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Home — dashboard do motorista */
.home-page {
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-hero {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.home-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.home-hero-logo {
  max-height: 40px;
  max-width: 140px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.home-logout {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.home-logout:active {
  background: rgba(255, 255, 255, 0.3);
}

.home-greeting {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 2px;
}

.home-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.home-cpf {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-top: 4px;
}

.home-vehicle-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--primary-color);
}

.home-vehicle-card--multi {
  flex-direction: column;
  align-items: stretch;
}

.home-vehicle-main {
  flex: 1;
  min-width: 0;
}

.home-vehicles-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.home-vehicle-card--multi .home-vehicles-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 8px;
}

.home-vehicle-card--multi .home-vehicle-placa-block {
  align-items: center;
  min-width: 0;
}

.home-vehicle-card--multi .placa-mercosul {
  width: 100%;
  max-width: 108px;
}

.home-vehicle-card--multi .home-vehicle-modelo {
  width: 100%;
  max-width: 108px;
  font-size: 0.68rem;
  text-align: center;
  word-break: break-word;
}

.veiculo-vinculado--placa {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.veiculo-vinculado--placa .placa-mercosul {
  width: 112px;
}

.veiculos-vinculados-lista,
.modal-veiculos-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(60dvh, 420px);
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.veiculo-vinculado-acoes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.veiculo-selecionado-resumo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  background: #eff6ff;
}

.veiculo-selecionado-resumo .placa-mercosul {
  width: 100px;
  flex-shrink: 0;
}

.veiculo-selecionado-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.veiculo-selecionado-info strong {
  font-size: 0.92rem;
  color: var(--dark-color);
}

.btn-buscar-veiculos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--primary-color);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-buscar-veiculos:active {
  background: var(--secondary-color);
}

html.modal-open,
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    max(12px, var(--safe-left))
    max(12px, var(--safe-right))
    calc(var(--bottom-nav-height) + var(--safe-bottom) + 8px);
  touch-action: none;
  overscroll-behavior: contain;
  overflow: hidden;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - var(--bottom-nav-height) - var(--safe-bottom) - 24px);
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  animation: modalSlideUp 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

@keyframes modalSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h2 i {
  color: var(--primary-color);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--light-color);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-veiculos-lista {
  flex: 1;
  min-height: 0;
  padding-right: 2px;
}

.veiculo-vinculado-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.veiculo-vinculado-card .placa-mercosul {
  width: 112px;
}

.veiculo-vinculado-card--ativo {
  border-color: var(--primary-color);
  background: #eff6ff;
  box-shadow: 0 0 0 1px var(--primary-color);
}

.veiculo-vinculado-card-modelo {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-color);
}

.veiculo-vinculado-card-check {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

.veiculo-select {
  width: 100%;
  margin-bottom: 10px;
}

.home-vehicle-placa-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.home-vehicle-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.home-vehicle-placa-img {
  flex-shrink: 0;
}

.placa-mercosul {
  position: relative;
  width: 112px;
  container-type: inline-size;
}

.placa-mercosul-bg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.placa-mercosul-texto {
  position: absolute;
  left: 54%;
  top: 62%;
  transform: translate(-50%, -50%);
  font-family: 'Arial Black', 'Franklin Gothic Medium', Impact, sans-serif;
  font-size: 10.5cqi;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #1a1a1a;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.home-vehicle-modelo {
  display: block;
  width: 112px;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--dark-color);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.home-vehicle-km {
  text-align: right;
  flex-shrink: 0;
}

.home-vehicle-km-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.1;
}

.home-vehicle-km-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.home-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 0.85rem;
}

.home-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.home-section-title i {
  color: var(--primary-color);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.home-stat {
  background: white;
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-stat i {
  display: block;
  font-size: 1.1rem;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.home-stat strong {
  display: block;
  font-size: 0.82rem;
  color: var(--dark-color);
  line-height: 1.2;
  word-break: break-word;
}

.home-stat span {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.home-pendente {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1px solid #fdba74;
  color: #9a3412;
  text-decoration: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
  transition: transform 0.15s;
}

.home-pendente:active {
  transform: scale(0.98);
}

.home-pendente-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fb923c;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.home-pendente-body {
  flex: 1;
  min-width: 0;
}

.home-pendente-body strong {
  display: block;
  font-size: 0.95rem;
}

.home-pendente-body p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #c2410c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-pendente-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #ea580c;
  opacity: 0.9;
}

.home-pendente-action {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.rascunho-status {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

[data-status-conexao].status-conexao-online { color: #15803d; }
[data-status-conexao].status-conexao-offline { color: #dc2626; }
[data-status-conexao] i { animation: nuvem-pisca 1.1s ease-in-out infinite; }
@keyframes nuvem-pisca { 50% { opacity: .28; transform: scale(.86); } }
@media (prefers-reduced-motion: reduce) { [data-status-conexao] i { animation: none; } }

.home-status-conexao { width: fit-content; margin-top: .6rem; padding: .34rem .55rem; border-radius: 999px; background: rgba(255,255,255,.14); }
.home-hero [data-status-conexao].status-conexao-online { color: #bbf7d0; }
.home-hero [data-status-conexao].status-conexao-offline { color: #fecaca; }

/* Confirmação de lançamento */
.modal-sucesso-registro { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 1.25rem; background: rgba(15, 23, 42, .5); opacity: 0; transition: opacity .22s ease; }
.modal-sucesso-registro.visivel { opacity: 1; }
.modal-sucesso-caixa { width: min(100%, 340px); padding: 1.7rem 1.4rem 1.35rem; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 22px 60px rgba(15, 23, 42, .25); transform: translateY(12px) scale(.96); transition: transform .24s ease; }
.modal-sucesso-registro.visivel .modal-sucesso-caixa { transform: translateY(0) scale(1); }
.modal-sucesso-icone { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto .95rem; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 2.25rem; animation: sucesso-salto .6s cubic-bezier(.2,.85,.35,1.3) both; }
.modal-sucesso-caixa h2 { margin: 0; color: #102a56; font-size: 1.2rem; }
.modal-sucesso-caixa p { margin: .55rem 0 1.2rem; color: var(--text-muted); font-size: .88rem; line-height: 1.45; }
.modal-sucesso-caixa .btn { width: 100%; justify-content: center; }
@keyframes sucesso-salto { from { transform: scale(0) rotate(-30deg); } to { transform: scale(1) rotate(0); } }

.modal-offline-registro { position: fixed; z-index: 3000; inset: 0; display: grid; place-items: center; padding: 1.25rem; background: rgba(15, 23, 42, .56); opacity: 0; transition: opacity .22s ease; }
.modal-offline-registro.visivel { opacity: 1; }
.modal-offline-caixa { width: min(100%, 360px); padding: 1.55rem 1.35rem 1.3rem; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 22px 60px rgba(15, 23, 42, .28); transform: translateY(12px) scale(.96); transition: transform .24s ease; }
.modal-offline-registro.visivel .modal-offline-caixa { transform: translateY(0) scale(1); }
.modal-offline-icone { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto .85rem; border-radius: 50%; background: #dbeafe; color: #2563eb; font-size: 2rem; }
.modal-offline-caixa h2 { margin: 0; color: #102a56; font-size: 1.16rem; }
.modal-offline-caixa p { margin: .55rem 0 1.2rem; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }
.modal-offline-caixa .btn { width: 100%; justify-content: center; }

.home-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--success-color), #059669);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.home-cta:active {
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.home-cta i:first-child {
  font-size: 1.4rem;
}

.home-cta-arrow {
  margin-left: auto;
  opacity: 0.8;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.home-quick-actions:has(.home-quick-action:only-child) {
  grid-template-columns: 1fr;
}

.home-quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1rem;
  background: white;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--dark-color);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: background 0.15s;
}

.home-quick-action:active {
  background: var(--light-color);
}

.home-quick-action i {
  font-size: 1.25rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.home-quick-action--info {
  cursor: default;
  flex-direction: row;
}

.home-quick-action--info strong {
  display: block;
  font-size: 0.78rem;
  color: var(--dark-color);
  font-weight: 600;
}

.home-quick-action-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.home-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.home-recent-header .home-section-title {
  margin-bottom: 0;
}

.home-recent-link {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
}

.home-recent-loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.home-empty {
  text-align: center;
  padding: 2rem 1rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-empty > i {
  font-size: 2.5rem;
  color: var(--border);
  margin-bottom: 0.75rem;
}

.home-empty p {
  font-weight: 700;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.home-empty span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.home-empty-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.home-recent-item {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: white;
  border-radius: 0;
  padding: 0.9rem 1rem;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

.home-recent-item:last-child {
  border-bottom: none;
}

.home-recent-item-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.home-recent-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-recent-item-main {
  flex: 1;
  min-width: 0;
}

.home-recent-item-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.home-recent-item-headline strong {
  font-size: 0.92rem;
  color: var(--dark-color);
  min-width: 0;
  padding-top: 2px;
}

.home-recent-item-total-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.home-recent-item-total-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.home-recent-item-total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--success-color);
  white-space: nowrap;
  line-height: 1.1;
}

.home-recent-item-total-hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: #166534;
}

.home-recent-item-posto {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-item-body {
  flex: 1;
  min-width: 0;
}

.home-recent-item-valores {
  flex-shrink: 0;
  min-width: 118px;
  max-width: 46%;
}

.home-recent-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.home-recent-item-top strong {
  font-size: 0.9rem;
  color: var(--dark-color);
}

.home-recent-valor {
  font-weight: 700;
  color: var(--success-color);
  font-size: 0.9rem;
  white-space: nowrap;
}

.abast-valores {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}

.abast-valor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  text-align: left;
  background: white;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.abast-valor:last-child {
  border-bottom: none;
}

.abast-valor-conteudo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.abast-valor--full {
  grid-column: unset;
}

.abast-valor-detalhe {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #166534;
  text-transform: none;
  letter-spacing: 0;
}

.abast-valor-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

.abast-valor--pagamento {
  background: #f0fdf4;
}

.abast-valor--pagamento .abast-valor-label {
  color: #166534;
}

.abast-valor--pagamento strong {
  color: var(--success-color);
  font-size: 0.95rem;
}

.abast-valor--combustivel {
  background: #fffbeb;
}

.abast-valor--combustivel .abast-valor-label {
  color: #c2410c;
}

.abast-valores--com-arla {
  grid-template-columns: unset;
}

.abast-valores--compact {
  flex-shrink: 0;
  min-width: 0;
  margin-bottom: 0;
  border: none;
  background: transparent;
}

.abast-valores--compact .abast-valor {
  padding: 0.2rem 0;
  background: transparent;
  border-bottom: none;
}

.abast-valores--compact .abast-valor--pagamento {
  background: transparent;
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border);
}

.abast-valores--compact .abast-valor-label {
  font-size: 0.58rem;
}

.abast-valores--compact .abast-valor strong {
  font-size: 0.78rem;
}

.abast-valores--compact .abast-valor-sub {
  font-size: 0.68rem;
}

.abast-valores--home {
  margin-left: 52px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.abast-home-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: white;
}

.abast-home-block--combustivel {
  border-left: 3px solid #f59e0b;
}

.abast-home-block--arla {
  border-left: 3px solid #2563eb;
}

.abast-home-block-title {
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.abast-home-block--combustivel .abast-home-block-title {
  background: #fffbeb;
  color: #c2410c;
}

.abast-home-block--arla .abast-home-block-title {
  background: #eff6ff;
  color: #2563eb;
}

.abast-home-grid {
  margin: 0;
  padding: 4px 10px 8px;
}

.abast-home-grid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}

.abast-home-grid-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.abast-home-grid-row dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.abast-home-grid-row dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-color);
  text-align: right;
}

.abast-valor-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
  flex-shrink: 0;
}

.abast-valor strong {
  display: block;
  font-size: 0.88rem;
  color: var(--dark-color);
  line-height: 1.2;
}

.abast-valor--arla {
  background: #eff6ff;
}

.abast-valor--arla .abast-valor-label {
  color: #2563eb;
}

.abast-valor--arla strong {
  color: #2563eb;
}

.card-combustivel {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

.home-recent-data {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.field-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.field-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.logo-small {
  max-height: 50px;
  max-width: 160px;
  object-fit: contain;
}

.greeting { color: var(--text-muted); font-size: 0.9rem; }
.field-header h1 { font-size: 1.4rem; color: var(--primary-color); font-weight: 700; }
.cpf { color: var(--text-muted); font-size: 0.85rem; }
.veiculo-info {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 600;
}
.veiculo-vinculado {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--light-color);
}
.veiculo-vinculado .badge {
  font-size: 0.85rem;
  padding: 4px 10px;
}

.actions { display: flex; flex-direction: column; gap: 1rem; }

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  background: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
}
.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}
.action-card.primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}
.action-card.primary .action-desc { color: rgba(255, 255, 255, 0.85); }

.action-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}
.action-title { font-size: 1.1rem; font-weight: 700; }
.action-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0 0 0.25rem;
  padding: 0;
  list-style: none;
}
.form-steps li {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.45rem 0.2rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  text-align: center;
}
.form-steps li i { font-size: 1rem; }
.form-steps li.active { background: #dbeafe; color: var(--primary-color); box-shadow: inset 0 0 0 1px #93c5fd; }
.form-steps li.done { background: #dcfce7; color: #15803d; }
.form-steps li.done::after { content: '✓'; position: absolute; top: 2px; right: 5px; font-size: 0.65rem; }
.btn-outline-danger { background: #fff !important; border: 1px solid #fecaca !important; color: #dc2626 !important; }
.btn-outline-danger:hover { background: #fef2f2 !important; }

.fotos-section { margin-top: 0.5rem; }
.fotos-section--inline {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.fotos-section h2 { font-size: 1rem; margin-bottom: 0.25rem; color: var(--dark-color); }
.pagamento-section {
  margin-top: 1rem;
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
}
.pagamento-section h2 { color: #166534; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }

.desconto-resumo {
  margin: 0.5rem 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
}

.desconto-resumo .hint { margin-bottom: 0.25rem; }

.desconto-resumo-economia { color: #047857; }

.abast-valor-desconto { color: #047857; }

/* Foto Captura */
.foto-captura { margin-bottom: 1rem; }
.foto-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.obrigatorio { color: var(--danger-color); }
.foto-input { display: none; }
.foto-btn {
  display: block;
  position: relative;
  width: 100%;
  height: 190px;
  cursor: pointer;
  overflow: hidden;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--light-color);
  padding: 0;
  font: inherit;
  text-align: left;
}

.foto-placeholder {
  display: flex;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 0;
  padding: 2rem;
  border: 0;
  border-radius: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: border-color 0.2s;
  background: var(--light-color);
}
.foto-btn:hover .foto-placeholder { border-color: var(--primary-color); }
.foto-icon { font-size: 2rem; }

.foto-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 190px;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  border: 0;
  display: block;
}
.foto-preview[hidden],
.foto-placeholder[hidden] { display: none !important; }

.geo-status { display: block; font-size: 0.75rem; margin-top: 0.35rem; }
.geo-status.loading { color: var(--warning-color); }
.geo-status.ok { color: var(--success-color); }
.geo-status.error { color: var(--danger-color); }
.geo-status.error {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}
.geo-retry {
  border: none;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

/* Banner GPS */
.geo-banner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  margin-bottom: 1rem;
}

.geo-banner > i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.geo-banner.ok {
  flex-direction: row;
  align-items: center;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.geo-banner.ok i { color: var(--success-color); }

.geo-banner.error {
  background: #fffbeb;
  border-color: #fde68a;
}

.geo-banner.required {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.geo-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.geo-banner-text strong {
  color: var(--dark-color);
  font-size: 0.95rem;
}

.geo-banner.ok div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.geo-banner.ok span {
  color: var(--success-color);
  font-weight: 600;
}

.geo-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.geo-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Lista — abastecimentos em sequência */
.lista {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.lista-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.lista-item:last-child {
  border-bottom: none;
}

.lista-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.lista-item-placa {
  width: 112px;
  flex-shrink: 0;
}

.lista-item-combustivel {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
}

.lista-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lista-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

/* Histórico — cartões de leitura rápida */
.historico-lista {
  display: grid;
  gap: 0.85rem;
}

.historico-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 1rem;
  background: #fff;
  border: 1px solid #e5eaf3;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
}

.historico-card-top {
  display: contents;
}

.historico-card-placa .placa-mercosul { width: 112px; }
.historico-card-top > div { grid-column: 1; grid-row: 1 / span 2; }
.historico-card-modelo { display: block; max-width: 112px; margin-top: 0.3rem; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.historico-card-combustivel { grid-column: 1; grid-row: 3; align-self: end; display: inline-flex; align-items: center; gap: 0.35rem; width: fit-content; padding: 0.38rem 0.55rem; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }

.historico-card-total { grid-column: 2; grid-row: 1; display: flex; align-items: end; justify-content: space-between; gap: 0.75rem; padding: 0 0 0.75rem; }
.historico-card-total > div { display: grid; gap: 0.12rem; }
.historico-card-total > div > span { color: var(--text-muted); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.historico-card-total strong { color: #0f2855; font-size: 1.35rem; line-height: 1.1; }
.historico-card-litros { display: inline-flex; align-items: center; gap: .35rem; color: #2563eb; font-weight: 700; font-size: .86rem; white-space: nowrap; }

.historico-card-info { grid-column: 2; grid-row: 2 / span 2; display: grid; grid-template-columns: 1fr 1fr; gap: .55rem .7rem; padding-top: .75rem; border-top: 1px solid #edf1f7; }
.historico-card-info span { display: flex; align-items: center; min-width: 0; gap: .4rem; color: #5e6b80; font-size: .76rem; }
.historico-card-info i { color: #647cf0; font-size: .85rem; }
.historico-card-posto { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 370px) {
  .historico-card { grid-template-columns: 96px minmax(0, 1fr); column-gap: .7rem; }
  .historico-card-placa .placa-mercosul { width: 96px; }
  .historico-card-modelo { max-width: 96px; }
  .historico-card-info { grid-template-columns: 1fr; }
}

.card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

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

.placa {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.valor { font-weight: 700; color: var(--success-color); font-size: 1.05rem; }
.card-body p { font-size: 0.85rem; color: var(--text-muted); }
.card-body .data { font-size: 0.8rem; }

.card-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.badge {
  font-size: 0.7rem;
  padding: 4px 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-color);
  border-radius: 20px;
  font-weight: 600;
}
.badge.geo { background: rgba(16, 185, 129, 0.12); color: var(--success-color); }

.loading, .empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

@media (max-width: 576px) {
  .login-card { padding: 25px 20px; }
  .login-logo img { max-height: 70px; }
}
