/* ==================== LOGIN ==================== */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0f172a; padding: 20px; }
.login-card { background: #fff; width: 100%; max-width: 420px; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header .logo-icon { font-size: 2.5rem; color: #d97706; margin-bottom: 10px; }
.login-header h2 { font-family: 'Fraunces', serif; color: #0f172a; }

/* ==================== CARDS & KPIS ==================== */
.card { background: #fff; border-radius: 8px; border: 1px solid var(--border-color); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border-color); }
.card-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--primary-color); }
.card-body { padding: 24px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 16px; }
.kpi-icon { width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.icon-blue { background: #dbeafe; color: #1e40af; }
.icon-yellow { background: #fef3c7; color: #92400e; }
.icon-orange { background: #ffedd5; color: #9a3412; }
.icon-green { background: #dcfce7; color: #166534; }
.kpi-title { display: block; font-size: 0.85rem; color: var(--text-muted); }
.kpi-value { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); }

.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 30px; }
@media(max-width: 992px) { .charts-grid { grid-template-columns: 1fr; } }

/* ==================== TABELAS ==================== */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 14px 20px; border-bottom: 1px solid var(--border-color); }
.data-table th { background: #f8fafc; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.data-table tbody tr:hover { background-color: #f8fafc; }

/* ==================== BADGES ==================== */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-novo { background: var(--status-novo-bg); color: var(--status-novo-text); }
.badge-etiqueta-impressa { background: var(--status-etiqueta-bg); color: var(--status-etiqueta-text); }
.badge-em-produção { background: var(--status-producao-bg); color: var(--status-producao-text); }
.badge-concluído { background: var(--status-concluido-bg); color: var(--status-concluido-text); }
.badge-atrasado { background: var(--status-atrasado-bg); color: var(--status-atrasado-text); }
.badge-primary { background: var(--primary-color); color: #fff; }

/* ==================== FORMS & BOTÕES ==================== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 0.875rem; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.9rem; outline: none; }
.form-control:focus { border-color: var(--primary-color); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 6px; font-weight: 500; cursor: pointer; border: none; font-size: 0.9rem; transition: 0.2s; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #e2e8f0; color: var(--text-main); }
.btn-secondary:hover { background: #cbd5e1; }
.btn-block { width: 100%; }
.btn-icon { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; padding: 6px; }

/* ==================== BARRAS DE FILTRO E AÇÕES ==================== */
.filters-bar { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.input-icon { position: relative; width: 100%; }
.input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon input { padding-left: 40px; }
.actions-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: #fff; padding: 12px 20px; border-radius: 6px; border: 1px solid var(--border-color); }

/* ==================== MODAIS ==================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 8px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-lg { max-width: 750px; }
.modal-header { padding: 16px 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ==================== TIMELINE ==================== */
.timeline { list-style: none; position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-gold); border: 2px solid #fff; }
.timeline-date { font-size: 0.75rem; color: var(--text-muted); }

/* ==================== TOASTS ==================== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border-left: 4px solid var(--primary-color); padding: 12px 20px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ==================== DETALHES E FILA ==================== */
.order-details-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media(max-width: 992px) { .order-details-grid { grid-template-columns: 1fr; } }
.grid-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item-piece-card { border: 1px solid var(--border-color); padding: 16px; margin: 16px; border-radius: 6px; background: #fff; }
.tag-custom { display: inline-block; background: #f1f5f9; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; margin: 2px; }
.fila-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

/* ==================== CONFIGURAÇÕES ==================== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.config-actions {
  position: sticky;
  bottom: 20px;
  display: flex;
  justify-content: flex-end;
  padding: 16px 24px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  z-index: 10;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  user-select: none;
}

.switch-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.callout-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #1e40af;
  margin-top: 16px;
  line-height: 1.5;
}

.callout-info i {
  margin-top: 2px;
  flex-shrink: 0;
}

/* ==================== FILA ==================== */
.fila-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.fila-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.fila-card-atrasado {
  border-left: 4px solid #dc2626;
}

.fila-card-atrasado .card-header {
  background: #fef2f2;
}

body.dark-mode .fila-card-atrasado .card-header {
  background: #450a0a;
}

/* Estado vazio amigável */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  color: #cbd5e1;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

body.dark-mode .empty-state i {
  color: #475569;
}

/* Linha do próprio usuário logado */
.row-self {
  background: #eff6ff;
}
body.dark-mode .row-self {
  background: #1e3a8a33;
}

/* Badges de perfil */
.badge-admin { background: #fee2e2; color: #991b1b; }
.badge-supervisor { background: #fef3c7; color: #92400e; }
.badge-operador { background: #dbeafe; color: #1e40af; }

body.dark-mode .badge-admin { background: #7f1d1d; color: #fecaca; }
body.dark-mode .badge-supervisor { background: #78350f; color: #fde68a; }
body.dark-mode .badge-operador { background: #1e3a8a; color: #bfdbfe; }

/* Ícone do canal na listagem */
.canal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.04);
  font-size: 0.95rem;
  vertical-align: middle;
}

body.dark-mode .canal-icon {
  background: rgba(255,255,255,0.06);
}

/* Radio group customizado no modal */
.radio-group .switch-label {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.15s ease;
  align-items: flex-start;
}

.radio-group .switch-label:hover {
  border-color: var(--primary-color);
  background: #f8fafc;
}

.radio-group .switch-label input[type="radio"]:checked + span {
  color: var(--primary-color);
}

.radio-group .switch-label input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--primary-color);
}

/* SKU com fonte monoespaçada */
.sku-code {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.82rem;
  padding: 2px 6px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
}

body.dark-mode .sku-code {
  background: #334155;
  color: #cbd5e1;
}

/* Coluna de preço alinhada à direita */
.preco-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Checkboxes de canais */
.canais-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
}

body.dark-mode .canais-checkboxes {
  background: #0f172a;
}

.canais-checkboxes .switch-label {
  font-weight: 400;
  font-size: 0.9rem;
}

/* Toasts por tipo */
.toast.toast-success { border-left-color: #059669; }
.toast.toast-success i { color: #059669; }

.toast.toast-error { border-left-color: #dc2626; }
.toast.toast-error i { color: #dc2626; }

.toast.toast-warning { border-left-color: #d97706; }
.toast.toast-warning i { color: #d97706; }

.toast.toast-info { border-left-color: #2563eb; }
.toast.toast-info i { color: #2563eb; }

/* Animação de saída */
.toast-out {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* Dark mode: fundo do toast */
body.dark-mode .toast {
  background: #1e293b;
  color: #e2e8f0;
}











/* ============================================================
   LOGIN — REFINAMENTO VISUAL
   ============================================================ */

/* Card centralizado com sombra profunda */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Efeito decorativo sutil ao fundo */
.login-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.login-card {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  padding: 44px 40px 36px;
  border-radius: 16px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 1;
}

/* ---------- Cabeçalho ---------- */
.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo-icon {
  font-size: 2.8rem;
  color: #d97706;
  margin-bottom: 12px;
  display: inline-block;
  line-height: 1;
}

.login-header h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 400;
  margin: 0;
}

/* ---------- Formulário ---------- */
#form-login .form-group {
  margin-bottom: 18px;
}

#form-login .form-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

#form-login .form-group label i {
  color: #d97706;
  font-size: 0.8rem;
  width: 14px;
}

/* Inputs com estilo consistente */
#form-login .form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#form-login .form-control:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

#form-login .form-control:focus {
  border-color: #d97706;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12);
}

#form-login .form-control::placeholder {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Select com seta customizada */
#form-login select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* ---------- Botão de Login ---------- */
.btn-login {
  margin-top: 8px;
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.01em;
  background: #0f172a;
  color: #ffffff;
  transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
  background: #1e293b;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

.btn-login:active {
  transform: translateY(1px);
}

/* ---------- Link "Esqueci minha senha" ---------- */
.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-footer a:hover {
  color: #d97706;
  text-decoration: underline;
}

.login-footer a i {
  font-size: 0.8rem;
}

/* ---------- Responsivo ---------- */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 28px;
    border-radius: 12px;
  }

  .login-header .logo-icon {
    font-size: 2.4rem;
  }

  .login-header h2 {
    font-size: 1.5rem;
  }
}

/* ---------- Dark mode (se aplicado antes do login) ---------- */
body.dark-mode .login-card {
  background: #1e293b;
}

body.dark-mode .login-header h2 {
  color: #f1f5f9;
}

body.dark-mode .login-subtitle {
  color: #94a3b8;
}

body.dark-mode #form-login .form-group label {
  color: #cbd5e1;
}

body.dark-mode #form-login .form-control {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode #form-login .form-control:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

body.dark-mode .btn-login {
  background: #f59e0b;
  color: #0f172a;
}

body.dark-mode .btn-login:hover {
  background: #d97706;
}

body.dark-mode .login-footer a {
  color: #94a3b8;
}

body.dark-mode .login-footer a:hover {
  color: #f59e0b;
}

/* ============================================================
   BARRA DE FILTROS — REFINAMENTO VISUAL
   ============================================================ */

/* Container da barra de filtros */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}

.filters-bar .filter-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.filters-bar .filter-group.flex-1 {
  flex: 1;
  min-width: 220px;
}

/* Inputs e selects na barra de filtros */
.filters-bar .form-control {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #334155;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.filters-bar .form-control:hover {
  border-color: #cbd5e1;
}

.filters-bar .form-control:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.filters-bar .form-control::placeholder {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Select customizado na barra de filtros */
.filters-bar select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
  min-width: 170px;
}

/* Input de busca com ícone */
.input-icon {
  position: relative;
  width: 100%;
}

.input-icon > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.85rem;
  pointer-events: none;
  transition: color 0.2s ease;
}

.input-icon input.form-control {
  padding-left: 40px;
}

/* Quando o input tem foco, o ícone fica escuro */
.input-icon:focus-within > i {
  color: #0f172a;
}

/* ---------- Dark mode ---------- */
body.dark-mode .filters-bar .form-control {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode .filters-bar .form-control:hover {
  border-color: #475569;
}

body.dark-mode .filters-bar .form-control:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

body.dark-mode .input-icon > i {
  color: #64748b;
}

body.dark-mode .input-icon:focus-within > i {
  color: #f59e0b;
}

/* ============================================================
   BARRA DE AÇÕES (selected count + botões) — REFINAMENTO
   ============================================================ */

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  background: #ffffff;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  gap: 12px;
  flex-wrap: wrap;
}

.actions-bar .selected-count {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.actions-bar .actions-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.dark-mode .actions-bar {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .actions-bar .selected-count {
  color: #94a3b8;
}


/* ============================================================
   FILA — ABAS DE SETORES
   ============================================================ */
.fila-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.fila-tab {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.fila-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15,23,42,0.08);
}

.fila-tab.active {
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15,23,42,0.15);
}

body.dark-mode .fila-tab {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .fila-tab.active {
  color: #fff;
}

/* ============================================================
   FILA — ABAS DE SETORES
   ============================================================ */
.fila-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.fila-tab {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fila-tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.fila-tab.active {
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.fila-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
}

.fila-tab.active .fila-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

body.dark-mode .fila-tab {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.dark-mode .fila-tab.active {
  color: #fff;
}

/* ============================================================
   FILA — RESUMO POR SETOR (admins)
   ============================================================ */
.fila-resumo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 500;
}

.fila-resumo-badge strong {
  color: #0f172a;
}

body.dark-mode .fila-resumo-badge {
  background: #334155;
  color: #cbd5e1;
}

body.dark-mode .fila-resumo-badge strong {
  color: #f1f5f9;
}


/* ============================================================
   FUNCIONÁRIOS — CHECKBOXES DE SETORES
   ============================================================ */
.setores-checkbox-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-height: 320px;
  overflow-y: auto;
}

body.dark-mode .setores-checkbox-container {
  background: #0f172a;
}

.setores-linha-grupo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setores-linha-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.setores-linha-titulo i {
  color: var(--primary-color);
  font-size: 0.85rem;
}

.setores-checkbox-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

@media (max-width: 500px) {
  .setores-checkbox-list {
    grid-template-columns: 1fr;
  }
}

.setor-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.85rem;
  font-weight: 400;
}

.setor-checkbox:hover {
  background: rgba(15, 23, 42, 0.04);
}

body.dark-mode .setor-checkbox:hover {
  background: rgba(255, 255, 255, 0.04);
}

.setor-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.setor-checkbox-cor {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Badges de setor na listagem */
#tbody-funcionarios .badge {
  font-size: 0.7rem;
  padding: 3px 8px;
}



/* ============================================================
   BOTÕES — REFINAMENTO GLOBAL
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background var(--transition), transform var(--transition-fast), box-shadow var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: #cbd5e1;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* ============================================================
   BOTÕES DE ÍCONE (ações da tabela)
   ============================================================ */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  position: relative;
}

.btn-icon:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-icon.text-danger {
  color: #dc2626;
}

.btn-icon.text-danger:hover:not(:disabled) {
  background: #fef2f2;
  color: #b91c1c;
}

body.dark-mode .btn-icon:hover:not(:disabled) {
  background: #334155;
  color: #f1f5f9;
}

body.dark-mode .btn-icon.text-danger:hover:not(:disabled) {
  background: #450a0a;
  color: #fca5a5;
}

/* ============================================================
   BADGES — REFINAMENTO
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.3;
}

.badge-primary {
  background: var(--primary-color);
  color: #fff;
}

/* ============================================================
   INPUTS E FORMULÁRIOS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-strong);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-strong);
  background: var(--bg-card);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-control:hover {
  border-color: var(--border-strong);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.form-control::placeholder {
  color: var(--text-subtle);
}

body.dark-mode .form-control:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ============================================================
   CARDS — REFINAMENTO
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  background: #fafbfc;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i {
  color: var(--accent-gold);
}

.card-body {
  padding: 24px;
}

body.dark-mode .card-header {
  background: #0f172a;
}

/* ============================================================
   KPIs — REFINAMENTO
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: var(--bg-card);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.kpi-title {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.03em;
  font-family: var(--font-serif);
}

/* ============================================================
   AÇÕES BAR (selected count + botões)
   ============================================================ */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--bg-card);
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
}

.selected-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.actions-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   MODAIS — REFINAMENTO
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFade 0.15s ease;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25), 0 8px 16px rgba(15, 23, 42, 0.15);
  animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-lg {
  max-width: 780px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h3 i {
  color: var(--accent-gold);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfc;
}

body.dark-mode .modal-footer {
  background: #0f172a;
}

/* ============================================================
   TOASTS — REFINAMENTO
   ============================================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--primary-color);
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15), 0 4px 8px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlide {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-out {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
  to { transform: translateX(120%); opacity: 0; }
}

.toast i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast.toast-success { border-left-color: #059669; }
.toast.toast-success i { color: #059669; }

.toast.toast-error { border-left-color: #dc2626; }
.toast.toast-error i { color: #dc2626; }

.toast.toast-warning { border-left-color: #d97706; }
.toast.toast-warning i { color: #d97706; }

.toast.toast-info { border-left-color: #2563eb; }
.toast.toast-info i { color: #2563eb; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-gold) 0%, var(--border-color) 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 22px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 2px var(--accent-gold);
}

.timeline-item strong {
  color: var(--text-strong);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 2px;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================================
   FILA — ABAS DE SETORES (refinamento)
   ============================================================ */
.fila-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.fila-tab {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.fila-tab:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-strong);
}

.fila-tab.active {
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.fila-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
}

.fila-tab.active .fila-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

body.dark-mode .fila-tab {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

/* ============================================================
   FILA — CARD DE PEÇA
   ============================================================ */
.fila-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.fila-card {
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  border-left: 3px solid transparent;
}

.fila-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--accent-gold);
}

.fila-card-atrasado {
  border-left-color: #dc2626;
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 20%);
}

.fila-card-atrasado:hover {
  border-left-color: #dc2626;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.15);
}

body.dark-mode .fila-card-atrasado {
  background: linear-gradient(180deg, #450a0a33 0%, #1e293b 20%);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 2px dashed var(--border-color);
}

.empty-state i {
  color: #cbd5e1;
  margin-bottom: 20px;
  display: block;
}

.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--text-strong);
  margin-bottom: 8px;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

body.dark-mode .empty-state {
  background: var(--bg-card);
  border-color: var(--border-color);
}

body.dark-mode .empty-state i {
  color: #475569;
}

/* ============================================================
   ROW SELF (linha do usuário logado)
   ============================================================ */
.row-self {
  background: linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

.row-self:hover {
  background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%) !important;
}

body.dark-mode .row-self {
  background: linear-gradient(90deg, #1e3a8a33 0%, #1e3a8a66 100%);
}

/* ============================================================
   CALL OUT INFO
   ============================================================ */
.callout-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #1e40af;
  margin-top: 16px;
  line-height: 1.5;
}

.callout-info i {
  margin-top: 2px;
  flex-shrink: 0;
  font-size: 1rem;
  color: #2563eb;
}

body.dark-mode .callout-info {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border-color: #1e40af;
  color: #bfdbfe;
}

/* ============================================================
   INPUT DE BUSCA COM ÍCONE
   ============================================================ */
.input-icon {
  position: relative;
  width: 100%;
}

.input-icon > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  font-size: 0.85rem;
  pointer-events: none;
  transition: color var(--transition);
}

.input-icon input.form-control {
  padding-left: 42px;
}

.input-icon:focus-within > i {
  color: var(--primary-color);
}

body.dark-mode .input-icon:focus-within > i {
  color: var(--accent-gold);
}

/* ============================================================
   FILTROS BAR
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}

.filters-bar .filter-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.filters-bar .filter-group.flex-1 {
  flex: 1;
  min-width: 240px;
}

.filters-bar .form-control {
  height: 44px;
}

.filters-bar select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 38px;
  cursor: pointer;
  min-width: 180px;
}

/* ============================================================
   ITEM PIECE CARD (Detalhes do Pedido)
   ============================================================ */
.item-piece-card {
  border: 1px solid var(--border-color);
  padding: 20px;
  margin: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.item-piece-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.tag-custom {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--border-light);
}

body.dark-mode .tag-custom {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}

/* ============================================================
   SKU CODE
   ============================================================ */
.sku-code {
  font-family: 'SFMono-Regular', 'Consolas', 'Monaco', monospace;
  font-size: 0.8rem;
  padding: 3px 8px;
  background: #f1f5f9;
  border-radius: 4px;
  color: #475569;
  border: 1px solid #e2e8f0;
}

body.dark-mode .sku-code {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

/* ============================================================
   PRECO COL
   ============================================================ */
.preco-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-strong);
}

/* ============================================================
   CANAIS ICONS
   ============================================================ */
.canal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 1rem;
  vertical-align: middle;
  transition: transform var(--transition);
}

.canal-icon:hover {
  transform: scale(1.05);
}

body.dark-mode .canal-icon {
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   RESPONSIVO COMPONENTES
   ============================================================ */
@media (max-width: 640px) {
  .actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-buttons {
    flex-direction: column;
  }

  .actions-buttons .btn {
    width: 100%;
  }

  .filters-bar .form-control {
    height: 40px;
  }

  .toast {
    min-width: auto;
    max-width: calc(100vw - 40px);
  }

  .modal-card {
    border-radius: var(--radius);
  }
}


/* ============================================================
   AUTOCOMPLETE DE PRODUTOS
   ============================================================ */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.autocomplete-suggestions.hidden {
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--bg-hover);
}

.autocomplete-item-sku {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.autocomplete-item-nome {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.autocomplete-item-linha .badge {
  font-size: 0.65rem;
  padding: 2px 8px;
}

.autocomplete-empty {
  padding: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.autocomplete-empty i {
  margin-right: 6px;
}

body.dark-mode .autocomplete-suggestions {
  background: var(--bg-card);
  border-color: var(--border-color);
}

body.dark-mode .autocomplete-item:hover {
  background: #334155;
}

/* ============================================================
   NOVO PEDIDO — CARDS DE PEÇA
   ============================================================ */
.np-peca-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: #fafbfc;
  position: relative;
}

.np-peca-card:hover {
  border-color: var(--border-strong);
}

body.dark-mode .np-peca-card {
  background: #0f172a;
}

.np-peca-card > .flex-between strong {
  color: var(--text-strong);
  font-size: 0.9rem;
}

/* ============================================================
   PEDIDOS — AGUARDANDO PAGAMENTO
   ============================================================ */
.pedido-nao-pago {
  background: linear-gradient(90deg, #fffbeb 0%, #ffffff 30%);
  opacity: 0.85;
}

.pedido-nao-pago:hover {
  background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 30%) !important;
}

.pedido-nao-pago td {
  color: #78350f;
}

.pedido-nao-pago .btn-icon:disabled {
  opacity: 0.4;
}

body.dark-mode .pedido-nao-pago {
  background: linear-gradient(90deg, #78350f33 0%, #1e293b 30%);
}

body.dark-mode .pedido-nao-pago:hover {
  background: linear-gradient(90deg, #78350f66 0%, #1e293b 30%) !important;
}

body.dark-mode .pedido-nao-pago td {
  color: #fde68a;
}

/* ============================================================
   AGRUPAMENTO POR LINHA — CATÁLOGO
   ============================================================ */
.catalogo-linha-divisor td {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.03) 0%, transparent 100%) !important;
  font-family: var(--font-body);
}

.catalogo-linha-divisor strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.catalogo-linha-divisor strong i {
  font-size: 0.9rem;
}

.catalogo-linha-divisor .badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

body.dark-mode .catalogo-linha-divisor td {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%) !important;
}

/* ============================================================
   AGRUPAMENTO POR LINHA — SETORES
   ============================================================ */
.setor-linha-divisor td {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.03) 0%, transparent 100%) !important;
}

