/* =====================================================================
   Gestão CD · Grid Elétric — tema preto + laranja
   Cores centralizadas nos tokens abaixo: mude aqui e o app todo acompanha.
   ===================================================================== */
:root {
  --brand: #ff5b00;          /* laranja da marca */
  --brand-hover: #e04f00;
  --brand-soft: #fff0e6;
  --brand-ring: rgba(255, 91, 0, 0.22);

  --ink: #0f0f0f;            /* preto da marca (sidebar) */
  --ink-2: #1c1917;
  --ink-3: #2a2522;

  --bg: #f5f4f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --border: #e7e5e4;
  --border-strong: #d6d3d1;

  --text: #1c1917;
  --text-2: #57534e;
  --text-3: #a8a29e;

  --success: #16a34a;
  --danger: #dc2626;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.05);
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 6px 16px rgba(28, 25, 23, 0.05);
  --shadow-lg: 0 20px 50px rgba(15, 15, 15, 0.25);

  --sidebar-w: 248px;
  --topbar-h: 76px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--brand-soft); color: var(--brand-hover); }

/* ---------------------------------------------------------------------
   Estrutura: sidebar preta + área principal
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  background: var(--ink);
  color: #d6d3d1;
  display: flex; flex-direction: column;
  border-right: 1px solid #000;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.brand-with-logo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.brand-logo { display: block; height: 40px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-with-logo small {
  font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: #78716c; font-weight: 700; padding-left: 2px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(255, 91, 0, 0.35);
}
.brand-mark svg { width: 20px; height: 20px; fill: #fff; }
.brand-text { color: #fff; font-size: 0.95rem; letter-spacing: 0.06em; line-height: 1.1; font-weight: 500; }
.brand-text strong { font-weight: 800; color: var(--brand); }
.brand-text small {
  display: block; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #78716c; font-weight: 600; margin-top: 3px;
}

.tabs {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px 20px;
  scrollbar-width: thin; scrollbar-color: #333 transparent;
}

.nav-section-title {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: #57534e; margin: 18px 0 6px 12px;
}
.nav-section-title:first-child { margin-top: 4px; }

.tab-btn {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  background: none; border: none; border-radius: var(--radius-sm);
  padding: 9px 12px; text-align: left;
  font: inherit; font-size: 0.86rem; font-weight: 500;
  color: #a8a29e; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn svg {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.85;
}
.tab-btn:hover { background: rgba(255, 255, 255, 0.05); color: #f5f5f4; }
.tab-btn.active { background: rgba(255, 91, 0, 0.12); color: #fff; }
.tab-btn.active svg { color: var(--brand); opacity: 1; }
.tab-btn.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--brand);
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-footer a {
  color: #a8a29e; text-decoration: none; font-size: 0.78rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.sidebar-footer a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

.sidebar-backdrop { display: none; }

.main-area {
  flex: 1; min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 32px;
  background: rgba(245, 244, 242, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { min-width: 0; }
.topbar-section {
  margin: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--brand);
}
.topbar h1 { margin: 1px 0 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-date {
  font-size: 0.78rem; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
}

.menu-toggle {
  display: none;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }

.content {
  flex: 1; min-width: 0;
  width: 100%; max-width: 1400px;
  padding: 28px 32px 48px;
}

/* compat com layout antigo */
.container { max-width: 1280px; margin: 0 auto; padding: 20px; }
.layout { display: flex; gap: 24px; align-items: flex-start; }

.tab-content { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   Botões
   --------------------------------------------------------------------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff;
  border: none; padding: 10px 16px; border-radius: 10px;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(255, 91, 0, 0.25);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; margin-top: 10px; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 13px; font: inherit; font-size: 0.8rem; font-weight: 500; color: var(--text);
  cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn-outline:hover { border-color: var(--ink); background: var(--surface-2); }
button.btn-block:not(.btn-primary):not(.btn-outline) {
  font: inherit; font-size: 0.85rem; font-weight: 500; padding: 10px 16px; border-radius: 10px; cursor: pointer;
}

.btn-close {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 1.2rem; line-height: 1; color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-close:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.link-btn {
  background: none; border: none; font: inherit; font-size: 0.78rem; color: var(--text-2);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0;
}
.link-btn:hover { color: var(--text); }
.next-btn {
  background: none; border: none; font: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--brand); cursor: pointer; padding: 0;
}
.next-btn:hover { color: var(--brand-hover); }
.next-btn.btn-danger { color: var(--danger); }
.next-btn.btn-danger:hover { color: #7f1d1d; }
.next-btn + .next-btn { margin-left: 12px; }
.end-label { font-size: 0.75rem; color: var(--text-3); }

/* Select com botão de cadastro rápido ao lado */
.field-with-add { display: flex; gap: 6px; align-items: center; }
.field-with-add select, .field-with-add input { flex: 1; margin-top: 4px; }
.btn-quickadd {
  flex-shrink: 0; margin-top: 4px;
  width: 38px; height: 38px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  color: var(--brand); font-size: 1.1rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.btn-quickadd:hover { background: var(--brand-soft); border-color: var(--brand); }

/* Alternância de visão (segmented control) */
.view-toggle {
  display: inline-flex; gap: 2px; margin-bottom: 18px; padding: 3px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  flex-wrap: wrap;
}
.view-btn {
  background: none; border: none; border-radius: 8px;
  padding: 6px 13px; font: inherit; font-size: 0.78rem; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.view-btn:hover { color: var(--text); background: var(--surface-2); }
.view-btn.active { background: var(--ink); color: #fff; }

/* ---------------------------------------------------------------------
   KPIs
   --------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-box {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-box::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), rgba(255, 91, 0, 0));
  opacity: 0.8;
}
.stat-box p.label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 6px; }
.stat-box p.value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--text); }

.hidden { display: none !important; }

/* ---------------------------------------------------------------------
   Grupos / seções
   --------------------------------------------------------------------- */
.status-group { margin-bottom: 22px; }
.status-group-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text); margin: 0 0 10px;
}
.status-group-title span { font-weight: 500; color: var(--text-3); text-transform: none; letter-spacing: 0; }

.section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-header .status-group-title { margin: 0; }

.section-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; padding: 8px 0; cursor: pointer;
  font: inherit; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text); text-align: left;
}
.section-toggle span:first-child { display: flex; align-items: center; gap: 8px; }
.section-toggle-seta { transition: transform 0.15s; color: var(--text-3); font-size: 0.9rem; }
.section-toggle-seta.aberto { transform: rotate(180deg); }

.tarefa-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; margin-bottom: 6px; background: var(--surface);
}
.tarefa-row input[type="checkbox"] { accent-color: var(--brand); }
.tarefa-row.tarefa-feita { opacity: 0.55; }
.tarefa-row.tarefa-feita label { text-decoration: line-through; }
.tarefa-data { color: var(--text-3); font-size: 0.75rem; margin-left: 6px; text-decoration: none !important; display: inline; }

