:root {
  --bg: #ffffff;
  --ink: #0b1320;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #00b6a6;
  --brand-hover: #079a8d;
  --danger: #dc2626;
  --warning: #eab308;
  --success: #10b981;
  --info: #2563eb;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(16,24,40,.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--ink);
  background: var(--bg);
}

/* Topbar minimalista */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .back {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.topbar .back:hover {
  background: #f9fafb;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}
.topbar .brand img {
  height: 28px;
}
.topbar .spacer {
  flex: 1;
}

/* Container principal */
.container {
  width: 90%;
  margin: 24px auto;
  padding: 0 16px;
}

/* Filtros */
.filters-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 24px;
}
.field label {
  display: block;
  color: #475569;
  font-size: .4rem;
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field.actions {
  display: flex;
  gap: 8px;
}

/* Buttons */
.btn {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover {
  background: #f9fafb;
}
.btn.outline {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn.outline:hover {
  background: #f0fdfa;
}
.btn.small {
  padding: 6px 10px;
  font-size: .9rem;
}
.btn.success {
  background: var(--success);
  border-color: var(--success);
}
.btn.warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #231a05;
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

/* Chips (status) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .85rem;
  border: 1px solid transparent;
}
.chip-billed {background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8}
.chip-ontrack {background:#ecfeff; border-color:#99f6e4; color:#0f766e}
.chip-delivered {background:#ecfdf5; border-color:#a7f3d0; color:#047857}
.chip-delivered-alt {background:#fffbeb; border-color:#fde68a; color:#92400e}
.chip-late {background:#fef2f2; border-color:#fecaca; color:#b91c1c}
.chip-cancel {background:#f8fafc; border-color:#e2e8f0; color:#475569}

/* Tabela */
.table-responsive {
  overflow: auto;
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
  font-size: .9rem;
  padding: 12px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: .8rem;
  color: #0f172a;
}

/* Paginação */
.pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  color: #64748b;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal[aria-hidden="false"] {
  display: flex;
}
.modal-content {
  width: min(980px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  position: relative;
}
.modal-close {
  position: absolute;
  right: 16px;
  top: 12px;
  font-size: 24px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.kv span {
  color: #6b7280;
}
.itens {
  list-style: disc;
  padding-left: 18px;
}
.docs .doc-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.doc-link a {
  color: #0ea5e9;
  text-decoration: none;
}
.doc-link a:hover {
  text-decoration: underline;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Timeline */
.timeline {
  display: flex;
  gap: 14px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  margin-top: 8px;
}
.step {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  width: 130px;
}
.step .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
}
.step.active .dot {
  border-color: #00b6a6;
  background: #e6fffb;
}
.step.done .dot {
  border-color: #10b981;
  background: #ecfdf5;
}
.step small {
  color: #6b7280;
}

/* Responsivo */
@media (max-width: 980px){
  .filters-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .container { width: 95%; }
}
.table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.85rem; /* 👈 fonte menor */
}
.table thead th {
  text-align: left;
  color: #64748b;
  font-weight: 600;
  font-size: 0.8rem; /* 👈 levemente menor */
  padding: 10px 8px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.docs .doc-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.file-wrapper input[type="file"] {
  display: none;
}

#nf-selected,
#boleto-selected {
  font-size: 0.8rem;
  color: #666;
}
.docs .doc-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.docs .doc-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.file-wrapper input[type="file"] {
  display: none;
}

#nf-selected,
#boleto-selected {
  font-size: 0.8rem;
  color: #666;
}
/* ====== Base: aparência moderna do select ====== */
.status-select,
#filtroStatus {
  --sel-bg: #f9fafb;           /* fundo padrão */
  --sel-ink: #0b1320;          /* texto */
  --sel-bd: #e5e7eb;           /* borda normal */
  --sel-bd-focus: #00b6a6;     /* borda foco */
  --sel-bg-focus: #ffffff;     /* fundo foco */
  --sel-shadow: 0 1px 2px rgba(0,0,0,.06);
  --sel-radius: 12px;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  min-width: 220px;            /* mais largo */
  max-width: 320px;
  padding: 10px 40px 10px 12px;

  background: var(--sel-bg);
  color: var(--sel-ink);
  border: 1px solid var(--sel-bd);
  border-radius: var(--sel-radius);
  box-shadow: var(--sel-shadow);
  font: 500 14px/1.2 "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;

  /* chevron (seta) por SVG no fundo à direita */
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235B6876' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.status-select:focus,
#filtroStatus:focus {
  outline: none;
  border-color: var(--sel-bd-focus);
  background-color: var(--sel-bg-focus);
  box-shadow: 0 0 0 3px rgba(204, 204, 204, 0.15);
}

/* Estado desabilitado (se usar) */
.status-select:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Em células de tabela, evita “apertar” o select */
.table td .status-select {
  min-width: 240px;
}

/* ====== Cores por Status (Chrome/Edge/Opera/Safari com :has) ====== */
/* Vazio: “—” */
.status-select:has(option:checked[value=""]),
#filtroStatus:has(option:checked[value=""]) {
  --sel-bg: #f9fafb;
  --sel-ink: #0b1320;
  --sel-bd: #e5e7eb;
}

/* Pedido faturado */
.status-select:has(option:checked[value="Pedido faturado"]) {
  --sel-bg: #ecfdf5;      /* verde claro */
  --sel-ink: #065f46;     /* verde escuro */
  --sel-bd: #a7f3d0;
}

/* Em trânsito */
.status-select:has(option:checked[value="Em trânsito"]) {
  --sel-bg: #eff6ff;      /* azul claro */
  --sel-ink: #1e40af;     /* azul escuro */
  --sel-bd: #bfdbfe;
}

/* Pedido entregue */
.status-select:has(option:checked[value="Pedido entregue"]) {
  --sel-bg: #f0fdf4;      /* verde sucesso */
  --sel-ink: #166534;
  --sel-bd: #bbf7d0;
}

/* Entregue com alteração */
.status-select:has(option:checked[value="Entregue com alteração"]) {
  --sel-bg: #fff7ed;      /* laranja claro */
  --sel-ink: #9a3412;     /* laranja escuro */
  --sel-bd: #fed7aa;
}

/* Em atraso */
.status-select:has(option:checked[value="Em atraso"]) {
  --sel-bg: #fef2f2;      /* vermelho claro */
  --sel-ink: #991b1b;     /* vermelho escuro */
  --sel-bd: #fecaca;
}

/* Cancelado */
.status-select:has(option:checked[value="Cancelado"]) {
  --sel-bg: #f5f3ff;      /* roxo claro */
  --sel-ink: #4c1d95;     /* roxo escuro */
  --sel-bd: #ddd6fe;
}

/* ====== (Opcional) estiliza as <option> para quem suporta ====== */
.status-select option {
  font-weight: 500;
}

/* ====== Dark mode (opcional) ====== */
@media (prefers-color-scheme: dark) {
  .status-select,
  #filtroStatus {
    --sel-bg: #0f172a;
    --sel-ink: #e5e7eb;
    --sel-bd: #23324d;
    --sel-bg-focus: #0b1224;
  }
}
/* ======= Estilo base do dropdown ======= */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  min-width: 240px;
  padding: 10px 40px 10px 14px;

  background-color: #ffffff;      /* fundo branco fixo */
  color: #1f2937;                  /* cinza-escuro legível */
  border: 1px solid #d1d5db;       /* borda suave */
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);

  font: 500 14px/1.2 "Inter", system-ui, sans-serif;
  cursor: pointer;

  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;

  transition: all .2s ease;
}

