/* =============================================================================
   Rastreio de Mercadorias — Design System Original
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. Design Tokens (dark theme padrao)
   --------------------------------------------------------------------------- */
:root {
  --bg: #0b0d12;
  --bg-soft: #10131a;
  --panel: #151922;
  --panel-2: #1a1f2b;
  --line: rgba(255,255,255,0.07);
  --line-strong: rgba(255,255,255,0.12);
  --text: #eef0f4;
  --text-secondary: #9aa0ad;
  --text-dim: #9aa0ad;
  --text-faint: #5f6573;
  --amber: #f5a623;
  --blue: #4d8fff;
  --green: #34d399;
  --red: #f87171;
  --gray: #8b91a0;
  --purple: #a78bfa;
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-soft: #EFF6FF;
  --panel: #FFFFFF;
  --panel-2: #F1F5F9;
  --line: #E2E8F0;
  --line-strong: #CBD5E1;
  --text: #0F172A;
  --text-secondary: #64748B;
  --text-dim: #64748B;
  --text-faint: #94A3B8;
  --amber: #F59E0B;
  --blue: #2563EB;
  --green: #16A34A;
  --red: #DC2626;
  --gray: #64748B;
  --purple: #7C3AED;
}

/* ---------------------------------------------------------------------------
   2. Reset & Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.sidebar-tw a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------------------------------------------------------------------------
   3. Typography
   --------------------------------------------------------------------------- */
h1 { font: 600 1.4rem/1.2 'Inter', sans-serif; color: var(--text); letter-spacing: -0.02em; }
h2 { font: 600 1.15rem/1.3 'Inter', sans-serif; color: var(--text); letter-spacing: -0.01em; }
h3 { font: 600 1rem/1.4 'Inter', sans-serif; color: var(--text); }

.subtexto {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-top: 4px;
}

.text-mono, .mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   4. Messages / Alerts
   --------------------------------------------------------------------------- */