/* ---------------------------------------------------------------------
   Agenda — calendário dia/semana/mês
   --------------------------------------------------------------------- */
.agenda-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.agenda-nav { display: flex; align-items: center; gap: 8px; }
.agenda-nav .btn-outline { padding: 6px 11px; }
.agenda-titulo { font-size: 1rem; font-weight: 700; text-transform: capitalize; color: var(--text); margin-left: 6px; }

.agenda-mes-cabecalho { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.agenda-mes-cabecalho span { font-size: 0.68rem; font-weight: 700; color: var(--text-3); text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
.agenda-mes { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(92px, auto); gap: 6px; }
.agenda-mes-cel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 7px; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: border-color 0.15s, box-shadow 0.15s;
}
.agenda-mes-cel:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.agenda-mes-cel.agenda-fora-mes { background: transparent; opacity: 0.45; }
.agenda-mes-cel.agenda-hoje { border-color: var(--brand); border-width: 2px; }
.agenda-mes-cel.agenda-hoje .agenda-mes-num {
  background: var(--brand); color: #fff; border-radius: 999px; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.agenda-mes-num { font-size: 0.75rem; font-weight: 700; color: var(--text-2); }
.agenda-mes-eventos { display: flex; flex-direction: column; gap: 2px; }
.agenda-mais { font-size: 0.66rem; color: var(--text-3); padding-left: 2px; }

.agenda-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: start; }
.agenda-dia-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px; cursor: pointer;
  min-height: 170px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.agenda-dia-col:hover { border-color: var(--brand); }
.agenda-dia-col.agenda-hoje { border-color: var(--brand); border-width: 2px; }
.agenda-dia-header { font-size: 0.68rem; font-weight: 700; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 2px; text-transform: uppercase; letter-spacing: 0.06em; }
.agenda-dia-header span { font-size: 1.05rem; color: var(--text); letter-spacing: 0; }
.agenda-dia-eventos { display: flex; flex-direction: column; gap: 3px; }

.agenda-evento { font-size: 0.68rem; font-weight: 500; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-evento-revisao { background: var(--brand-soft); color: var(--brand-hover); border-left: 2px solid var(--brand); }
.agenda-evento-tarefa { background: #f5f5f4; color: var(--text-2); border-left: 2px solid var(--ink); }
.agenda-evento-tarefa.agenda-evento-feita { text-decoration: line-through; opacity: 0.6; }

/* ---------------------------------------------------------------------
   Cards de moto
   --------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.moto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.moto-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.moto-card-selecionavel { padding-left: 38px; }
.moto-card-check {
  position: absolute; top: 15px; left: 13px; z-index: 1;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}
.moto-card-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); }
.moto-card .card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.moto-card .modelo { font-size: 0.9rem; font-weight: 600; margin: 0; color: var(--text); }
.moto-card .info { font-size: 0.76rem; color: var(--text-2); margin: 0; }
.moto-card .resp { font-size: 0.75rem; color: var(--text-3); margin: 3px 0 0; }

.card-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0efed;
}

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge-gray   { background: #f5f5f4; color: #57534e; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-orange { background: var(--brand-soft); color: #c2410c; }
.badge-blue   { background: #e0ecff; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-lime   { background: #ecfccb; color: #4d7c0f; }
.badge-slate  { background: #1c1917; color: #fafaf9; }

/* ---------------------------------------------------------------------
   Estados vazios
   --------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-3);
  font-size: 0.875rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------------------------------------------------------------------
   Histórico / ficha da moto
   --------------------------------------------------------------------- */
.historico-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.moto-list-item {
  display: block; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer; font: inherit; font-size: 0.86rem;
}
.moto-list-item:hover { border-color: var(--border-strong); }
.moto-list-item.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-ring); }
.moto-list-item .sub { font-size: 0.75rem; color: var(--text-2); }

.detail-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.os-card-click { cursor: pointer; }
.os-card-click:hover { border-color: var(--brand); }
.mf-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-bottom: 18px; }
.mf-info-grid .label { font-size: 0.66rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 3px; }
.mf-info-grid .value { font-size: 0.875rem; font-weight: 500; margin: 0; }
.mf-os-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mf-os-picker button {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 13px; font: inherit; font-size: 0.76rem; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.mf-os-picker button:hover { border-color: var(--border-strong); color: var(--text); }
.mf-os-picker button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.mf-os-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mf-os-primary { margin-top: 18px; }
.mf-os-secondary { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }

.mf-timeline { position: relative; }
.mf-timeline-row { display: flex; gap: 12px; }
.mf-timeline-rail { position: relative; width: 26px; flex: none; display: flex; justify-content: center; }
.mf-timeline-rail::before {
  content: ''; position: absolute; top: 26px; bottom: -14px; left: 50%; width: 2px;
  background: var(--border); transform: translateX(-50%);
}
.mf-timeline-row:last-child .mf-timeline-rail::before { display: none; }
.mf-timeline-dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); border: 1px solid #fed7bf;
  display: flex; align-items: center; justify-content: center; font-size: 0.72rem; flex: none; z-index: 1;
}
.mf-timeline-card { padding-bottom: 18px; flex: 1; }
.mf-timeline-date { font-size: 0.7rem; color: var(--text-3); margin: 3px 0 4px; }
.mf-timeline-transition { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.8rem; }
.mf-timeline-obs { font-size: 0.8rem; color: var(--text-2); font-style: italic; margin: 0; }

.mf-list { margin: 4px 0 0; padding-left: 18px; font-size: 0.82rem; }
.mf-list li { margin-bottom: 3px; }
.mf-list li::marker { color: var(--brand); }
.mf-list-muted { color: var(--text-3); }
.diag-box { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 0.82rem; color: var(--text-2); }
.diag-box p { margin: 3px 0; }
.timeline-item { display: flex; gap: 8px; margin-bottom: 10px; font-size: 0.875rem; }
.timeline-item .t-status { margin: 0; }
.timeline-item .t-date { font-size: 0.75rem; color: var(--text-3); margin: 0; }

/* ---------------------------------------------------------------------
   Equipe
   --------------------------------------------------------------------- */