.status-select:focus {
  outline: none;
  border-color: #00b6a6;
  box-shadow: 0 0 0 3px rgba(0,182,166,.15);
}

/* ======= Cores por status selecionado ======= */
.status-select:has(option:checked[value="Pedido faturado"]) {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.status-select:has(option:checked[value="Em trânsito"]) {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.status-select:has(option:checked[value="Pedido entregue"]) {
  background-color: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}

.status-select:has(option:checked[value="Entregue com alteração"]) {
  background-color: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.status-select:has(option:checked[value="Em atraso"]) {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.status-select:has(option:checked[value="Cancelado"]) {
  background-color: #f5f3ff;
  color: #6d28d9;
  border-color: #c4b5fd;
}
/* ======= Estilo base para TODOS os selects ======= */
.status-select,
#filtroStatus {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  min-width: 240px;
  padding: 10px 40px 10px 14px;

  background-color: #ffffff;      /* fundo branco fixo */
  color: #1f2937;                  /* texto cinza escuro */
  border: 1px solid #d1d5db;       /* borda suave */
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);

  font: 500 14px/1.2 "Inter", system-ui, sans-serif;
  cursor: pointer;

  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;

  transition: all .2s ease;
}

.status-select:focus,
#filtroStatus:focus {
  outline: none;
  border-color: #00b6a6;
  box-shadow: 0 0 0 3px rgba(0,182,166,.15);
}

/* ======= Estilos de cor por status (apenas nas linhas da tabela) ======= */
.status-select:has(option:checked[value="Pedido faturado"]) {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.status-select:has(option:checked[value="Em trânsito"]) {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.status-select:has(option:checked[value="Pedido entregue"]) {
  background-color: #f0fdf4;
  color: #15803d;
  border-color: #86efac;
}

.status-select:has(option:checked[value="Entregue com alteração"]) {
  background-color: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.status-select:has(option:checked[value="Em atraso"]) {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.status-select:has(option:checked[value="Cancelado"]) {
  background-color: #f5f3ff;
  color: #6d28d9;
  border-color: #c4b5fd;
}
.status-select,
#filtroStatus {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  min-width: 240px;
  padding: 10px 40px 10px 14px;

  background-color: #ffffff;
  color: #1f2937;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);

  font: 500 14px/1.2 "Inter", system-ui, sans-serif;
  cursor: pointer;

  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;

  transition: all .2s ease;

  /* ⚡ força modo claro no menu nativo do select */
  color-scheme: light;
}

.status-select:focus,
#filtroStatus:focus,
.status-select:active,
#filtroStatus:active {
  outline: none;
  background-color: #ffffff !important; /* força fundo claro ao clicar */
  color: #1f2937 !important;
  border-color: #00b6a6;
  box-shadow: 0 0 0 3px rgba(0,182,166,.15);
}
.itens-compact {
  margin: 0;
  padding-left: 18px;
  list-style: disc;
}
.itens-compact li {
  margin: 2px 0;
  line-height: 1.25;
  font-size: 13px; /* menor pra caber mais */
}
.itens-compact .muted {
  color: #6b7280;
}
.itens-compact code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
}
/* ====== Espaçamento maior entre os itens do mesmo fornecedor ====== */
.itens-compact {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
}

.itens-compact li {
  margin: 8px 0;              /* antes era ~2px — agora mais espaçado */
  padding-bottom: 6px;         /* cria um respiro entre os itens */
  border-bottom: 1px dashed #e5e7eb; /* linha sutil entre itens */
}

.itens-compact li:last-child {
  border-bottom: none;         /* remove a linha do último item */
}

.itens-compact .muted {
  color: #6b7280;
}

.itens-compact code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}
/* =======================================================
   DASHBOARD SUPERIOR (Cards de Resumo)
   ======================================================= */

/* Container em Grid (Responsivo) */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Estilo Base do Card */
.dash-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 5px solid #ccc; /* Cor padrão (será sobrescrita) */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: default;
}

