/**
 * ============================================================================
 * BIN MOTORS • SUÍTE DE GESTÃO AUTOMOTIVA & OFICINA MECÂNICA (v1.0)
 * GRUPO BIN HOLDING - PADRÃO ALTO CONTRASTE E WCAG AAA
 * ============================================================================
 * - Gestão de Ordens de Serviço (OS) com Placa Mercosul / Padrão
 * - Checklist de Entrada Veicular (Combustível, Avarias, Estepe)
 * - Orçamento de Peças + Mão de Obra com Margem de Lucro
 * - Status Operacional com Linha do Tempo e Notificação WhatsApp
 * ============================================================================
 */

/* 1. HERO CARD & CABEÇALHO BIN MOTORS */
.motors-hero-card {
  background: linear-gradient(135deg, #09121e 0%, #172554 50%, #1e3a8a 100%);
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

body.theme-light .motors-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 60%, #dbeafe 100%);
  border: 2px solid #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.motors-hero-title h2 {
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

body.theme-light .motors-hero-title h2 {
  color: #0f172a;
}

.motors-hero-title p {
  font-size: 14px;
  font-weight: 600;
  color: #93c5fd;
  margin: 0;
}

body.theme-light .motors-hero-title p {
  color: #1e3a8a;
  font-weight: 700;
}

.btn-motors-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #60a5fa;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-motors-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-motors-amber {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #fcd34d;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-motors-amber:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #b45309, #92400e);
}

/* 2. GRID DE KPIS AUTOMOTIVOS */
.motors-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.motors-kpi-card {
  background: #0f172a;
  border: 2px solid #1e293b;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.theme-light .motors-kpi-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.motors-kpi-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.motors-kpi-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 6px;
}

body.theme-light .motors-kpi-label {
  color: #475569;
  font-weight: 800;
}

.motors-kpi-value {
  font-size: 24px;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.1;
  margin-bottom: 4px;
}

body.theme-light .motors-kpi-value {
  color: #0f172a;
}

.motors-kpi-sub {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

body.theme-light .motors-kpi-sub {
  color: #64748b;
  font-weight: 700;
}

/* 3. BARRA DE FERRAMENTAS E FILTROS */
.motors-toolbar {
  background: #0f172a;
  border: 2px solid #1e293b;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

body.theme-light .motors-toolbar {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.motors-search-box {
  display: flex;
  align-items: center;
  background: #020617;
  border: 2px solid #334155;
  border-radius: 10px;
  padding: 4px 12px;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

body.theme-light .motors-search-box {
  background: #f8fafc;
  border: 2px solid #94a3b8;
}

.motors-search-box input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  width: 100%;
  padding: 6px 0;
}

body.theme-light .motors-search-box input {
  color: #0f172a;
}

.motors-status-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-motors-filter {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.theme-light .btn-motors-filter {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-motors-filter:hover {
  background: #334155;
  color: #ffffff;
}

body.theme-light .btn-motors-filter:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-motors-filter.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #60a5fa;
  font-weight: 800;
}

/* 4. CARDS DE ORDEM DE SERVIÇO (OS) */
.motors-os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.motors-os-card {
  background: #0f172a;
  border: 2px solid #1e293b;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.theme-light .motors-os-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.motors-os-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.motors-os-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

/* PLACA ESTILO MERCOSUL BRASIL */
.placa-mercosul {
  display: inline-flex;
  flex-direction: column;
  border: 2.5px solid #000000;
  border-radius: 6px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  min-width: 110px;
  text-align: center;
  user-select: none;
}

.placa-mercosul-topo {
  background: #003399;
  color: #ffffff;
  font-size: 8px;
  font-weight: 900;
  padding: 1px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.5px;
}

.placa-mercosul-numero {
  color: #000000;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  padding: 2px 6px;
}

.motors-os-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.motors-os-veiculo {
  font-size: 15px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}

body.theme-light .motors-os-veiculo {
  color: #0f172a;
}

.motors-os-cliente {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

body.theme-light .motors-os-cliente {
  color: #1d4ed8;
  font-weight: 800;
}

.motors-os-status-badge {
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

/* BADGES DE STATUS COM ALTO CONTRASTE */
.status-aguardando {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: #f59e0b;
}
body.theme-light .status-aguardando {
  background: #fef3c7;
  color: #b45309;
  border-color: #f59e0b;
}

.status-reparo {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-color: #3b82f6;
}
body.theme-light .status-reparo {
  background: #dbeafe;
  color: #1e40af;
  border-color: #2563eb;
}

.status-pecas {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: #a855f7;
}
body.theme-light .status-pecas {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #9333ea;
}

.status-pronto {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: #22c55e;
}
body.theme-light .status-pronto {
  background: #dcfce7;
  color: #15803d;
  border-color: #16a34a;
}

.status-entregue {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border-color: #64748b;
}
body.theme-light .status-entregue {
  background: #f1f5f9;
  color: #334155;
  border-color: #94a3b8;
}

.motors-os-sintoma-box {
  background: #020617;
  border-left: 4px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  line-height: 1.4;
}

body.theme-light .motors-os-sintoma-box {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  color: #1e293b;
  font-weight: 700;
}

.motors-os-valores-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed #334155;
}

body.theme-light .motors-os-valores-row {
  border-top-color: #cbd5e1;
}

.motors-os-total-label {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
}

body.theme-light .motors-os-total-label {
  color: #475569;
}

.motors-os-total-val {
  font-size: 18px;
  font-weight: 900;
  color: #34d399;
}

body.theme-light .motors-os-total-val {
  color: #065f46;
}

.motors-os-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-os-action {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-os-edit {
  background: #1e293b;
  color: #38bdf8;
  border-color: #38bdf8;
}
body.theme-light .btn-os-edit {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.btn-os-whatsapp {
  background: #065f46;
  color: #ffffff;
  border-color: #34d399;
}
body.theme-light .btn-os-whatsapp {
  background: #059669;
  color: #ffffff;
  border-color: #10b981;
}

.btn-os-print {
  background: #334155;
  color: #f8fafc;
}
body.theme-light .btn-os-print {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* 5. MODAL DE NOVA / EDITAR ORDEM DE SERVIÇO */
.motors-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.motors-modal-container {
  background: #0f172a;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

body.theme-light .motors-modal-container {
  background: #ffffff;
  border: 2px solid #2563eb;
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.2);
}

.motors-modal-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  border-bottom: 2px solid #2563eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.theme-light .motors-modal-header {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-bottom: 2px solid #93c5fd;
}

.motors-modal-header h3 {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.theme-light .motors-modal-header h3 {
  color: #0f172a;
}

.motors-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.motors-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.motors-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.motors-form-group label {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.theme-light .motors-form-group label {
  color: #1e293b;
  font-weight: 800;
}

.motors-input {
  background: #020617;
  border: 2px solid #334155;
  border-radius: 8px;
  padding: 9px 12px;
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s ease;
}

body.theme-light .motors-input {
  background: #f8fafc;
  border: 2px solid #94a3b8;
  color: #0f172a;
}

.motors-input:focus {
  border-color: #3b82f6;
}

.motors-checklist-box {
  background: #020617;
  border: 2px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

body.theme-light .motors-checklist-box {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
}

.motors-check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  cursor: pointer;
}

body.theme-light .motors-check-label {
  color: #0f172a;
}

.motors-modal-footer {
  padding: 14px 20px;
  background: #09121e;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

body.theme-light .motors-modal-footer {
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
}