.mensagens {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mensagens-centro {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.alerta {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 4px solid;
  animation: slideIn 250ms ease;
}

.alerta-success  { background: rgba(22,163,74,0.10); border-left-color: var(--green); color: var(--green); }
.alerta-error    { background: rgba(220,38,38,0.10); border-left-color: var(--red); color: var(--red); }
.alerta-warning  { background: rgba(245,158,11,0.10);  border-left-color: var(--amber); color: var(--amber); }
.alerta-info     { background: rgba(37,99,235,0.10);  border-left-color: var(--blue); color: var(--blue); }

/* ---------------------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  background: var(--panel-2);
  color: var(--text-secondary);
  transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { background: var(--panel); color: var(--text); border-color: var(--line-strong); text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-principal { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.btn-principal:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn-bloco { width: 100%; }
.btn-perigo { background: var(--red); color: #fff; border-color: var(--red); font-weight: 600; }
.btn-perigo:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 0.78rem; border-radius: 6px; }
.btn svg { flex-shrink: 0; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-icone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-icone:hover { background: var(--panel-2); color: var(--text); }
.btn-icone-perigo:hover { background: rgba(220,38,38,.1); border-color: var(--red); color: var(--red); }
.col-acoes { width: 44px; text-align: right; }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-secundario { background: transparent; border-color: var(--line-strong); }
.btn-secundario:hover { background: var(--panel-2); }
.btn.ativo { background: rgba(245,158,11,0.12); color: var(--amber); border-color: rgba(245,158,11,0.25); }

/* ---------------------------------------------------------------------------
   6. Page Header
   --------------------------------------------------------------------------- */
.pagina-cabecalho {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.cabecalho-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.icone, .icone-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icone-sm { width: 22px; height: 22px; }

/* ---------------------------------------------------------------------------
   7. Content / Container
   --------------------------------------------------------------------------- */
.conteudo {
  flex: 1;
  padding: 24px;
  width: 100%;
}

.vazio {
  font-size: 0.85rem;
  color: var(--text-faint);
  text-align: center;
  padding: 40px 16px;
}

/* ---------------------------------------------------------------------------
   8. Flow Rail (Pipeline) — original flow-rail design
   --------------------------------------------------------------------------- */
.flow-rail {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 0;
  margin-bottom: 32px;
  align-items: center;
}

.flow-stop {
  background: var(--panel);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.flow-stop::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stop-recebido::before { background: var(--amber); }
.stop-saida::before    { background: var(--blue); }
.stop-pendente::before  { background: var(--gray); }
.stop-entregue::before  { background: var(--green); }

.flow-stop-top {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.flow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.stop-recebido .flow-dot { background: var(--amber); }
.stop-saida .flow-dot    { background: var(--blue); }
.stop-pendente .flow-dot  { background: var(--gray); }
.stop-entregue .flow-dot  { background: var(--green); }

.flow-num {
  font: 700 1.8rem/1.1 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
}
.stop-recebido .flow-num { color: var(--amber); }
.stop-saida .flow-num    { color: var(--blue); }
.stop-pendente .flow-num  { color: var(--text); }
.stop-entregue .flow-num  { color: var(--green); }

.flow-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.flow-link {
  width: 20px;
  height: 2px;
  background: var(--line-strong);
  position: relative;
}
.flow-link::before, .flow-link::after {
  content: '';
  width: 2px;
  height: 7px;
  background: var(--line-strong);
  position: absolute;
  top: -2px;
  border-radius: 1px;
}
.flow-link::before { left: 0; transform: rotate(20deg); }
.flow-link::after { left: 2px; transform: rotate(-20deg); }

/* ---------------------------------------------------------------------------
   9. Charts
   --------------------------------------------------------------------------- */
.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--line);
}

.chart-card h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-wrap, .donut-wrap {
  position: relative;
  width: 100%;
}
.chart-wrap canvas, .donut-wrap canvas {
  width: 100% !important;
}

.donut-canvas {
  position: relative;
}

.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-total {
  font: 700 1.4rem/1 'Inter', sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.donut-total-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  list-style: none;
}

.donut-legend li, .lg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  min-width: 0;
  list-style: none;
}

.lg-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.lg-bar {
  flex: 1;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.lg-bar-fill {
  height: 100%;
  border-radius: 2px;
}
.lg-count {
  font-weight: 600;
  min-width: 28px;
  text-align: right;
  color: var(--text);
}
.lg-pct {
  font-size: 0.72rem;
  color: var(--text-faint);
  min-width: 32px;
}

/* ---------------------------------------------------------------------------
   10. Kanban Board (3 colunas)
   --------------------------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.column {
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}

.col-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-count {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel-2);
  color: var(--text-secondary);
}

/* Cards */
.card {
  background: var(--panel-2);
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  transition: all 150ms ease;
}

.card:hover {
  border-color: var(--line-strong);
}

.card.amber { border-left: 3px solid var(--amber); }
.card.blue  { border-left: 3px solid var(--blue); }
.card.green { border-left: 3px solid var(--green); }
.card.gray  { border-left: 3px solid var(--gray); }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.card-date {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.meta-grid.single { grid-template-columns: 1fr; }

.meta-item {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.meta-item .meta-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}
.meta-item .meta-value {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}
.meta-item .meta-value.mono {
  font-family: 'JetBrains Mono', monospace;
}

.clients {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.clients-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.client-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel);
  color: var(--text-secondary);
  border: 1px solid var(--line);
  margin: 2px;
}
.client-chip .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.col-add {
  border: 2px dashed var(--line-strong);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 150ms ease;
  background: transparent;
  display: block;
  text-decoration: none;
}
.col-add:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(37,99,235,0.06);
  text-decoration: none;
}

.empty-note {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  padding: 16px 0;
}

/* ---------------------------------------------------------------------------
   11. Tables
   --------------------------------------------------------------------------- */
.tabela-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.tabela thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  text-align: left;
  padding: 12px 16px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.tabela tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.tabela tbody tr:last-child td { border-bottom: none; }
.tabela tbody tr:hover { background: var(--panel-2); }
.tabela tbody tr:nth-child(even) { background: var(--panel-2); }

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.status-entregue  { background: rgba(22,163,74,0.12); color: var(--green); }
.status-pendente  { background: rgba(139,145,160,0.12); color: var(--gray); }
.status-devolvido { background: rgba(245,158,11,0.12); color: var(--amber); }
.status-ocorrencia { background: rgba(220,38,38,0.12); color: var(--red); }
.status-chegou { background: rgba(245,158,11,0.12); color: var(--amber); }
.status-nao_entregue { background: rgba(220,38,38,0.12); color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-entregue  { background: var(--green); }
.dot-pendente  { background: var(--gray); }
.dot-devolvido { background: var(--amber); }
.dot-ocorrencia { background: var(--red); }
.dot-saida { background: var(--blue); }

/* Count badges */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--panel-2);
  color: var(--text-secondary);
}

.badge-contagem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--panel-2);
  color: var(--text-secondary);
}
.badge-contagem-recebido { background: rgba(245,158,11,0.12); color: var(--amber); }
.badge-contagem-saida    { background: rgba(37,99,235,0.12);  color: var(--blue); }
.badge-contagem-pendente { background: rgba(139,145,160,0.12); color: var(--gray); }
.badge-contagem-entregue { background: rgba(22,163,74,0.12); color: var(--green); }
.badge-contagem-entregue { background: rgba(22,163,74,0.12); color: var(--green); }