.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Círculo do Ícone */
.dash-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0; /* Impede o ícone de amassar */
}

/* Textos (Título e Número) */
.dash-info {
  display: flex;
  flex-direction: column;
}

.dash-info h3 {
  margin: 0;
  font-size: 14px;
  color: #64748b; /* Cinza suave */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-info span {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b; /* Texto escuro */
  display: block;
  line-height: 1.2;
  margin-top: 4px;
}

/* --- VARIAÇÕES DE CORES --- */

/* 1. Azul (Em Trânsito) */
.dash-card.blue {
  border-left-color: #0ea5e9;
}
.dash-card.blue .dash-icon {
  background-color: #e0f2fe;
  color: #0284c7;
}

/* 2. Verde (Faturado) */
.dash-card.green {
  border-left-color: #22c55e;
}
.dash-card.green .dash-icon {
  background-color: #dcfce7;
  color: #16a34a;
}

/* 3. Vermelho (Cancelado) */
.dash-card.red {
  border-left-color: #ef4444;
}
.dash-card.red .dash-icon {
  background-color: #fee2e2;
  color: #dc2626;
}
/* --- LISTA DE ANEXOS (NF/Boletos) --- */
.anexos-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  max-width: 100%;
}

.file-chip a {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px; /* Limita largura do nome */
  display: inline-block;
  vertical-align: middle;
}