.setor-linha-divisor strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.dark-mode .setor-linha-divisor td {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%) !important;
}

/* ============================================================
   AGRUPAMENTO POR LINHA — FILA (ABAS)
   ============================================================ */
.fila-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.fila-tab-linha-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  margin-right: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.85;
  white-space: nowrap;
}

.fila-tab-linha-label:first-of-type {
  margin-left: 0;
}

.fila-tab-linha-label i {
  font-size: 0.7rem;
}

/* ============================================================
   RESPONSIVO — AGRUPAMENTOS
   ============================================================ */
@media (max-width: 640px) {
  .catalogo-linha-divisor td,
  .setor-linha-divisor td {
    padding: 8px 12px !important;
  }

  .catalogo-linha-divisor strong,
  .setor-linha-divisor strong {
    font-size: 0.75rem;
  }

  .catalogo-linha-divisor .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .fila-tab-linha-label {
    margin-left: 6px;
    font-size: 0.62rem;
  }
}







/* ============================================================
   FILA — LISTA DE CAMPOS PERSONALIZADOS (1 POR LINHA)
   ============================================================ */
.fila-campos-lista {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.fila-campo {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8rem;
  line-height: 1.4;
  background: #ffffff;
  transition: background 0.15s ease;
}

.fila-campo:last-child {
  border-bottom: none;
}

.fila-campo:hover {
  background: #f8fafc;
}

.fila-campo-label {
  flex-shrink: 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
  /* ✅ Permite quebra de linha em vez de "..." */
  white-space: normal;
  word-break: break-word;
  max-width: 50%;
}

.fila-campo-valor {
  flex: 1;
  min-width: 0;
  color: var(--text-strong);
  font-weight: 600;
  word-break: break-word;
  white-space: normal;
}

/* ⭐ Gravação a Laser — fundo azul */
.fila-campo.fila-campo-laser {
  background: #dbeafe !important;
  border-left: 4px solid #3b82f6;
  padding-left: 8px;
}

.fila-campo.fila-campo-laser .fila-campo-label {
  color: #1e40af;
}

.fila-campo.fila-campo-laser .fila-campo-valor {
  color: #1e3a8a;
  font-weight: 700;
}

/* ⭐ Gema — fundo com a cor da gema (inline) */
.fila-campo.fila-campo-gema {
  border-left: 4px solid #94a3b8;
  padding-left: 8px;
}

/* Dark mode */
body.dark-mode .fila-campos-lista {
  background: #1e293b;
  border-color: #334155;
}

body.dark-mode .fila-campo {
  background: #1e293b;
  border-bottom-color: #334155;
}

body.dark-mode .fila-campo:hover {
  background: #334155;
}

body.dark-mode .fila-campo.fila-campo-laser {
  background: #1e3a8a !important;
}

body.dark-mode .fila-campo.fila-campo-laser .fila-campo-label {
  color: #bfdbfe;
}

body.dark-mode .fila-campo.fila-campo-laser .fila-campo-valor {
  color: #dbeafe;
}

/* ============================================================
   PRAZO NO DETALHES DO PEDIDO
   ============================================================ */
.badge-prazo-detalhes {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

.badge-prazo-detalhes i {
  font-size: 0.7rem;
}

/* Dark mode */
body.dark-mode .badge-prazo-detalhes {
  /* as cores já vêm inline, mas ajusta contraste se precisar */
}


/* ============================================================
   FILA — BADGES DE IDENTIFICAÇÃO RÁPIDA
   ============================================================ */
.fila-badges-rapidos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.fila-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* 🔴 Envio Full — vermelho */
.fila-badge-full {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
  animation: pulse-badge 2s ease-in-out infinite;
}

.fila-badge-full i {
  font-size: 0.7rem;
}

/* 🟡 Banhado a Ouro — amarelo */
.fila-badge-banhado {
  background: #fbbf24;
  color: #78350f;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.25);
}

.fila-badge-banhado i {
  font-size: 0.7rem;
}

/* Dark mode */
body.dark-mode .fila-badge-full {
  background: #b91c1c;
  color: #fee2e2;
}

body.dark-mode .fila-badge-banhado {
  background: #d97706;
  color: #78350f;
}

/* ⭐ Animação suave no badge de Envio Full (chama atenção) */
@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
  }
  50% {
    box-shadow: 0 2px 14px rgba(220, 38, 38, 0.45);
  }
}