/* Transportadora avatar in table */
.transp-nome {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.transp-avatar {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}

.celula-acoes {
  display: flex;
  gap: 6px;
}

/* ---------------------------------------------------------------------------
   12. Forms
   --------------------------------------------------------------------------- */
.form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  max-width: 620px;
}

.campo-grupo {
  margin-bottom: 20px;
}

.campo-grupo label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.campo-grupo input[type="text"],
.campo-grupo input[type="password"],
.campo-grupo input[type="email"],
.campo-grupo input[type="number"],
.campo-grupo input[type="date"],
.campo-grupo input[type="datetime-local"],
.campo-grupo input[type="file"],
.campo-grupo select,
.campo-grupo textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 150ms ease;
  line-height: 1.5;
}

.campo-grupo input:hover,
.campo-grupo select:hover,
.campo-grupo textarea:hover {
  border-color: var(--line-strong);
}

.campo-grupo input:focus,
.campo-grupo select:focus,
.campo-grupo textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

.campo-grupo select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%239aa0ad' stroke-width='1.5' stroke-linecap='round' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.campo-grupo textarea { min-height: 90px; resize: vertical; }

.erro-campo {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--red);
}

.ajuda {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.acoes {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.formset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.formset legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 8px;
}

.cliente-linha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.cliente-linha + .cliente-linha {
  border-top: 1px solid var(--line);
}

.cliente-campo { flex: 1; max-width: 300px; }

.cliente-remover {
  font-size: 0.75rem;
  color: var(--red);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.cliente-remover:hover { opacity: 0.8; }

.preview-canhoto {
  max-width: 260px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 12px;
}

/* ---------------------------------------------------------------------------
   13. Detail Pages
   --------------------------------------------------------------------------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.head-left h1 {
  font: 600 1.2rem/1.3 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.head-actions {
  display: flex;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.status-pill .dot { width: 6px; height: 6px; }
.status-pill.recebido   { background: rgba(245,158,11,0.12); color: var(--amber); }
.status-pill.recebido .dot   { background: var(--amber); }
.status-pill.em_andamento    { background: rgba(37,99,235,0.12);  color: var(--blue); }
.status-pill.em_andamento .dot { background: var(--blue); }
.status-pill.concluido  { background: rgba(22,163,74,0.12); color: var(--green); }
.status-pill.concluido .dot  { background: var(--green); }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.sum-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.sum-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.sum-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.sum-sub {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 16px;
}

/* Detail card */
.detalhe-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.detalhe-item span {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  display: block;
  margin-bottom: 2px;
}
.detalhe-item strong {
  font-size: 0.9rem;
  color: var(--text);
}

/* Canhoto thumb */
.canhoto-thumb {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: transform 200ms ease;
  cursor: zoom-in;
}
.canhoto-thumb:hover { transform: scale(2.4); z-index: 10; position: relative; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.back-link:hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------------------------
   14. Timeline
   --------------------------------------------------------------------------- */
.timeline {
  position: relative;
  padding-left: 32px;
}
.tl-track {
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line-strong);
}
.tl-item {
  position: relative;
  margin-bottom: 24px;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-node {
  position: absolute;
  left: -25px;
  top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border: 2px solid;
  z-index: 2;
}
.tl-node.amber { border-color: var(--amber); }
.tl-node.blue  { border-color: var(--blue); }
.tl-node.green { border-color: var(--green); }
.tl-node.gray  { border-color: var(--gray); }
.tl-node.red   { border-color: var(--red); }
.tl-node svg { width: 11px; height: 11px; }

.tl-content {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.tl-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.tl-date {
  font-size: 0.75rem;
  color: var(--text-faint);
  white-space: nowrap;
}
.tl-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.tl-card {
  background: var(--panel);
  border-radius: 6px;
  padding: 12px;
  border: 1px solid var(--line);
}

.tl-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 14px;
}
.tl-meta-item {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.tl-meta-label {
  font-size: 0.65rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}
.tl-meta-value {
  color: var(--text);
  font-weight: 500;
}

.canhoto-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.tl-canhoto-thumb {
  width: 60px; height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
}
.canhoto-label {
  font-size: 0.72rem;
  color: var(--text-faint);
}

.tl-pending-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--amber);
}

.client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text-secondary);
}
.client-pill .dot { width: 6px; height: 6px; }
.tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.tag.entregue { background: rgba(22,163,74,0.15); color: var(--green); }
.tag.pendente { background: rgba(139,145,160,0.15); color: var(--gray); }
.tag.chegou { background: rgba(245,158,11,0.15); color: var(--amber); }
.tag.nao_entregue { background: rgba(220,38,38,0.15); color: var(--red); }

