/* ==========================================================================
   EQUIPE MORCEGO - SISTEMA DE GESTÃO DE TRILHÕES E EXPEDIÇÕES
   DESIGN SYSTEM OFF-ROAD & TOKENS CSS
   ========================================================================== */

:root {
  --primary: #F59E0B;         /* Âmbar / Laranja Off-Road */
  --primary-hover: #D97706;
  --secondary: #10B981;       /* Verde Trilha */
  --secondary-hover: #059669;
  --accent: #EF4444;          /* Vermelho Alerta */
  --bg-dark: #0B0F19;         /* Fundo Principal Escuro */
  --surface: #111827;         /* Cards e Painéis */
  --surface-hover: #1F2937;   /* Hover em Cards */
  --surface-active: #374151;
  --border: #374151;          /* Bordas de Contraste */
  --text-main: #F9FAFB;       /* Texto Claro Principal */
  --text-muted: #9CA3AF;      /* Texto Secundário */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================================================
   CONTAINER & GRID
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.navbar {
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), #EA580C);
  color: #000000;
  font-weight: 900;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #D97706);
  color: #000000;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FBBF24, var(--primary));
  transform: translateY(-1px);
  color: #000000;
}

.btn-secondary {
  background-color: var(--surface-hover);
  color: var(--text-main);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--surface-active);
  color: #FFFFFF;
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary), #059669);
  color: #FFFFFF;
}

.btn-danger {
  background-color: var(--accent);
  color: #FFFFFF;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: rgba(245, 158, 11, 0.4);
}

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

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.5px;
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   HERO BANNER & HIGHLIGHTS
   ========================================================================== */
.hero {
  position: relative;
  background: radial-gradient(circle at top center, rgba(245, 158, 11, 0.12) 0%, transparent 70%), var(--bg-dark);
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, #FFFFFF, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: #0A0E17;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 0.9rem 1rem;
  background-color: var(--surface-hover);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   ALERTS & TOASTS
   ========================================================================== */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--secondary);
  color: #34D399;
}

.alert-error, .alert-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--accent);
  color: #F87171;
}

.alert-info {
  background-color: rgba(59, 130, 246, 0.15);
  border: 1px solid #3B82F6;
  color: #60A5FA;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: auto;
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SCANNER & FRAME CANVAS STYLES
   ========================================================================== */
.scanner-viewport {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 340px;
  background-color: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0 auto 1.5rem;
  border: 2px solid var(--primary);
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  box-shadow: 0 0 12px 3px var(--primary);
  animation: scan 2s infinite alternate ease-in-out;
}

@keyframes scan {
  from { top: 5%; }
  to { top: 95%; }
}

.canvas-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #05070B;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  margin-bottom: 1.5rem;
}

#frameCanvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE-FIRST 360px+)
   ========================================================================== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }
  .nav-links {
    display: none;
  }
  #mobileMenuBtn {
    display: block !important;
  }
  .brand-logo img {
    max-height: 38px !important;
    max-width: 175px !important;
  }
  .container {
    padding: 0 1rem;
  }
  .card {
    padding: 1.15rem;
  }
  .btn-lg {
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
  }
}