/* ============================================================
   FILA — TIPO DE FRETE
   ============================================================ */
.fila-frete {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

.fila-frete i {
  font-size: 0.85rem;
}

body.dark-mode .fila-frete {
  /* cores vêm inline */
}



/* ============================================================
   ALTERAR SENHA (card em Configurações)
   ============================================================ */
#card-alterar-senha {
  /* Já tem border-left inline, mas garante consistência */
}

/* Banner amarelo de "senha temporária" */
#aviso-senha-temporaria {
  animation: senhaAvisoPulse 3s ease-in-out infinite;
}

@keyframes senhaAvisoPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0);
  }
}

/* Dark mode: banner amarelo mais escuro */
body.dark-mode #aviso-senha-temporaria {
  background: #78350f !important;
  border-color: #b45309 !important;
  color: #fde68a !important;
}

/* Área de erro do formulário */
#senha-erro {
  animation: senhaErroFadeIn 0.2s ease;
}

@keyframes senhaErroFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode: erro */
body.dark-mode #senha-erro {
  background: #7f1d1d !important;
  border-color: #991b1b !important;
  color: #fecaca !important;
}

/* Botão "Alterar Senha" durante o loading */
#btn-salvar-senha:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Inputs de senha no dark mode (herda do form-control, mas garante) */
body.dark-mode #senha-atual,
body.dark-mode #nova-senha,
body.dark-mode #confirmar-senha {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark-mode #senha-atual:focus,
body.dark-mode #nova-senha:focus,
body.dark-mode #confirmar-senha:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}