.equipe-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 0.875rem; color: var(--text-2); }
.funcionario-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.funcionario-row:hover { border-color: var(--border-strong); }
.funcionario-row input[type="text"] { flex: 1; border: none; font: inherit; font-size: 0.9rem; font-weight: 600; background: transparent; }
.funcionario-row input[type="text"]:focus { outline: none; }
.codigo-acesso-input, .usuario-input {
  flex: none !important; width: 140px; border: 1px solid var(--border) !important; border-radius: 8px;
  padding: 7px 9px; font-size: 0.8rem !important; font-weight: 400 !important; background: var(--surface-2) !important;
}
.funcionario-login { display: flex; align-items: center; gap: 6px; }
.check-label { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-2); white-space: nowrap; }
.checklist-itens { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 14px; }
.checklist-itens label {
  display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; margin: 0; cursor: pointer;
}
.checklist-itens label:hover { border-color: var(--border-strong); }
.checklist-itens label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

.foto-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.foto-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.foto-thumb-vazio { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--border-strong); }
.foto-thumb-mini { width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 3px; }
.cor-tag { display: inline-flex; align-items: center; font-size: 0.78rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; margin: 2px 4px 2px 0; }
.cor-tag .link-btn { padding: 0 0 0 5px; font-size: 0.75rem; text-decoration: none; }

/* ---------------------------------------------------------------------
   Estoque como catálogo visual
   --------------------------------------------------------------------- */
.catalogo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.catalogo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.catalogo-card:hover { box-shadow: 0 12px 28px rgba(28, 25, 23, 0.12); transform: translateY(-3px); border-color: var(--brand); }
.catalogo-foto { width: 100%; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #fafaf9, #f0efed); }
.catalogo-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.catalogo-card:hover .catalogo-foto img { transform: scale(1.04); }
.catalogo-foto-vazia {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--border-strong); font-size: 1.8rem; gap: 4px;
}
.catalogo-foto-vazia span { font-size: 0.7rem; color: var(--text-3); }
.catalogo-info { padding: 12px 14px 14px; }
.catalogo-nome { font-weight: 700; font-size: 0.92rem; margin: 0; }
.catalogo-cor { font-size: 0.78rem; color: var(--text-2); margin: 2px 0 10px; }
.catalogo-nums { display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; color: var(--text-2); padding-top: 10px; border-top: 1px solid #f0efed; }
.catalogo-disponivel { color: #fff; background: var(--success); font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* Estoque: alternância cards/linhas */
.view-toggle-icones { margin-bottom: 0; flex-wrap: nowrap; }
.view-toggle-icones .view-btn { display: inline-flex; align-items: center; gap: 6px; }
.view-toggle-icones svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.estoque-linhas .num { text-align: right; width: 110px; font-variant-numeric: tabular-nums; }
.estoque-linhas td { padding-top: 6px; padding-bottom: 6px; }
.estoque-linhas .foto-thumb { width: 32px; height: 32px; border-radius: 8px; display: block; font-size: 0.85rem; }
@media (max-width: 560px) {
  .estoque-linhas th:first-child, .estoque-linhas td:first-child,
  .estoque-linhas th:nth-child(5), .estoque-linhas td:nth-child(5) { display: none; }
  .estoque-linhas .num { width: auto; }
  .estoque-linhas th, .estoque-linhas td { padding-left: 10px; padding-right: 10px; }
}
.estoque-linhas tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--border); border-bottom: none; }