.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-faint);
}
.empty-state p { font-size: 0.85rem; }

/* ---------------------------------------------------------------------------
   15. Login Page
   --------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
/* Mensagens fora do fluxo: evitam que o card "pule" quando aparecem */
.login-page .mensagens {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 460px;
  margin: 0;
  z-index: 200;
}
.login-page .conteudo {
  flex: 0 1 auto;
  padding: 0;
  width: 100%;
  max-width: 400px;
}
.login-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
}
.login-logo {
  font: 700 1.8rem/1.1 'Inter', sans-serif;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.brand-icon {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.login-subtitulo {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 32px;
}
.login-card .campo-grupo {
  text-align: left;
}
.login-card .btn-bloco {
  margin-top: 20px;
}

/* ---------------------------------------------------------------------------
   16. Sidebar Layout
   --------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 252px;
  min-width: 252px;
  background: #0D2144;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding: 24px 0 16px;
  flex-shrink: 0;
}

.sidebar-tw {
  width: 260px;
  min-width: 260px;
}

html[data-sidebar-colapsada="1"] .sidebar-tw {
  width: 76px;
  min-width: 76px;
}
html[data-sidebar-colapsada="1"] .sidebar-tw .sidebar-tw-label {
  display: none;
}
html[data-sidebar-colapsada="1"] .sidebar-tw #btnColapsarSidebar i {
  transform: rotate(180deg);
}
html[data-sidebar-colapsada="1"] .sidebar-tw nav a {
  justify-content: center;
}

.sidebar-marca {
  padding: 0 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font: 600 1.05rem/1.2 'Inter', sans-serif;
  text-decoration: none;
}
.sidebar-marca:hover { text-decoration: none; }
.sidebar-marca span { display: flex; flex-direction: column; }
.sidebar-subtitulo { font-size: .62rem; font-weight: 400; color: rgba(255,255,255,.4); letter-spacing: .02em; }

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-sec {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 16px 12px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: all 120ms ease;
  text-decoration: none;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}
.sidebar-nav a.ativo {
  background: rgba(37,99,235,0.15);
  color: var(--blue);
}
.sidebar-nav svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}
.sidebar-nav a.ativo svg { opacity: 1; }
.sidebar-nav a.nav-soon { opacity: .4; cursor: default; pointer-events: none; }

.sidebar-fim {
  margin: 12px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  margin-bottom: 8px;
}
.avatar-sm {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem;
  flex-shrink: 0;
}
.sidebar-user .nome {
  font-size: 0.8rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .papel {
  font-size: 0.7rem; color: rgba(255,255,255,0.4);
}
.sidebar-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  cursor: pointer;
}
.sidebar-logout:hover { background: rgba(255,255,255,0.06); color: var(--red); }

/* Topbar */
.topbar {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-menu {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-menu:hover { background: var(--panel-2); }

.topbar-marca {
  font: 600 1rem 'Inter', sans-serif;
  color: var(--text);
  display: none;
  text-decoration: none;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.theme-toggle {
  width: 36px; height: 36px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  margin-left: auto;
}
.theme-toggle:hover { background: var(--panel-2); color: var(--text); }
.theme-toggle-flutuante {
  position: fixed;
  top: 16px;
  right: 16px;
}

.icon-sun, .icon-moon {
  display: block;
}

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
}

/* ---------------------------------------------------------------------------
   17. Bloco / Section
   --------------------------------------------------------------------------- */
.bloco {
  margin-bottom: 32px;
}
.cta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.cta-row h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------------------------------------------------------------------
   18. Breadcrumb flow (dashboard_transportadora)
   --------------------------------------------------------------------------- */
.breadcrumb-flow {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.flow-arrow {
  color: var(--text-faint);
}

/* ---------------------------------------------------------------------------
   18b. KPI cards & filtros compartilhados (estoque, relatórios)
   --------------------------------------------------------------------------- */
.kpi-grid-estoque {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 700px) {
  .kpi-grid-estoque { grid-template-columns: 1fr; }
}
.kpi-grid-relatorios {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .kpi-grid-relatorios { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .kpi-grid-relatorios { grid-template-columns: 1fr; }
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.kpi-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.kpi-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon--amber { background: rgba(245,158,11,.12); color: var(--amber); }
.kpi-icon--purple { background: rgba(167,139,250,.12); color: var(--purple); }
.kpi-icon--blue { background: rgba(37,99,235,.12); color: var(--blue); }
.kpi-icon--green { background: rgba(22,163,74,.12); color: var(--green); }
.kpi-icon--red { background: rgba(220,38,38,.12); color: var(--red); }
.kpi-icon--gray { background: rgba(139,145,160,.12); color: var(--gray); }
.kpi-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint); display: block;
}
.kpi-value {
  font: 700 1.7rem/1.2 'Inter', system-ui, sans-serif;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.filtro-grupo { display: flex; flex-direction: column; gap: 5px; }
.filtro-grupo label { font-size: .72rem; color: var(--text-faint); font-weight: 600; }
.filtro-grupo select, .filtro-grupo input {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: .82rem;
  font-family: inherit;
}

/* ---------------------------------------------------------------------------
   19. Pagination
   --------------------------------------------------------------------------- */
.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.paginacao a {
  text-decoration: none;
  font-weight: 500;
  color: var(--blue);
  padding: 4px 12px;
  border-radius: 6px;
}
.paginacao a:hover { background: rgba(37,99,235,0.08); }

/* ---------------------------------------------------------------------------
   20. Animations
   --------------------------------------------------------------------------- */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------------
   21. Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 250ms ease;
    z-index: 200;
  }
  .sidebar-aberta .sidebar {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .sidebar-aberta .sidebar-overlay { display: block; }

  .sidebar-tw {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 250ms ease;
    z-index: 200;
    width: 260px;
  }
  .sidebar-aberta .sidebar-tw {
    transform: translateX(0);
  }
  .sidebar-aberta .sidebar-overlay { display: block; }

  .btn-menu { display: flex; }
  .topbar-marca { display: block; }

  .board { grid-template-columns: 1fr; }
  .flow-rail {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .flow-link { display: none; }
  .conteudo { padding: 16px; }
}

@media (max-width: 700px) {
  .summary { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .flow-rail { grid-template-columns: 1fr 1fr; gap: 8px; }
  .flow-link { display: none; }
  .pagina-cabecalho { flex-direction: column; }
  .detalhe-card { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 16px; }
  .login-card { padding: 30px 24px; }
}

@media (max-width: 400px) {
  .flow-rail { grid-template-columns: 1fr; gap: 8px; }
  .flow-link { display: none; }
}

/* ---------------------------------------------------------------------------
   22. Light theme overrides
   --------------------------------------------------------------------------- */
[data-theme="light"] .brand-icon { color: #fff; }
[data-theme="light"] .blue { color: #2563eb; }

/* Sidebar stays dark in light mode */
[data-theme="light"] .sidebar {
  background: #0f1b33;
  box-shadow: 2px 0 16px rgba(0,0,0,.12);
}
[data-theme="light"] .sidebar-tw {
  background: #0f1b33;
  box-shadow: 2px 0 16px rgba(0,0,0,.12);
}

/* Topbar */
[data-theme="light"] .topbar {
  background: #fff;
  border-bottom-color: rgba(15,23,42,.1);
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
}

/* Cards and panels get subtle shadow */
[data-theme="light"] .form-card,
[data-theme="light"] .detalhe-card,
[data-theme="light"] .sum-card,
[data-theme="light"] .tabela-wrapper,
[data-theme="light"] .chart-card {
  box-shadow: 0 1px 6px rgba(15,23,42,.06);
  border-color: rgba(15,23,42,.1);
}

/* Inputs */
[data-theme="light"] .campo-grupo input[type="text"],
[data-theme="light"] .campo-grupo input[type="password"],
[data-theme="light"] .campo-grupo input[type="email"],
[data-theme="light"] .campo-grupo input[type="number"],
[data-theme="light"] .campo-grupo input[type="date"],
[data-theme="light"] .campo-grupo input[type="datetime-local"],
[data-theme="light"] .campo-grupo input[type="file"],
[data-theme="light"] .campo-grupo select,
[data-theme="light"] .campo-grupo textarea {
  background: #fff;
  border-color: rgba(15,23,42,.18);
}
[data-theme="light"] .campo-grupo input:focus,
[data-theme="light"] .campo-grupo select:focus,
[data-theme="light"] .campo-grupo textarea:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Tables — alternating rows */
[data-theme="light"] .tabela tbody tr:nth-child(even) {
  background: rgba(15,23,42,.025);
}
[data-theme="light"] .tabela tbody tr:hover {
  background: rgba(15,23,42,.05);
}
[data-theme="light"] .tabela thead th {
  background: #f0f4fa;
}

/* Buttons */
[data-theme="light"] .btn {
  border-color: rgba(15,23,42,.15);
}
[data-theme="light"] .btn:hover {
  border-color: rgba(15,23,42,.25);
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
[data-theme="light"] .btn-secundario {
  background: #fff;
}
[data-theme="light"] .btn-secundario:hover {
  background: #f5f7fb;
}

/* Login page */
[data-theme="light"] .login-page {
  background: #f0f4fa;
}
[data-theme="light"] .login-card {
  box-shadow: 0 4px 24px rgba(15,23,42,.08);
  border-color: rgba(15,23,42,.1);
}

/* Timeline */
[data-theme="light"] .tl-content {
  background: #f8fafd;
  border-color: rgba(15,23,42,.1);
}
[data-theme="light"] .tl-card {
  background: #fff;
  border-color: rgba(15,23,42,.1);
}
[data-theme="light"] .tl-node {
  background: #fff;
}
[data-theme="light"] .tl-track {
  background: rgba(15,23,42,.12);
}

/* Client pills */
[data-theme="light"] .client-pill {
  background: #fff;
  border-color: rgba(15,23,42,.12);
}

/* Status badges — slightly stronger in light */
[data-theme="light"] .status-entregue { background: rgba(18,137,90,.1); }
[data-theme="light"] .status-pendente { background: rgba(95,104,120,.1); }
[data-theme="light"] .alerta-success  { background: rgba(18,137,90,.08); }
[data-theme="light"] .alerta-error    { background: rgba(211,59,59,.08); }
[data-theme="light"] .alerta-warning  { background: rgba(176,121,8,.08); }
[data-theme="light"] .alerta-info     { background: rgba(37,99,235,.08); }

/* Avatar */
[data-theme="light"] .transp-avatar {
  box-shadow: 0 1px 3px rgba(15,23,42,.12);
}

/* Formset */
[data-theme="light"] .formset {
  border-color: rgba(15,23,42,.12);
  background: #fafbfd;
}

/* Kanban (old) */
[data-theme="light"] .column {
  box-shadow: 0 1px 6px rgba(15,23,42,.05);
}
[data-theme="light"] .card {
  background: #fff;
  border-color: rgba(15,23,42,.1);
}

/* Pagination */
[data-theme="light"] .paginacao a:hover {
  background: rgba(37,99,235,.06);
}

/* Theme toggle floating */
[data-theme="light"] .theme-toggle:hover {
  background: rgba(15,23,42,.06);
}
[data-theme="light"] .theme-toggle-flutuante {
  background: #fff;
  border: 1px solid rgba(15,23,42,.1);
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
  border-radius: 8px;
}

/* Canhoto */
[data-theme="light"] .canhoto-thumb {
  border-color: rgba(15,23,42,.12);
}

/* Empty state */
[data-theme="light"] .empty-state svg {
  opacity: .3;
}

/* ---------------------------------------------------------------------------
   16. Motorista (shell mobile-first, sem sidebar)
   --------------------------------------------------------------------------- */
.motorista-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.motorista-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.motorista-nome {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.motorista-topbar-acoes {
  display: flex;
  align-items: center;
  gap: 6px;
}
.motorista-logout-form { display: inline-flex; }
.motorista-conteudo {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

.motorista-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  color: var(--text);
  text-decoration: none;
}
.motorista-card:hover { border-color: var(--line-strong); text-decoration: none; }
.motorista-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.motorista-card-nome { font-weight: 600; font-size: 0.95rem; }
.motorista-card-sub { font-size: 0.8rem; color: var(--text-faint); }

.motorista-btn-grande {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.motorista-btn-grande.principal { background: var(--blue); color: #fff; border-color: var(--blue); }
.motorista-btn-grande.sucesso   { background: var(--green); color: #fff; border-color: var(--green); }
.motorista-btn-grande.perigo    { background: var(--red); color: #fff; border-color: var(--red); }
.motorista-btn-grande:disabled  { opacity: 0.5; cursor: not-allowed; }

.motorista-campo-grupo { margin-bottom: 16px; }
.motorista-campo-grupo label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.motorista-campo-grupo .campo-lg {
  width: 100%;
  min-height: 52px;
  font-size: 1.1rem;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  box-sizing: border-box;
}

.motorista-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.motorista-status-badge.em_rota { background: rgba(139,145,160,0.15); color: var(--gray); }
.motorista-status-badge.chegou { background: rgba(245,158,11,0.15); color: var(--amber); }
.motorista-status-badge.entregue { background: rgba(22,163,74,0.15); color: var(--green); }
.motorista-status-badge.nao_entregue { background: rgba(220,38,38,0.15); color: var(--red); }
.motorista-status-badge.devolvida { background: rgba(220,38,38,0.15); color: var(--red); }

.motorista-secao-acao {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.motorista-secao-acao h3 { margin-bottom: 12px; }

[data-theme="light"] .motorista-card,
[data-theme="light"] .motorista-secao-acao {
  background: #fff;
  border-color: rgba(15,23,42,.1);
}
[data-theme="light"] .motorista-btn-grande,
[data-theme="light"] .motorista-campo-grupo .campo-lg {
  background: #F1F5F9;
  border-color: rgba(15,23,42,.16);
}

/* ---------------------------------------------------------------------------
   23. Impressão (relatório em modo "folha")
   --------------------------------------------------------------------------- */
@media print {
  .sidebar, .sidebar-tw, .sidebar-overlay, .topbar, .btn-menu,
  .rel-tipos, .rel-filtros, .rel-acoes, .mensagens {
    display: none !important;
  }
  .app-shell, .app-main, .conteudo { display: block !important; padding: 0 !important; margin: 0 !important; }
  .rel-folha {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  body, .rel-folha { background: #fff !important; color: #000 !important; }
}