.file-chip a:hover {
  color: #0ea5e9;
  text-decoration: underline;
}

/* Botão X de remover */
.btn-remove-file {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-weight: bold;
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.btn-remove-file:hover {
  opacity: 1;
  background-color: #fee2e2;
  border-radius: 50%;
}

/* Botão de Adicionar (+) */
.btn-add-file {
  background-color: #fff;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-add-file:hover {
  border-color: #94a3b8;
  color: #334155;
  background-color: #f8fafc;
}
/* --- CONTAINER DOS FILTROS --- */
.filters-grid {
  display: flex;
  flex-wrap: wrap;         /* Permite quebrar linha se a tela for pequena */
  
  /* 👇 AQUI QUE CONTROLA A DISTÂNCIA */
  gap: 24px;               /* Aumentado para separar os inputs */
  
  align-items: flex-end;   /* Alinha tudo pela base */
  justify-content: flex-start;
}

/* --- CAMPOS INDIVIDUAIS --- */
.field {
  flex: 0 1 240px;         /* Tenta ocupar 240px, mas pode encolher */
  min-width: 150px;
  max-width: 100%;         /* Garante que não estoure no mobile */
}

/* --- GRUPO DE BOTÕES --- */
.field.actions {
  flex: 0 0 auto;          /* Ocupa só o espaço dos botões */
  display: flex;
  gap: 12px;               /* Espaço entre os botões (Aplicar x Limpar) */
}

/* --- AJUSTE MOBILE --- */
@media (max-width: 600px) {
  .filters-grid {
    flex-direction: column;
    gap: 16px;
  }
  .field, .field.actions {
    flex: 1 1 auto;
    width: 100%;
  }
}
/* =======================================================
   TOPBAR (Layout Novo: Título Esq. | Logo Centro)
   ======================================================= */
.topbar {
  display: grid;
  /* 3 colunas: Lado Esquerdo (ocupa espaço), Logo (tamanho auto), Lado Direito (ocupa espaço) */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  
  background-color: #fff;
  height: 64px;
  padding: 0 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* --- LADO ESQUERDO (Voltar + Título) --- */
.topbar-start {
  display: flex;
  align-items: center;
  gap: 16px; /* Espaço entre a seta e o título */
}

/* Botão Voltar */
.back {
  text-decoration: none;
  color: #64748b;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.back:hover {
  color: #0f172a;
}

/* Separador Vertical (Opcional, visual clean) */
.back::after {
  content: "";
  display: block;
  width: 1px;
  height: 16px;
  background-color: #e2e8f0;
  margin-left: 12px;
}

/* Título da Página */
.page-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

/* --- CENTRO (Logotipo) --- */
.topbar-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.brand-logo {
  height: 32px; /* Ajuste a altura do logo conforme necessário */
  width: auto;
  object-fit: contain;
}

/* --- LADO DIREITO (Vazio/Spacer) --- */
.topbar-end {
  /* Mantém vazio apenas para ocupar a 3ª coluna do grid e centralizar o logo */
}

/* --- AJUSTE MOBILE --- */
@media (max-width: 600px) {
  .topbar {
    padding: 0 16px;
  }
  .page-title {
    font-size: 14px;
    /* Em telas muito pequenas, podemos esconder o título se bater no logo */
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-logo {
    height: 24px;
  }
}
/* Linha destacada para pedido entregue */
.row-entregue {
    background-color: #dcfce7 !important; /* Verde claro */
    transition: background-color 0.3s ease;
}

/* Garante que o hover continue funcionando de forma elegante */
.row-entregue:hover {
    background-color: #bbf7d0 !important;
}

/* Opcional: deixar o texto um pouco mais escuro na linha verde */
.row-entregue td {
    color: #166534;
}
/* Container de Documentos na Tabela */
.docs-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-label {
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

/* Chip de Arquivo */
.file-chip {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.file-chip a {
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-chip:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

/* Botão de Adicionar Documento */
.btn-add-doc {
    background: #fff;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-add-doc:hover {
    border-color: #10b981;
    color: #10b981;
    background: #f0fdf4;
}

/* Alinhamentos da Tabela */
.text-center { text-align: center; }
.table th { background: #f8fafc; text-transform: uppercase; font-size: 11px; letter-spacing: 1px; }
/* Estilo Base do Dropdown */
.muda-status {
    appearance: none; /* Remove a seta padrão do navegador */
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding: 8px 30px 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    width: 100%;
    text-transform: uppercase;
}

/* Variações de Cores baseadas no Status */
.status-faturado { background-color: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.status-transito { background-color: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.status-entregue { background-color: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.status-alteracao { background-color: #fffbeb; color: #b45309; border-color: #fef3c7; }
.status-atraso { background-color: #fff1f2; color: #e11d48; border-color: #fecdd3; }
.status-cancelado { background-color: #1e293b; color: #ffffff; border-color: #0f172a; }

.muda-status:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.table th {
    text-align: left !important;
    padding-left: 12px;
}

/* Overlay Background */
.upload-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px); /* Efeito Fosco */
    display: none; /* Escondido por padrão */
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Caixa Central */
.upload-modal {
    background: white;
    padding: 30px 50px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.upload-modal p {
    margin: 0;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

/* Spinner de Linhas */
.spinner-loader {
    width: 48px;
    height: 48px;
    border: 3px solid #f1f5f9;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}
.spinner-loader::after {
    content: '';  
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #2563eb; /* Cor azul Mekabim */
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Classe para Sucesso */
.upload-success-icon {
    color: #10b981;
    font-size: 48px;
    animation: scaleUp 0.3s ease-out;
}

@keyframes scaleUp {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Container de Filtros */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: flex-end; /* Alinha o botão por baixo com os inputs */
}

/* Grupo de Campo (Label + Input) */
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-field label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

/* Estilização Comum: Inputs e Selects */
.filter-field input, 
.filter-field select {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

/* Efeito de Foco */
.filter-field input:focus, 
.filter-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background-color: #fff;
}

/* Estilo do Botão Limpar */
#btnLimparFiltros {
    height: 43px; /* Mesma altura dos inputs */
    padding: 0 20px;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

#btnLimparFiltros:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

#btnLimparFiltros:active {
    transform: translateY(0);
}

/* Ajuste de ícone no botão se desejar usar */
#btnLimparFiltros i {
    font-size: 14px;
}

/* Responsividade: No mobile os campos ocupam 100% */
@media (max-width: 768px) {
    .filters-container {
        grid-template-columns: 1fr;
    }
}