/* Estoque: barra de filtros */
.estoque-filtros {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.estoque-filtros-topo { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.estoque-filtros-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.estoque-busca { position: relative; flex: 1; min-width: 240px; }
.estoque-busca svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px;
  fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
.estoque-busca input[type="search"] { width: 100%; padding-left: 38px; height: 40px; background: var(--surface-2); }
.estoque-busca input[type="search"]:focus { background: var(--surface); }
.estoque-busca-sm { min-width: 180px; }
.estoque-busca-sm input[type="search"] { height: 36px; }
.estoque-filtros-selects {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0efed;
}
.estoque-filtros-selects label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.estoque-filtros-selects select { width: 100%; font-size: 0.82rem; padding-top: 7px; padding-bottom: 7px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.estoque-resumo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-2); margin: 0 2px 16px; }
.estoque-resumo b { color: var(--text); }
.estoque-resumo .link-btn { margin-left: auto; color: var(--brand); }

/* Pop-up de chassis */
#modal-chassis .modal-box { max-width: 720px; }
.chassis-cabecalho { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chassis-cabecalho h2::before { display: none; }
.chassis-foto { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface-2); }
.chassis-foto-vazia { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.chassis-sub { margin: 2px 0 0; font-size: 0.78rem; color: var(--text-2); }
.chassis-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chassis-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.chassis-toolbar .check-label { margin: 0; }
.chassis-lista { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chassis-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid #f0efed; background: var(--surface); transition: background 0.1s;
}
.chassis-item:last-of-type { border-bottom: none; }
.chassis-item:hover { background: #fcfbfa; }
.chassis-item.selecionado { background: var(--brand-soft); }
.chassis-check { width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; margin: 0; }
.chassis-check-vazio { width: 17px; flex-shrink: 0; }
.chassis-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chassis-numero {
  background: none; border: none; padding: 0; text-align: left; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chassis-numero:hover { color: var(--brand); text-decoration: underline; }
.chassis-meta { font-size: 0.7rem; color: var(--text-3); }
.chassis-acoes { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.chassis-nada { padding: 14px; margin: 0; text-align: center; }
.chassis-rodape {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: sticky; bottom: -24px; background: var(--surface); margin: 14px -24px -24px; padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.btn-sm { padding: 5px 11px; font-size: 0.75rem; }
.btn-icone {
  width: 32px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icone:hover { border-color: var(--border-strong); background: var(--surface-2); }

@media (max-width: 900px) {
  .estoque-filtros-selects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estoque-filtros-acoes { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .chassis-item { flex-wrap: wrap; }
  .chassis-meta { display: none; }
}

/* Catálogo: preços editáveis na tabela */
.potencia-campo { width: 100px; padding: 7px 9px !important; font-size: 0.82rem !important; }
.catalogo-tabela td { vertical-align: middle; }
.catalogo-tabela .link-btn { white-space: nowrap; }
.preco-campo {
  display: inline-flex; align-items: center; gap: 4px; width: 128px;
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 8px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .3s;
}
.preco-campo span { font-size: 0.72rem; color: var(--text-3); font-weight: 600; }
.preco-campo input[type="text"] {
  border: none; padding: 7px 0; width: 100%; text-align: right; background: transparent; box-shadow: none !important;
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.85rem;
}
.preco-campo:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.preco-campo-sec input[type="text"] { font-weight: 500; color: var(--text-2); }
.preco-vazio { border-style: dashed; border-color: #f59e0b; background: #fffbeb; }
.preco-salvando { opacity: .6; }
.preco-salvo { background: #dcfce7; border-color: #16a34a; }
.preco-erro { border-color: var(--danger); background: #fef2f2; }
.margem { font-weight: 700; font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.margem-ok { background: #dcfce7; color: #15803d; }
.margem-baixa { background: #fef3c7; color: #92400e; }
.margem-neg { background: #fee2e2; color: #b91c1c; }

/* Venda: preço fixo do catálogo */
.venda-preco { font-weight: 800; color: var(--text); font-size: 0.9rem; }
.venda-sem-preco { font-weight: 600; color: #92400e; background: #fef3c7; padding: 2px 8px; border-radius: 999px; }
.catalogo-card-bloqueado { cursor: not-allowed; opacity: 0.55; filter: grayscale(0.6); }
.catalogo-card-bloqueado:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
.vd-preco-fixo { text-align: right; font-weight: 800; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.vd-preco-fixo::before { content: '🔒 '; font-size: 0.7rem; opacity: 0.5; }
.vd-carrinho-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; margin-top: 8px; border-top: 2px solid var(--ink); font-size: 0.9rem; }
.vd-carrinho-total b { font-size: 1.1rem; }

/* Venda: vendedor + estoque no topo */
.vd-topo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 14px; margin: -4px 0 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.vd-topo label { margin-top: 0 !important; }
.vd-estoque { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; min-height: 38px; flex-wrap: wrap; }
.vd-estoque-nome { font-size: 0.88rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vd-estoque-tag { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #e7e5e4; color: var(--text-2); }
.vd-estoque-tag-master { background: var(--ink); color: #fff; }
.vd-estoque-aviso { color: #92400e; font-weight: 600; font-size: 0.8rem; }
@media (max-width: 560px) { .vd-topo { grid-template-columns: 1fr; } }

.vd-frete-msg { color: var(--danger); min-height: 1.1em; margin: 4px 0 0; }
.vd-frete-calc { color: var(--success); font-weight: 600; }

.dash-cols-denso { gap: 3px; }
.dash-cols-denso .dash-col-label { overflow: visible; font-size: 0.62rem; }
.dash-cols-denso .dash-col-val { font-size: 0.62rem; }

/* Meu painel (vendedor) */
.meu-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.meu-ola { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }
.kpi-extra { margin: 6px 0 0; font-size: 0.72rem; color: var(--text-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi-var { font-weight: 800; font-size: 0.72rem; padding: 1px 7px; border-radius: 999px; background: #f5f5f4; color: var(--text-2); }
.kpi-var.up { background: #dcfce7; color: #15803d; }
.kpi-var.down { background: #fee2e2; color: #b91c1c; }
.meu-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.meu-mini div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.meu-mini b { font-size: 1.15rem; }
.meu-mini span { font-size: 0.7rem; color: var(--text-3); }
.meu-pendencias { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.meu-pend { text-align: left; font: inherit; font-size: 0.82rem; background: #fffbeb; border: 1px solid #fde68a; border-left: 3px solid #f59e0b; border-radius: 10px; padding: 9px 12px; color: var(--text); }
button.meu-pend { cursor: pointer; }
button.meu-pend:hover { border-color: #f59e0b; }
.meu-estoque-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.meu-estoque-nums div { background: var(--surface-2); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; }
.meu-estoque-nums b { font-size: 1.1rem; }
.meu-estoque-nums span { font-size: 0.66rem; color: var(--text-3); }
@media (max-width: 900px) { .meu-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); } .meu-estoque-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Filtro de período (vendas) */
.periodo-filtro { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.periodo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.periodo-datas { display: flex; gap: 10px; align-items: center; }
.periodo-datas label { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--text-2); margin: 0; }
.periodo-datas input { padding: 5px 8px; font-size: 0.8rem; }
.periodo-rotulo { margin-left: auto; font-size: 0.78rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* Venda: quadro do cliente + venda confirmada */
.vd-cliente-box { border: 2px solid var(--ink); border-radius: 12px; padding: 12px 14px; margin: 4px 0 14px; background: var(--surface); }
.vd-cliente-box.vazio { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px var(--brand-ring); }
.vd-obrigatorio { margin-left: 6px; font-size: 0.62rem; letter-spacing: 0.06em; background: var(--brand); color: #fff; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.vd-cliente-box select { font-weight: 600; }
.vd-cliente-dados { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 12px; margin-top: 10px; font-size: 0.82rem; }
.vd-cliente-dados span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.vd-cliente-dados .largo { grid-column: 1 / -1; }
.vd-cliente-dados small { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.vd-cliente-alerta { margin: 10px 0 0; font-size: 0.78rem; color: #92400e; font-weight: 500; }
.vd-cliente-ok { margin: 10px 0 0; font-size: 0.78rem; color: #15803d; font-weight: 600; }
.vd-sucesso { text-align: center; padding: 16px 8px 4px; }
.vd-sucesso-icone { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px; background: var(--success); color: #fff; font-size: 1.9rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.vd-sucesso h3 { margin: 0 0 4px; font-size: 1.2rem; }
.vd-sucesso-contrato { margin-top: 14px; padding: 13px 22px; font-size: 0.95rem; text-decoration: none; }
.vd-link-contrato { text-decoration: none; color: var(--text); font-weight: 600; margin-right: 10px; white-space: nowrap; }
.vd-link-contrato:hover { color: var(--brand); }
@media (max-width: 560px) { .vd-cliente-dados { grid-template-columns: 1fr 1fr; } }

/* Venda: acessórios + vendedor fixo */
.vd-acess-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 6px; }
.vd-acess { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--surface); }
.vd-acess-on { border-color: var(--brand); background: var(--brand-soft); }
.vd-acess-off { opacity: 0.55; }
.vd-acess-info { display: flex; flex-direction: column; min-width: 0; font-size: 0.84rem; }
.vd-acess-info small { font-size: 0.7rem; color: var(--text-3); }
.vd-acess-qtd { display: flex; align-items: center; gap: 6px; }
.vd-acess-qtd button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; }
.vd-acess-qtd button:disabled { opacity: 0.35; cursor: not-allowed; }
.vd-acess-qtd span { min-width: 18px; text-align: center; font-weight: 800; }
.vd-acess-total { text-align: right; font-size: 0.82rem; margin: 2px 0 14px; }
.vd-vendedor-fixo .field-with-add { display: none; }
.vd-vendedor-eu { margin: 6px 0 0; font-size: 0.9rem; }
.trocas-pend { border: 1px solid #fde68a; background: #fffbeb; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.trocas-pend-titulo { margin: 0 0 10px; font-weight: 700; color: #92400e; font-size: 0.86rem; }

/* Venda: pagamento (várias formas) + troca */
.vd-pagamento { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 14px 0; background: var(--surface-2); }
.vd-bloco-titulo { margin: 0 0 8px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.vd-pag-linha { display: grid; grid-template-columns: 150px 1fr 190px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.vd-pag-linha select, .vd-pag-linha input { width: 100%; margin: 0 !important; }
.vd-pag-parcelas-vazio { display: block; }
.vd-add-pag { color: var(--brand); font-weight: 600; text-decoration: none; }
.vd-troca-toggle { margin-top: 12px !important; font-weight: 600 !important; color: var(--text) !important; }
.vd-troca-box { border-left: 3px solid var(--ink); padding: 4px 0 4px 12px; margin-top: 6px; }
.vd-pag-resumo { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 0.8rem; color: var(--text-2); }
.vd-pag-resumo b { color: var(--text); }
.vd-pag-status { font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.vd-pag-status.ok { background: #dcfce7; color: #15803d; }
.vd-pag-status.falta { background: #fef3c7; color: #92400e; }
.vd-periodo { margin: 4px 0 0; }
.vd-periodo .view-btn:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
@media (max-width: 560px) {
  .vd-pag-linha { grid-template-columns: 1fr 1fr 34px; }
  .vd-pag-linha .vd-pag-parcelas, .vd-pag-linha .vd-pag-parcelas-vazio { grid-column: 1 / 3; grid-row: 2; }
}

/* Venda: catálogo compacto */
.vd-busca-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.vd-busca-bar .estoque-busca { flex: 1; }
.vd-busca-bar .check-label { margin: 0 !important; font-weight: 500 !important; }
.vd-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: thin; }
.vd-chip {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 5px 11px; font: inherit; font-size: 0.75rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.vd-chip span { color: var(--text-3); font-weight: 500; margin-left: 2px; }
.vd-chip:hover { border-color: var(--border-strong); color: var(--text); }
.vd-chip.ativo { background: var(--ink); border-color: var(--ink); color: #fff; }
.vd-chip.ativo span { color: #a8a29e; }
.vd-lista { border: 1px solid var(--border); border-radius: 12px; max-height: 330px; overflow-y: auto; background: var(--surface); }
.vd-item { display: grid; grid-template-columns: 40px 1fr auto auto auto; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid #f0efed; }
.vd-item:hover { background: #fcfbfa; }
.vd-item-bloqueado { opacity: 0.55; }
.vd-item-foto { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.vd-item-foto img { width: 100%; height: 100%; object-fit: cover; }
.vd-item-info { min-width: 0; }
.vd-item-info p { margin: 0; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-item-cor { color: var(--text-2); }
.vd-item-info small { font-size: 0.7rem; color: var(--text-3); }
.vd-item-preco { font-weight: 800; font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vd-item-chassis { border: none; background: none; font: inherit; font-size: 0.72rem; color: var(--text-3); cursor: pointer; white-space: nowrap; }
.vd-item-chassis:hover { color: var(--text); }
.vd-item-add-vazio { width: 92px; text-align: center; opacity: 0.6; }
.vd-item-sub { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px 64px; background: var(--surface-2); border-bottom: 1px solid #f0efed; }
.vd-chassi-opcao { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; }
.vd-chassi-opcao code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; font-weight: 600; }
.vd-vazio { padding: 18px; margin: 0; text-align: center; }
.vd-resultado { margin: 6px 2px 16px; font-size: 0.72rem; }
@media (max-width: 560px) {
  .vd-carrinho .vd-carrinho-item { flex-wrap: wrap; row-gap: 6px; }
  .vd-carrinho .vd-carrinho-info { flex: 1 1 calc(100% - 62px); }
  .vd-carrinho .vd-carrinho-valor { width: auto; margin-left: 58px; flex: 1; text-align: left; }
  .vd-carrinho .vd-carrinho-total b { white-space: nowrap; }
  .vd-item { grid-template-columns: 36px 1fr auto; }
  .vd-item-chassis { display: none; }
  .vd-item-preco { grid-column: 2; font-size: 0.8rem; }
}

/* Carrinho de itens da venda */
.vd-carrinho-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.vd-carrinho-item:last-child { margin-bottom: 0; }
.vd-carrinho-foto { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.vd-carrinho-foto img { width: 100%; height: 100%; object-fit: cover; }
.vd-carrinho-info { flex: 1; min-width: 0; }
.vd-carrinho-info p { margin: 0; }
.vd-carrinho-nome { font-weight: 600; font-size: 0.86rem; }
.vd-carrinho-sub { font-size: 0.75rem; color: var(--text-3); }
.vd-carrinho-valor { width: 140px; flex-shrink: 0; }
.vd-carrinho-valor input { width: 100%; }
.comissoes-box { font-size: 0.75rem; color: var(--text-2); text-align: right; width: 130px; flex-shrink: 0; }
.comissoes-box strong { color: var(--text); }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px;
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
  animation: modalIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin: -24px -24px 18px; padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: -24px; background: var(--surface); z-index: 2;
}
.modal-header h2 { font-size: 1.05rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.modal-header h2::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: var(--brand); }
.modal-box.modal-lg { max-width: 660px; max-height: 88vh; }

/* ---------------------------------------------------------------------
   Formulários
   --------------------------------------------------------------------- */
form label, .modal label { font-size: 0.74rem; font-weight: 600; color: var(--text-2); display: block; margin-top: 12px; }

input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"],
input[type="datetime-local"], input[type="time"], input[type="search"], input[type="tel"], select, textarea {
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: 0.86rem; color: var(--text); background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
form input[type="text"], form input[type="email"], form input[type="number"], form input[type="password"],
form input[type="date"], form input[type="datetime-local"], form input[type="time"], form input[type="tel"],
form select, form textarea { width: 100%; margin-top: 4px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hint { font-size: 0.75rem; font-weight: 400; color: var(--text-3); margin-top: 10px; }

/* ---------------------------------------------------------------------
   Tabelas
   --------------------------------------------------------------------- */
.simple-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 0.82rem; margin-bottom: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.simple-table th {
  text-align: left; color: var(--text-2); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.simple-table td { padding: 11px 14px; border-bottom: 1px solid #f0efed; vertical-align: middle; }
.simple-table tr:last-child td { border-bottom: none; }
.simple-table tbody tr:hover td { background: #fcfbfa; }
.simple-table tr.linha-alerta td { background: #fef2f2; color: #991b1b; }
.simple-table tr.clickable-row { cursor: pointer; }
.simple-table tr.clickable-row:hover td { background: var(--brand-soft); }

.entrada-item-row { margin-bottom: 6px; }
.entrada-itens { margin-top: 14px; }

/* Resultado da entrada — etiquetas */
.etiqueta-resultado-title { font-weight: 600; margin: 4px 0 12px; }
.etiqueta-row {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; font-size: 0.875rem;
}
.etiqueta-row .chassi { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }

.checkbox-list {
  display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 4px; background: var(--surface-2);
}
.checkbox-list label { margin-top: 0; font-weight: 500; color: var(--text); }

.busca-cliente-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; }
.busca-cliente-row:last-child { border-bottom: none; }
.busca-cliente-row:hover { background: var(--brand-soft); }
.busca-cliente-nome { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--text); }
.busca-cliente-info { margin: 2px 0 0; font-size: 0.75rem; color: var(--text-3); }

.resp-inline { font-size: 0.75rem; color: var(--text-3); }

.os-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0efed; }
.os-actions .next-btn { margin-left: auto; }

/* ---------------------------------------------------------------------
   Painéis (dashboards)
   --------------------------------------------------------------------- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; min-width: 0; box-shadow: var(--shadow-sm);
}
.dash-card.full { grid-column: 1 / -1; }
.dash-card h3 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin: 0 0 16px; }
.dash-empty { font-size: 0.82rem; color: var(--text-3); padding: 8px 0; }

.dash-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-bar-row:last-child { margin-bottom: 0; }
.dash-bar-label { width: 130px; flex-shrink: 0; font-size: 0.76rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { flex: 1; height: 10px; background: #f0efed; border-radius: 999px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.dash-bar-value { width: 64px; flex-shrink: 0; font-size: 0.76rem; font-weight: 700; color: var(--text); }

.dash-cols { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.dash-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.dash-col-val { font-size: 0.68rem; font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; }
.dash-col-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.dash-col-label { font-size: 0.68rem; color: var(--text-3); margin-top: 6px; white-space: nowrap; }

.dash-stack-legend { display: flex; gap: 16px; margin-bottom: 12px; }
.dash-stack-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-2); }
.dash-stack-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dash-stack-row { margin-bottom: 12px; }
.dash-stack-row:last-child { margin-bottom: 0; }
.dash-stack-row .dash-stack-top { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--text-2); margin-bottom: 5px; }
.dash-stack-track { display: flex; height: 12px; background: #f0efed; border-radius: 999px; overflow: hidden; gap: 2px; }
.dash-stack-seg { height: 100%; min-width: 2px; }

/* ---------------------------------------------------------------------
   Transferências (ao vivo)
   --------------------------------------------------------------------- */
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 0.68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.transf-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.transf-ao-vivo { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: var(--success); }
.transf-ao-vivo .hint { margin: 0; font-weight: 500; }
.transf-cabecalho-acoes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.transf-pulso {
  width: 9px; height: 9px; border-radius: 50%; background: var(--success); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: pulso 1.8s infinite;
}
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); } 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }

.transf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.transf-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px;
  border-top: 3px solid var(--brand);
}
.transf-card.transf-atrasada { border-top-color: #d97706; background: #fffdf7; }
.transf-card-topo { display: flex; justify-content: space-between; align-items: center; }
.transf-id { font-size: 0.75rem; font-weight: 700; color: var(--text-3); }
.transf-tempo { font-size: 0.75rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.transf-tempo.atrasada { color: #92400e; background: #fef3c7; border-color: #fde68a; }

.transf-rota { display: flex; align-items: center; gap: 10px; }
.transf-ponto { display: flex; flex-direction: column; min-width: 0; }
.transf-ponto b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transf-ponto-fim { text-align: right; }
.transf-ponto-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.transf-trilho { flex: 1; min-width: 50px; height: 2px; position: relative; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); }
.transf-trilho::after { content: ''; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--border-strong); }
.transf-caminhao { position: absolute; top: -13px; left: 0; font-size: 1rem; transform: scaleX(-1); animation: dirigir 3.5s ease-in-out infinite; }
@keyframes dirigir { 0% { left: 0; } 100% { left: calc(100% - 20px); } }
@media (prefers-reduced-motion: reduce) { .transf-caminhao { animation: none; left: 40%; } .transf-pulso { animation: none; } }

.transf-motos { background: var(--surface-2); border: 1px solid #f0efed; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.transf-modelo { display: flex; flex-direction: column; gap: 4px; }
.transf-modelo-nome { font-size: 0.8rem; font-weight: 600; }
.transf-chassis { display: flex; flex-wrap: wrap; gap: 4px; }
.transf-chassis code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text-2); }
.transf-card-rodape { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.transf-motorista { font-size: 0.8rem; color: var(--text-2); }

.transf-atalho {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px;
  padding: 12px 16px; font: inherit; font-size: 0.85rem; color: var(--text); cursor: pointer; text-align: left;
}
.transf-atalho:hover { border-color: var(--brand); background: var(--brand-soft); }
.transf-atalho-link { margin-left: auto; color: var(--brand); font-weight: 600; }
.simple-table .num { text-align: right; }

@media (max-width: 560px) { .transf-grid { grid-template-columns: minmax(0, 1fr); } }

.chassi-cod { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; font-weight: 600; }

.chassis-outra-loja { font-size: 0.7rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }

/* Correção de chassi */
.chassi-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; letter-spacing: 0.04em; }
.chassi-atual { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #fef2f2; color: #b91c1c; padding: 1px 6px; border-radius: 5px; }

/* Administrador master */
.master-card {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ink);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.master-card-vazio { border-left-color: var(--brand); background: linear-gradient(90deg, var(--brand-soft), var(--surface) 60%); }
.master-card-icone { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.master-card-info { flex: 1; min-width: 220px; }
.master-card-titulo { margin: 0; font-weight: 700; }
.master-card-sub { margin: 3px 0 0; font-size: 0.8rem; color: var(--text-2); }
.master-lista { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.master-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; }
.master-item-acoes { display: flex; gap: 12px; }
.master-senha-campo { position: relative; }
.master-senha-campo span { position: absolute; left: 12px; top: 50%; transform: translateY(-40%); font-size: 0.85rem; }
.master-senha-campo input { padding-left: 36px !important; }
.master-erro { margin: 12px 0 0; padding: 9px 12px; border-radius: 9px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 0.8rem; font-weight: 600; }
.master-resumo { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 0.86rem; }
.master-resumo p { margin: 0; }
.btn-perigo { background: var(--danger) !important; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important; }
.btn-perigo:hover { background: #b91c1c !important; }

.transf-card-botoes { display: flex; align-items: center; gap: 12px; }
.transf-cancelar { color: var(--text-3); text-decoration: none; }
.transf-cancelar:hover { color: var(--danger); }
.transf-linha-cancelada td { color: var(--text-3); }
.transf-linha-cancelada td b { color: var(--text-2); }
.transf-motivo { font-size: 0.72rem; margin-top: 3px; max-width: 240px; }

/* Entregas e coletas */
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-box p.value small { font-size: 0.7rem; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.serv-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--ink);
}
.serv-card.serv-coleta { border-top-color: #7c3aed; }
.serv-card.serv-atrasado { background: #fffdf7; }
.serv-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.serv-tipo { font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.serv-nome { margin: 0; font-size: 1rem; font-weight: 700; }
.serv-fone { margin: 3px 0 0; font-size: 0.82rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.serv-fone a { color: var(--text); text-decoration: none; font-weight: 600; }
.serv-fone a:hover { color: var(--brand); }
.serv-whats { color: #15803d !important; background: #dcfce7; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; }
.serv-dados { display: grid; grid-template-columns: 78px 1fr; gap: 5px 10px; margin: 0; font-size: 0.8rem;
  background: var(--surface-2); border: 1px solid #f0efed; border-radius: 10px; padding: 10px 12px; }
.serv-dados dt { color: var(--text-3); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.serv-dados dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.serv-dados a { color: var(--text); }
.serv-dados a:hover { color: var(--brand); }
.serv-atrasado-txt { color: #b45309; font-weight: 700; }
.serv-rodape { display: flex; flex-direction: column; gap: 8px; }
.serv-motorista { width: 100%; font-size: 0.8rem; padding-top: 6px; padding-bottom: 6px; }
.serv-acoes { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }
.agenda-evento-servico { background: #1c1917; color: #fff; border-left: 2px solid var(--brand); }
.entrega-toggle { margin-top: 12px !important; font-weight: 600 !important; color: var(--text) !important; }
.entrega-box { border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; padding: 12px 14px; margin-top: 8px; background: var(--surface-2); }
.entrega-box label:first-of-type { margin-top: 6px; }
.log-tipo { margin-bottom: 4px; }
@media (max-width: 1100px) { .stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------------
   Importação de planilha
   --------------------------------------------------------------------- */
.imp-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px;
  background-image: radial-gradient(circle at 100% 0%, rgba(255, 91, 0, 0.35), transparent 55%);
}
.imp-banner-titulo { margin: 0; font-weight: 700; font-size: 0.95rem; }
.imp-banner-sub { margin: 4px 0 0; font-size: 0.8rem; color: #a8a29e; }

.imp-dropzone {
  display: flex !important; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 34px 16px;
  background: var(--surface-2); cursor: pointer; margin-top: 0 !important; color: var(--text) !important;
  transition: border-color 0.15s, background 0.15s;
}
.imp-dropzone:hover, .imp-dropzone.arrastando { border-color: var(--brand); background: var(--brand-soft); }
.imp-dropzone input { display: none; }
.imp-dropzone strong { font-size: 0.9rem; }
.imp-dropzone-icone {
  width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 4px;
}

.imp-arquivo-linha { font-size: 0.85rem; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.imp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.imp-kpi {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-size: 0.72rem; color: var(--text-2);
}
.imp-kpi span { display: block; font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.imp-kpi-destaque { background: var(--brand-soft); border-color: #ffc9a6; }
.imp-kpi-destaque span { color: var(--brand-hover); }

.imp-alerta { border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; margin-bottom: 10px; font-size: 0.8rem; background: var(--surface-2); }
.imp-alerta ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); max-height: 170px; overflow-y: auto; }
.imp-alerta li { margin-bottom: 3px; }
.imp-alerta-titulo { margin: 0; font-weight: 700; cursor: default; }
summary.imp-alerta-titulo { cursor: pointer; }
.imp-alerta-rodape { margin: 8px 0 0; font-size: 0.75rem; color: var(--text-2); }
.imp-alerta-erro { background: #fef2f2; border-color: #fecaca; }
.imp-alerta-erro .imp-alerta-titulo { color: #b91c1c; }
.imp-alerta-aviso { background: #fffbeb; border-color: #fde68a; }
.imp-alerta-aviso .imp-alerta-titulo { color: #92400e; }

.imp-tabela select { width: 100%; padding-top: 6px; padding-bottom: 6px; }
.imp-chips { display: flex; flex-wrap: wrap; }

.imp-sucesso { text-align: center; }
.imp-sucesso-icone {
  width: 56px; height: 56px; border-radius: 50%; margin: 4px auto 10px;
  background: var(--success); color: #fff; font-size: 1.6rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.imp-sucesso-titulo { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; }
.imp-sucesso .imp-kpis { text-align: left; }

@media (max-width: 560px) {
  .imp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------------
   Login + usuário logado
   --------------------------------------------------------------------- */
.topbar-usuario { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.topbar-usuario-info { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-usuario-info b { font-size: 0.8rem; }
.topbar-usuario-info small { font-size: 0.66rem; color: var(--text-3); font-weight: 600; }
.topbar-sair { border: none; background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 0.75rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.topbar-sair:hover { background: var(--ink); color: #fff; }
@media (max-width: 900px) { .topbar-usuario-info { display: none; } }

.login-body { background: var(--ink); min-height: 100vh; }
.login-shell { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-marca {
  position: relative; overflow: hidden; color: #fff; padding: 44px 52px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 85% 15%, rgba(255, 91, 0, 0.45), transparent 45%), radial-gradient(circle at 10% 100%, rgba(255, 91, 0, 0.18), transparent 40%), var(--ink);
}
.login-marca::after {
  content: ''; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; opacity: 0.07;
  background: repeating-linear-gradient(135deg, #fff 0 28px, transparent 28px 56px); border-radius: 50%;
}
.login-logo { height: 52px; width: auto; }
.login-kicker { color: var(--brand); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 12px; }
.login-marca-texto h1 { font-size: 2.3rem; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 14px; max-width: 480px; }
.login-marca-texto p { color: #a8a29e; margin: 0; }
.login-rodape { color: #78716c; font-size: 0.78rem; margin: 0; position: relative; z-index: 1; }
.login-rodape a { color: #d6d3d1; }
.login-painel { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 30px; box-shadow: var(--shadow); }
.login-form h2 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; }
.login-sub { color: var(--text-2); font-size: 0.84rem; margin: 0 0 18px; }
.login-form label { display: block; font-size: 0.74rem; font-weight: 600; color: var(--text-2); margin: 14px 0 5px; }
.login-form input[type="text"], .login-form input[type="password"] { width: 100%; height: 46px; font-size: 0.95rem; }
.login-senha { position: relative; }
.login-senha input { padding-right: 44px; }
.login-ver { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; cursor: pointer; font-size: 1rem; opacity: 0.5; padding: 6px; }
.login-ver:hover { opacity: 1; }
.login-botao { height: 48px; font-size: 0.95rem; margin-top: 20px; }
.login-erro { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 0.82rem; font-weight: 600; }
.login-dica { font-size: 0.75rem; color: var(--text-3); text-align: center; margin: 16px 0 0; }
.login-voltar { display: block; margin: 14px auto 0; }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-marca { padding: 28px 22px; min-height: auto; gap: 18px; }
  .login-marca-texto h1 { font-size: 1.5rem; }
  .login-marca-texto p, .login-rodape { display: none; }
  .login-painel { align-items: flex-start; padding-top: 26px; }
}

/* ---------------------------------------------------------------------
   Responsivo
   --------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.45); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
  .content { padding: 20px 16px 40px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .historico-layout { grid-template-columns: minmax(0, 1fr); }
  .tab-content { overflow-x: auto; }
}

@media (max-width: 560px) {
  .stats { gap: 10px; }
  .stat-box { padding: 12px 14px; }
  .stat-box p.value { font-size: 1.3rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 0; }
  .checklist-itens { grid-template-columns: 1fr; }
  .agenda-mes { grid-auto-rows: minmax(60px, auto); gap: 3px; }
  .agenda-semana { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box, .modal-box.modal-lg { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
}

/* ---------------------------------------------------------------------
   Roteiro do motorista (aba Transferências → 🗺 Montar roteiro)
   --------------------------------------------------------------------- */
.modal-box.modal-xl { max-width: 1120px; max-height: 92vh; }
.rota-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.rota-col-form { min-width: 0; }
.rota-col-resultado { min-width: 0; }
.rota-check { display: flex !important; align-items: center; gap: 8px; font-size: 0.82rem !important; color: var(--text) !important; }
.rota-check input { width: auto; margin: 0; }
.rota-candidatos { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 4px; max-height: 46vh; overflow-y: auto; }
.rota-cand-titulo { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 14px 0 6px; }
.rota-cand-titulo span { color: var(--text-3); }
.rota-cand { display: flex !important; gap: 10px; align-items: flex-start; padding: 8px 10px; margin: 0 0 6px !important; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400 !important; color: var(--text) !important; font-size: 0.82rem !important; }
.rota-cand:hover { border-color: var(--border-strong); }
.rota-cand:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.rota-cand input { width: auto; margin-top: 3px; accent-color: var(--brand); }
.rota-cand > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rota-cand .hint { font-size: 0.74rem; }
.rota-cand-grupo summary { cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.rota-cand-grupo summary span { color: var(--text-3); }
.rota-vazio { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 40px 24px; text-align: center; color: var(--text-2); }
.rota-vazio p:first-child { font-size: 2rem; margin: 0 0 6px; }
.rota-barra { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: -24px; background: var(--surface); margin: 18px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--border); z-index: 3; }
.rota-barra .master-erro { margin: 0 auto 0 0; flex: 1 1 260px; }
.rota-barra select { min-width: 200px; }
.rota-resumo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.rota-resumo > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 0.72rem; color: var(--text-2); }
.rota-resumo span { display: block; font-size: 1.02rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.rota-resumo-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rota-avisos { margin-bottom: 12px; }
.rota-avisos p { margin: 2px 0; font-size: 0.8rem; }
.rota-mapa { height: 300px; border-radius: 12px; border: 1px solid var(--border); margin: 12px 0; background: var(--surface-2); z-index: 1; }
.rota-btn-link { display: block; text-align: center; margin-top: 12px; text-decoration: none; }
.rota-pino { display: flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 0.72rem; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.35); white-space: nowrap; }
.rota-pino.unidade { background: var(--ink); }
.rota-pino.feito { background: #16a34a; }
.rota-pino-base { background: #fff; font-size: 0.95rem; border-color: var(--ink); }

.rota-paradas { list-style: none; margin: 0; padding: 0; position: relative; }
.rota-parada { display: flex; gap: 12px; position: relative; padding-bottom: 12px; }
.rota-parada:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.rota-num { flex: 0 0 30px; height: 30px; border-radius: 999px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; position: relative; z-index: 1; }
.rota-parada-corpo { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.rota-parada.proxima .rota-num { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.rota-parada.proxima .rota-parada-corpo { border-color: var(--brand); }
.rota-parada.feita .rota-num { background: #16a34a; }
.rota-parada.feita .rota-parada-corpo { opacity: 0.6; }
.rota-parada-topo { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rota-acao { font-size: 0.86rem; }
.rota-hora { font-weight: 700; font-size: 0.86rem; color: var(--brand-hover); white-space: nowrap; }
.rota-end { display: block; font-size: 0.78rem; color: var(--text-2); margin-top: 2px; text-decoration: none; }
.rota-end:hover { color: var(--brand-hover); }
.rota-itens { margin: 6px 0 0; padding-left: 16px; font-size: 0.78rem; }
.rota-itens li { margin: 2px 0; }
.rota-itens .hint { font-size: 0.72rem; }
.rota-item-encerrado b { text-decoration: line-through; color: var(--text-3); }
.rota-parada-rodape { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 0.76rem; }
.rota-parada-rodape .btn-sm { margin-left: auto; }
.rota-carga { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.rota-carga-barra { width: 54px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; display: inline-block; }
.rota-carga-barra span { display: block; height: 100%; background: var(--brand); }

.rota-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s; }
.rota-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.rota-card-motorista { margin: 8px 0; font-size: 0.86rem; font-weight: 600; }
.rota-card-linha { margin: 8px 0 0; font-size: 0.8rem; color: var(--text-2); }
.rota-card-prox { margin: 6px 0 0; font-size: 0.8rem; }
.rota-progresso { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.rota-progresso span { display: block; height: 100%; background: var(--brand); transition: width 0.3s; }
.rota-tag { border: 0; cursor: pointer; font: inherit; font-size: 0.7rem; font-weight: 700; }

@media (max-width: 900px) {
  .rota-layout { grid-template-columns: minmax(0, 1fr); }
  .rota-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rota-candidatos { max-height: none; }
}
@media (max-width: 560px) {
  .modal-box.modal-xl { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
  .rota-barra { justify-content: stretch; }
  .rota-barra > * { flex: 1 1 100%; }
  .rota-mapa { height: 240px; }
}
