/* ==========================================================================
   Eco Transporte - Design System & Custom Styles
   Normas: ABNT NBR 10004 / CONAMA / WCAG 2.2 AA Compliance
   ========================================================================== */

/* 1. Reset e Acessibilidade Base */
[x-cloak] {
  display: none !important;
}

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-hazard: #d97706;
  --color-hazard-dark: #b45309;
}

body {
  font-family: var(--font-sans);
  color: #1e293b;
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 2. Focus Visible WCAG 2.2 AA */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #059669 !important;
  outline-offset: 2px !important;
}

/* 3. Redução de Movimento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4. Placa Mercosul Badge */
.placa-mercosul {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1.5px solid #1e293b;
  background-color: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.placa-mercosul::before {
  content: "BR";
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  background-color: #1d4ed8;
  color: #ffffff;
  padding: 0 0.2rem;
  border-radius: 0.125rem;
  margin-right: 0.35rem;
}

/* 5. Badges de Classe de Resíduo (ABNT NBR 10004) */
.badge-classe-1 {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-classe-2 {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* 6. Badges de Status Operacional */
.badge-status-ativo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #ecfdf5;
  color: #047857;
}
.badge-status-ativo::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background-color: #10b981;
}

.badge-status-inativo {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #475569;
}
.badge-status-inativo::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background-color: #94a3b8;
}

.badge-status-pendente {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #fffbeb;
  color: #b45309;
}
.badge-status-pendente::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background-color: #f59e0b;
}

/* 7. Scrollbar Personalizada e Sutil */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 8. Toasts e Feedback */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 90vw;
  width: 24rem;
}

.toast-item {
  pointer-events: auto;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* 9. Impressão (MTR / Relatórios) */
@media print {
  .no-print,
  aside,
  header,
  .toast-container,
  button:not(.print-include) {
    display: none !important;
  }
  main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}
