/* =============================================================
   VEKTOR — Folha de estilo
   -------------------------------------------------------------
   Mesma família tipográfica do site institucional (Archivo +
   IBM Plex Sans/Mono), mas paleta e composição de "produto SaaS":
   fundo quase preto, cartões em petróleo/grafite, laranja só nos
   pontos de ação e destaque de dados.
   ============================================================= */

:root {
  --ink:      #0A0F14;
  --panel:    #10161D;
  --panel-2:  #161E27;
  --line:     rgba(232, 237, 242, .09);
  --line-2:   rgba(232, 237, 242, .16);

  --text:     #E8EDF2;
  --muted:    #8CA0B3;

  --signal:      #FF5A1F;
  --signal-soft: rgba(255, 90, 31, .13);
  --ok:          #4ADE80;
  --ok-soft:     rgba(74, 222, 128, .13);

  --f-display: 'Archivo', 'Helvetica Neue', sans-serif;
  --f-body:    'IBM Plex Sans', system-ui, sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius:    8px;
  --ease:      cubic-bezier(.22, .68, .28, 1);
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; background: var(--ink); }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-body);
  font-size: .95rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

.mono { font-family: var(--f-mono); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .82rem 1.4rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .04em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.btn--solid { background: var(--signal); color: #fff; }
.btn--solid:hover { background: #FF6F3C; }
.btn--block { width: 100%; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }


/* =============================================================
   LAYOUT — AUTH (login)
   ============================================================= */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255, 90, 31, .13), transparent 70%),
    var(--ink);
}

.auth__card {
  width: 100%;
  max-width: 23rem;
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  justify-content: center;
  margin-bottom: 2.25rem;
}
.auth__brand svg { width: 30px; height: 24px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: square; }
.auth__brand svg .peak { stroke: var(--signal); }
.auth__brand b {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: .04em;
}
.auth__brand span {
  font-family: var(--f-mono);
  font-size: .62rem;
  color: var(--muted);
  letter-spacing: .2em;
  text-transform: uppercase;
  display: block;
}

.auth__box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.85rem;
}

.auth__title { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; margin-bottom: .3rem; }
.auth__lead  { color: var(--muted); font-size: .87rem; margin-bottom: 1.65rem; }

.auth__error {
  background: var(--signal-soft);
  border: 1px solid rgba(255, 90, 31, .35);
  color: #FFC7B0;
  border-radius: var(--radius);
  padding: .8rem 1rem;
  font-size: .85rem;
  margin-bottom: 1.4rem;
}

.field { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.field label { font-size: .78rem; color: var(--muted); margin-bottom: .45rem; }
.field input,
.field textarea {
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: .78rem .9rem;
  font-size: .92rem;
  transition: border-color .25s var(--ease);
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--signal); }
.field textarea { font-family: inherit; }

.auth__foot {
  text-align: center;
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: .76rem;
}


/* =============================================================
   LAYOUT — APP (painel logado)
   ============================================================= */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  transition: grid-template-columns .2s var(--ease);
}
.shell.is-collapsed { grid-template-columns: 76px 1fr; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: 1.35rem 1.4rem;
  border-bottom: 1px solid var(--line);
}
.sidebar__brand svg { width: 26px; height: 21px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: square; flex: none; }
.sidebar__brand svg .peak { stroke: var(--signal); }
.sidebar__brand b { font-family: var(--f-display); font-weight: 800; font-size: 1.02rem; letter-spacing: .03em; }

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .85rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.sidebar__nav::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.sidebar__group {
  font-family: var(--f-mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  padding: 1rem .6rem .5rem;
  white-space: nowrap;
}
.sidebar__group:first-child { padding-top: 0; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .65rem;
  border-radius: var(--radius);
  font-size: .87rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.sidebar__link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }
.sidebar__link:hover { background: rgba(232, 237, 242, .05); color: var(--text); }
.sidebar__link.is-active { background: var(--signal-soft); color: var(--signal); }

.sidebar__link.is-disabled {
  color: rgba(140, 160, 179, .45);
  cursor: default;
  pointer-events: none;
}
.sidebar__soon {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(232, 237, 242, .06);
  padding: .15rem .4rem;
  border-radius: 3px;
}

.sidebar__foot { padding: 1rem 1.4rem; border-top: 1px solid var(--line); }
.sidebar__foot p { font-family: var(--f-mono); font-size: .66rem; color: var(--muted); white-space: nowrap; overflow: hidden; }

.sidebar__collapse {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .7rem 1.4rem;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.sidebar__collapse:hover { background: rgba(232, 237, 242, .05); color: var(--text); }
.sidebar__collapse svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; transition: transform .2s var(--ease); }
.sidebar__collapse span { white-space: nowrap; }

/* Recolhido: esconde rótulos e textos, centraliza ícones, mantém a largura fixa do .shell.is-collapsed */
.shell.is-collapsed .sidebar__brand b,
.shell.is-collapsed .sidebar__group,
.shell.is-collapsed .sidebar__link span,
.shell.is-collapsed .sidebar__soon,
.shell.is-collapsed .sidebar__foot p,
.shell.is-collapsed .sidebar__collapse span { display: none; }
.shell.is-collapsed .sidebar__brand { justify-content: center; padding-inline: .5rem; }
.shell.is-collapsed .sidebar__link { justify-content: center; padding-inline: .5rem; }
.shell.is-collapsed .sidebar__collapse { justify-content: center; padding-inline: .5rem; }
.shell.is-collapsed .sidebar__collapse svg { transform: rotate(180deg); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 29, .6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar__title { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; }

.topbar__user { display: flex; align-items: center; gap: .85rem; }
.topbar__user-info { text-align: right; line-height: 1.25; }
.topbar__user-info b { display: block; font-size: .85rem; }
.topbar__user-info span { font-size: .72rem; color: var(--muted); text-transform: capitalize; }
.topbar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--signal-soft);
  color: var(--signal);
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: .82rem;
  flex: none;
}
.topbar__logout {
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: .55rem .8rem;
  font-size: .78rem;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.topbar__logout:hover { color: var(--text); border-color: var(--muted); }

.content { flex: 1; padding: 1.75rem; }

.hello { margin-bottom: 1.75rem; }
.hello h1 { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; margin-bottom: .3rem; }
.hello p { color: var(--muted); font-size: .9rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.tile span {
  display: block;
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .55rem;
}
.tile b { font-family: var(--f-mono); font-size: 1.6rem; font-weight: 500; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel h2 { font-family: var(--f-display); font-size: 1.05rem; margin-bottom: .4rem; }
.panel p { color: var(--muted); font-size: .88rem; max-width: 42rem; }

.roadmap { margin-top: 1.25rem; display: grid; gap: .6rem; }
.roadmap li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .84rem;
  color: var(--muted);
}
.roadmap li b { color: var(--text); font-weight: 500; min-width: 9rem; }
.roadmap .tag {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: .62rem;
  text-transform: uppercase;
  padding: .2rem .5rem;
  border-radius: 3px;
  background: var(--ok-soft);
  color: var(--ok);
}
.roadmap .tag.is-pending { background: rgba(232, 237, 242, .07); color: var(--muted); }

.burger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.burger span { width: 20px; height: 2px; background: var(--text); }

/* =============================================================
   CRUD — cabeçalho de página, tabela, badges, formulário
   ============================================================= */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-head h1 { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; margin-bottom: .3rem; }
.page-head p  { color: var(--muted); font-size: .87rem; }

.btn--ghost {
  border: 1px solid var(--line-2);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--muted); }
.btn--sm { padding: .55rem .95rem; font-size: .74rem; }
.btn--danger { color: #FF8555; border: 1px solid rgba(255, 90, 31, .35); background: transparent; }
.btn--danger:hover { background: var(--signal-soft); }

.alert {
  border-radius: var(--radius);
  padding: .85rem 1.05rem;
  font-size: .87rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
}
.alert--ok   { background: var(--ok-soft); border-color: rgba(74, 222, 128, .35); color: #BBF7D0; }
.alert--erro { background: var(--signal-soft); border-color: rgba(255, 90, 31, .35); color: #FFC7B0; }

.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  min-width: 0;
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--panel-2); }
th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  padding: .8rem 1.1rem;
  font-weight: 500;
  white-space: nowrap;
}
td {
  padding: .85rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .87rem;
  vertical-align: middle;
}
tbody tr:hover { background: rgba(232, 237, 242, .025); }
td.col-acoes { text-align: right; white-space: nowrap; }
td.col-acoes form { display: inline-block; }
/* Muitos botões na linha: quebra em duas linhas em vez de alargar a tabela */
td.col-acoes--quebra { white-space: normal; min-width: 11rem; }
td.col-acoes--quebra > * { margin: .15rem 0 .15rem .3rem; vertical-align: middle; }

.mono-cell { font-family: var(--f-mono); color: var(--text); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--f-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .28rem .6rem;
  border-radius: 999px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--disponivel { background: var(--ok-soft); color: var(--ok); }
.badge--em_viagem  { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--manutencao,
.badge--ferias     { background: rgba(140, 160, 179, .16); color: var(--muted); }
.badge--inativo    { background: rgba(232, 237, 242, .07); color: rgba(140, 160, 179, .7); }

/* status de viagem */
.badge--planejada    { background: rgba(140, 160, 179, .16); color: var(--muted); }
.badge--em_andamento { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--concluida    { background: var(--ok-soft); color: var(--ok); }
.badge--cancelada    { background: rgba(232, 237, 242, .07); color: rgba(140, 160, 179, .7); }

/* status de carga */
.badge--aguardando   { background: rgba(140, 160, 179, .16); color: var(--muted); }
.badge--em_montagem  { background: var(--signal-soft); color: var(--signal); }
.badge--em_transito  { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--entregue     { background: var(--ok-soft); color: var(--ok); }

/* status de entrega */
.badge--pendente        { background: rgba(140, 160, 179, .16); color: var(--muted); }
.badge--em_transporte   { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--chegou_destino  { background: var(--signal-soft); color: var(--signal); }
.badge--confirmada      { background: var(--ok-soft); color: var(--ok); }

/* status de ocorrência */
.badge--aberta      { background: var(--signal-soft); color: var(--signal); }
.badge--em_analise  { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--resolvida   { background: var(--ok-soft); color: var(--ok); }

/* prioridade de ocorrência */
.badge--baixa  { background: rgba(140, 160, 179, .16); color: var(--muted); }
.badge--media  { background: rgba(255, 176, 32, .13); color: #FFB020; }
.badge--alta   { background: var(--signal-soft); color: var(--signal); }

/* status de manutenção — "agendada" só; concluida/cancelada/em_andamento já vêm de Viagem, acima */
.badge--agendada     { background: rgba(140, 160, 179, .16); color: var(--muted); }

/* status de cotação — "em_analise" já vem de ocorrência, acima */
.badge--nova        { background: var(--signal-soft); color: var(--signal); }
.badge--respondida  { background: var(--ok-soft); color: var(--ok); }
.badge--arquivada   { background: rgba(232, 237, 242, .07); color: rgba(140, 160, 179, .7); }

.relatorio-periodo-custom { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.relatorio-periodo-custom[hidden] { display: none !important; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

/* --- formulário de cadastro --- */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 42rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.1rem;
  margin-bottom: 1.5rem;
}
.form-grid .field { margin-bottom: 0; }
.field--full { grid-column: 1 / -1; }

.field select {
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: .78rem .9rem;
  font-size: .92rem;
  width: 100%;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--signal); }

.field__error {
  color: #FF8555;
  font-size: .76rem;
  margin-top: .35rem;
}
.field.has-error input,
.field.has-error select { border-color: #FF8555; }

.form-actions { display: flex; gap: .85rem; }

/* =============================================================
   DASHBOARD — cards, mapa, viagens ativas, gráficos, alertas,
   notificações, barra de status
   ============================================================= */

.hello { margin-bottom: 1.75rem; }
.hello h1 { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; margin-bottom: .3rem; }
.hello p { color: var(--muted); font-size: .9rem; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}
.stat-card__icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-card__icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.stat-card__icon--azul    { background: rgba(96, 165, 250, .14); color: #60A5FA; }
.stat-card__icon--verde   { background: var(--ok-soft); color: var(--ok); }
.stat-card__icon--laranja { background: var(--signal-soft); color: var(--signal); }
.stat-card__icon--roxo    { background: rgba(167, 139, 250, .14); color: #A78BFA; }
.stat-card__icon--amarelo { background: rgba(255, 176, 32, .14); color: #FFB020; }

.stat-card__body { display: flex; flex-direction: column; min-width: 0; }
.stat-card__body span {
  font-family: var(--f-mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .4rem;
}
.stat-card__body b { font-family: var(--f-mono); font-size: 1.55rem; font-weight: 500; line-height: 1; }
.stat-card__variacao { font-size: .74rem; margin-top: .45rem; font-style: normal; }
.stat-card__variacao.is-alta  { color: var(--ok); }
.stat-card__variacao.is-baixa { color: var(--signal); }

.dash-grid-2col {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  align-items: start;
}
.dash-grid-2col--igual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.dash-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}
/* Telas menores: as colunas empilham em vez de espremer/cortar o conteúdo */
@media (max-width: 1200px) {
  .dash-grid-2col { grid-template-columns: minmax(0, 1fr); }
  .dash-grid-2col--igual { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-3col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid-4col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dash-grid-2col--igual,
  .dash-grid-3col, .dash-grid-4col { grid-template-columns: minmax(0, 1fr); }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.panel-head h2 { margin-bottom: 0; }

/* Mapa de operações */
.mapa-operacoes__legenda-tempo {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--f-mono);
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dot-viva {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, .6);
  animation: dash-pulso 1.8s infinite;
}
@keyframes dash-pulso {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); }
  70%  { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.mapa-operacoes__svg {
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
}

/* Estados do Brasil — cinza neutro por padrão, destacados quando têm viagem ativa */
.mapa-estado {
  fill: rgba(232, 237, 242, .06);
  stroke: var(--line-2);
  stroke-width: 0.6;
  transition: fill .2s var(--ease);
}
.mapa-estado:hover { fill: rgba(232, 237, 242, .12); }
.mapa-estado--ativo.mapa-estado--em_andamento { fill: rgba(255, 176, 32, .55); stroke: #FFB020; }
.mapa-estado--ativo.mapa-estado--planejada    { fill: rgba(140, 160, 179, .45); stroke: var(--muted); }
.mapa-estado--ativo.mapa-estado--concluida    { fill: rgba(74, 222, 128, .45); stroke: var(--ok); }
.mapa-estado--ativo.mapa-estado--cancelada    { fill: rgba(232, 237, 242, .1); stroke: var(--line-2); }

.mapa-operacoes__legenda {
  display: flex;
  gap: 1.25rem;
  margin-top: .9rem;
  font-size: .78rem;
  color: var(--muted);
}
.mapa-operacoes__legenda span { display: inline-flex; align-items: center; gap: .4rem; }
.mapa-legenda-cor {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.mapa-legenda-cor--em_andamento { background: #FFB020; }
.mapa-legenda-cor--planejada    { background: var(--muted); }
.mapa-legenda-cor--concluida    { background: var(--ok); }
.mapa-legenda-cor--cancelada    { background: rgba(232, 237, 242, .3); }

/* Viagens ativas */
.viagem-ativa-lista { display: flex; flex-direction: column; gap: .85rem; }
.viagem-ativa-item {
  display: block;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  transition: border-color .2s var(--ease);
}
.viagem-ativa-item:hover { border-color: var(--line-2); }
.viagem-ativa-item__topo {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .65rem;
}
.viagem-ativa-item__rota { font-size: .88rem; font-weight: 500; margin-bottom: .2rem; }
.viagem-ativa-item__motorista { font-size: .76rem; color: var(--muted); }
.viagem-ativa-item__percentual { display: block; text-align: right; font-size: .7rem; color: var(--muted); margin-top: .35rem; }

.progresso-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(232, 237, 242, .08);
  overflow: hidden;
}
.progresso-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--signal), #FFB020);
}

/* Donut de entregas */
.donut-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 1.25rem; }
.grafico-linha-wrap { position: relative; height: 200px; }
.donut-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-total span { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.donut-total b { font-family: var(--f-mono); font-size: 1.3rem; font-weight: 500; }

.donut-legenda { display: flex; flex-direction: column; gap: .55rem; }
.donut-legenda li { display: flex; align-items: center; gap: .6rem; font-size: .8rem; }
.donut-legenda i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.donut-legenda b { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .76rem; }

/* Alertas da frota */
.alerta-lista { display: flex; flex-direction: column; gap: .75rem; }
.alerta-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .75rem .85rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.alerta-item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; margin-top: .1rem; }
.alerta-item b { display: block; font-size: .84rem; margin-bottom: .15rem; }
.alerta-item span { display: block; font-size: .76rem; color: var(--muted); }
.alerta-item--alta  { background: var(--signal-soft); border-color: rgba(255, 90, 31, .25); color: var(--signal); }
.alerta-item--media { background: rgba(255, 176, 32, .1); border-color: rgba(255, 176, 32, .25); color: #FFB020; }
.alerta-item--alta b, .alerta-item--media b { color: var(--text); }

/* Notificações */
.notificacao-lista { display: flex; flex-direction: column; gap: .9rem; }
.notificacao-item { display: flex; gap: .75rem; align-items: flex-start; }
.notificacao-item__icone {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.notificacao-item__icone svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.notificacao-item__icone--ok      { background: var(--ok-soft); color: var(--ok); }
.notificacao-item__icone--signal  { background: var(--signal-soft); color: var(--signal); }
.notificacao-item__icone--amarelo { background: rgba(255, 176, 32, .14); color: #FFB020; }
.notificacao-item__icone--muted   { background: rgba(140, 160, 179, .14); color: var(--muted); }
.notificacao-item div { flex: 1; min-width: 0; }
.notificacao-item b { display: block; font-size: .82rem; margin-bottom: .1rem; }
.notificacao-item span { display: block; font-size: .76rem; color: var(--muted); }
.notificacao-item time { font-size: .68rem; color: var(--muted); white-space: nowrap; }

/* Barra de status do sistema */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.status-bar__online { display: inline-flex; align-items: center; gap: .45rem; }
.status-bar__online .dot-viva { background: var(--ok); }

/* =============================================================
   VIAGENS — filtro, paginação, tela de detalhes
   ============================================================= */

.filtro-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.filtro-bar .field { min-width: 10rem; flex: 1; }
.filtro-bar .field input,
.filtro-bar .field select { width: 100%; }

.paginacao {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.paginacao__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--muted);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.paginacao__item:hover { color: var(--text); border-color: var(--muted); }
.paginacao__item.is-active { background: var(--signal); border-color: var(--signal); color: #fff; }

/* Cabeçalho da tela de detalhes de viagem */
.viagem-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.viagem-header__titulo { display: flex; align-items: center; gap: .85rem; flex-wrap: wrap; }
.viagem-header__titulo h1 { font-family: var(--f-display); font-weight: 700; font-size: 1.4rem; }
.viagem-header__rota { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.viagem-header__acoes { display: flex; gap: .75rem; flex-wrap: wrap; }

/* Timeline de origem → paradas → destino */
.timeline-paradas {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 1rem 0;
}
.timeline-ponto {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 8rem;
  text-align: center;
  position: relative;
}
.timeline-ponto__marca {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  border: 3px solid var(--panel);
  box-shadow: 0 0 0 2px var(--line-2);
  z-index: 1;
}
.timeline-ponto--feito .timeline-ponto__marca { background: var(--ok); box-shadow: 0 0 0 2px rgba(74, 222, 128, .4); }
.timeline-ponto--atual .timeline-ponto__marca { background: var(--signal); box-shadow: 0 0 0 2px rgba(255, 90, 31, .4); }
.timeline-ponto__linha {
  position: absolute;
  top: 6px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line-2);
  z-index: 0;
}
.timeline-ponto:first-child .timeline-ponto__linha { display: none; }
.timeline-ponto--feito .timeline-ponto__linha { background: var(--ok); }
.timeline-ponto__label { margin-top: .6rem; font-size: .8rem; font-weight: 500; }
.timeline-ponto__sub { font-size: .7rem; color: var(--muted); margin-top: .15rem; }

/* Cards compactos de informação (cliente/carga/motorista/veículo) */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.info-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.info-card__titulo {
  font-family: var(--f-mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .6rem;
}
.info-card__nome { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; }
.info-card__linha { font-size: .82rem; color: var(--muted); margin-bottom: .15rem; }
.info-card__linha a { color: var(--signal); text-decoration: underline; }

.atividade-lista { display: flex; flex-direction: column; gap: .9rem; }

.parada-lista { display: flex; flex-direction: column; gap: .65rem; margin-bottom: 1.1rem; }
.parada-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .85rem;
}

.documento-lista { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.1rem; }
.documento-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .85rem;
}
.documento-item__nome { font-weight: 500; }
.documento-item__meta { font-size: .72rem; color: var(--muted); }

/* Registro de comunicação — timeline vertical de eventos (ocorrências) */
.comunicacao-lista { display: flex; flex-direction: column; gap: 0; max-height: 24rem; overflow-y: auto; }
.comunicacao-item {
  display: flex;
  gap: .85rem;
  padding-bottom: 1.1rem;
  position: relative;
}
.comunicacao-item::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--line-2);
}
.comunicacao-item:last-child { padding-bottom: 0; }
.comunicacao-item:last-child::before { display: none; }

.comunicacao-item__marca {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--muted);
  flex: none;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}
.comunicacao-item__marca--acao { border-color: var(--signal); }

.comunicacao-item__corpo { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.5; }
.comunicacao-item__quando { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); display: block; margin-bottom: .15rem; }
.comunicacao-item__autor { font-size: .72rem; color: var(--muted); }

/* Ações realizadas — checklist de itens já executados */
.checklist { display: flex; flex-direction: column; gap: .7rem; }
.checklist-item { display: flex; gap: .6rem; align-items: flex-start; font-size: .84rem; line-height: 1.45; }
.checklist-item__marca {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}
.checklist-item__marca svg { width: 12px; height: 12px; }

/* Mapa do local da ocorrência — sem geocoding, só o aviso honesto */
.mapa-placeholder {
  display: grid;
  place-items: center;
  min-height: 8rem;
  padding: 1rem;
  background: var(--panel-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .78rem;
  text-align: center;
}

/* =============================================================
 | PORTAL DO CLIENTE
 |
 | Área externa (/sistema/portal). Reaproveita o tema, os painéis e
 | o mapa do sistema interno; o que muda é a densidade — o cliente
 | olha poucas informações grandes, não uma malha operacional.
 |
 | Convenção deste bloco: `.is-locked` marca todo elemento de um
 | módulo ainda não construído (cinza, sem cursor de link, sem href).
 ============================================================= */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- Sidebar ---------- */
.portal-brand b {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.portal-brand b small {
  font-family: var(--f-body);
  font-size: .54rem;
  letter-spacing: .18em;
  color: var(--muted);
  font-weight: 500;
  margin-top: .18rem;
}

.portal-sidebar .sidebar__nav { gap: .3rem; padding-top: .5rem; }

.portal-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .68rem .85rem;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  transition: background .2s var(--ease), color .2s var(--ease);
  position: relative;
}
.portal-link svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  flex: none;
}
.portal-link span { display: flex; flex-direction: column; min-width: 0; }
.portal-link b {
  font-size: .84rem;
  font-weight: 600;
  color: inherit;
  line-height: 1.25;
}
.portal-link em {
  font-style: normal;
  font-size: .68rem;
  color: var(--muted);
  opacity: .85;
  line-height: 1.3;
  margin-top: .1rem;
}
.portal-link:hover:not(.is-locked) { background: rgba(232, 237, 242, .05); color: var(--text); }
.portal-link:hover:not(.is-locked) b { color: var(--text); }

.portal-link.is-active {
  background: var(--signal-soft);
  color: var(--signal);
  box-shadow: inset 2px 0 0 var(--signal);
}
.portal-link.is-active b { color: var(--signal); }

.portal-link.is-locked { opacity: .42; cursor: not-allowed; }
.portal-link__cadeado {
  width: 13px !important; height: 13px !important;
  margin-left: auto;
  stroke-width: 1.6;
}

/* Bloco de ajuda no rodapé da sidebar */
.portal-ajuda {
  margin: auto .9rem 1rem;
  padding: 1rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-ajuda b { display: block; font-size: .84rem; margin-bottom: .35rem; }
.portal-ajuda p { font-size: .72rem; color: var(--muted); line-height: 1.45; margin-bottom: .8rem; }
.portal-ajuda__botao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem;
  border-radius: var(--radius);
  background: var(--signal);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
}
.portal-ajuda__botao svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.portal-ajuda__botao.is-locked { opacity: .5; cursor: not-allowed; }

/* ---------- Topbar ---------- */
.portal-topbar__acoes { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; }

.portal-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--muted);
}
.portal-topbar__item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.portal-topbar__item.is-locked { opacity: .5; cursor: not-allowed; }

.portal-topbar__sino { position: relative; color: var(--muted); display: inline-flex; }
.portal-topbar__sino svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.portal-topbar__sino.is-locked { opacity: .6; cursor: not-allowed; }
.portal-topbar__badge {
  position: absolute;
  top: -6px; right: -7px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--signal);
  color: #fff;
  font-family: var(--f-mono);
  font-size: .6rem;
  font-style: normal;
  display: grid;
  place-items: center;
}

.portal-topbar__user { display: flex; align-items: center; gap: .65rem; }
.portal-topbar__user-info { display: flex; flex-direction: column; line-height: 1.3; }
.portal-topbar__user-info b { font-size: .82rem; }
.portal-topbar__user-info span { font-size: .68rem; color: var(--muted); }

/* ---------- Saudação ---------- */
.portal-hello { margin-bottom: 1.4rem; }
.portal-hello h1 { font-family: var(--f-display); font-size: 1.6rem; margin-bottom: .3rem; }
.portal-hello p { color: var(--muted); font-size: .88rem; }

/* ---------- Cards do topo ---------- */
.portal-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.portal-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-card__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex: none;
}
.portal-card__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.portal-card__icon--azul    { background: rgba(96, 165, 250, .14); color: #60A5FA; }
.portal-card__icon--verde   { background: var(--ok-soft); color: var(--ok); }
.portal-card__icon--laranja { background: var(--signal-soft); color: var(--signal); }
.portal-card__icon--roxo    { background: rgba(167, 139, 250, .14); color: #A78BFA; }

.portal-card__body { display: flex; flex-direction: column; min-width: 0; }
.portal-card__body > span {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .3rem;
}
.portal-card__body b { font-size: 1.75rem; line-height: 1; margin-bottom: .3rem; }
.portal-card__body em {
  font-style: normal;
  font-size: .72rem;
  color: var(--muted);
}

/* ---------- Grid principal ---------- */
.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
}
.portal-coluna { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.portal-panel { margin: 0; }

.portal-link-inerte {
  font-family: var(--f-mono);
  font-size: .76rem;
  color: var(--signal);
}
.portal-link-inerte.is-locked { opacity: .55; cursor: not-allowed; }

.shell.is-collapsed .portal-brand b small,
.shell.is-collapsed .portal-link span,
.shell.is-collapsed .portal-ajuda { display: none; }
.shell.is-collapsed .portal-link { justify-content: center; padding-inline: .5rem; }
.shell.is-collapsed .portal-link__cadeado { display: none; }
.portal-link-inerte--botao {
  display: inline-block;
  margin-top: 1rem;
  padding: .6rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 600;
}

/* ---------- Lista de cargas ---------- */
.portal-carga-lista { display: flex; flex-direction: column; }
.portal-carga {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.portal-carga:last-child { border-bottom: 0; padding-bottom: .2rem; }
.portal-carga:first-child { padding-top: .4rem; }

.portal-carga__topo {
  display: grid;
  grid-template-columns: 44px minmax(120px, .9fr) minmax(0, 1.6fr) minmax(140px, .9fr);
  gap: 1rem;
  align-items: start;
}

.portal-carga__icone {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.portal-carga__icone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.portal-carga__icone--aguardando   { background: rgba(167, 139, 250, .14); color: #A78BFA; }
.portal-carga__icone--carregamento { background: var(--signal-soft); color: var(--signal); }
.portal-carga__icone--transito     { background: rgba(96, 165, 250, .14); color: #60A5FA; }
.portal-carga__icone--saiu         { background: rgba(255, 176, 32, .14); color: #FFB020; }
.portal-carga__icone--entregue     { background: var(--ok-soft); color: var(--ok); }

.portal-carga__id { display: flex; flex-direction: column; gap: .18rem; min-width: 0; }
.portal-carga__id b { font-size: .84rem; color: var(--text); }
.portal-carga__id span { font-size: .7rem; color: var(--muted); }

.portal-carga__rota {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .7rem;
  align-items: center;
  min-width: 0;
}
.portal-carga__rota b {
  display: block;
  font-size: .84rem;
  margin-bottom: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-carga__rota span {
  display: block;
  font-size: .7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.portal-carga__seta { width: 22px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex: none; }

.portal-carga__status { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.portal-carga__status em {
  font-style: normal;
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.45;
}

.portal-badge {
  display: inline-block;
  padding: .28rem .6rem;
  border-radius: 5px;
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .05em;
  white-space: nowrap;
}
.portal-badge--aguardando   { background: rgba(167, 139, 250, .16); color: #A78BFA; }
.portal-badge--carregamento { background: var(--signal-soft); color: var(--signal); }
.portal-badge--transito     { background: rgba(96, 165, 250, .16); color: #60A5FA; }
.portal-badge--saiu         { background: rgba(255, 176, 32, .16); color: #FFB020; }
.portal-badge--entregue     { background: var(--ok-soft); color: var(--ok); }

/* ---------- Timeline de acompanhamento ---------- */
.portal-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
  margin-top: 1.1rem;
  padding: 0;
}
.portal-timeline__passo {
  position: relative;
  text-align: center;
  padding-top: 1.15rem;
}
/* Trilho: metade à esquerda e metade à direita de cada bolinha, para
   a linha nascer e morrer nos extremos, sem sobrar ponta. */
.portal-timeline__passo::before,
.portal-timeline__passo::after {
  content: '';
  position: absolute;
  top: 5px;
  height: 2px;
  background: var(--line-2);
}
.portal-timeline__passo::before { left: 0; right: 50%; }
.portal-timeline__passo::after  { left: 50%; right: 0; }
.portal-timeline__passo:first-child::before,
.portal-timeline__passo:last-child::after { display: none; }

.portal-timeline__passo i {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--line-2);
  z-index: 1;
}
.portal-timeline__passo span {
  display: block;
  font-size: .66rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Etapas já cumpridas e a atual acompanham a cor do status da carga. */
.portal-timeline__passo.is-feita i,
.portal-timeline__passo.is-atual i { border-color: currentColor; background: currentColor; }
.portal-timeline__passo.is-feita::before,
.portal-timeline__passo.is-feita::after,
.portal-timeline__passo.is-atual::before { background: currentColor; }
.portal-timeline__passo.is-atual i {
  width: 14px; height: 14px;
  top: -1px;
  background: var(--panel);
  border-width: 3px;
}
.portal-timeline__passo.is-feita span,
.portal-timeline__passo.is-atual span { color: var(--text); }

.portal-timeline--aguardando   .is-feita, .portal-timeline--aguardando   .is-atual { color: #A78BFA; }
.portal-timeline--carregamento .is-feita, .portal-timeline--carregamento .is-atual { color: var(--signal); }
.portal-timeline--transito     .is-feita, .portal-timeline--transito     .is-atual { color: #60A5FA; }
.portal-timeline--saiu         .is-feita, .portal-timeline--saiu         .is-atual { color: #FFB020; }
.portal-timeline--entregue     .is-feita, .portal-timeline--entregue     .is-atual { color: var(--ok); }

/* ---------- Faixa institucional ---------- */
.portal-faixa {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #101922 0%, #0D1319 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-faixa__texto h2 {
  font-family: var(--f-display);
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: .55rem;
}
.portal-faixa__texto p { font-size: .8rem; color: var(--muted); line-height: 1.55; }

.portal-faixa__itens { list-style: none; display: flex; flex-direction: column; gap: .95rem; padding: 0; }
.portal-faixa__itens li { display: flex; gap: .7rem; align-items: center; }
.portal-faixa__icone {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex: none;
}
.portal-faixa__icone svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.portal-faixa__icone--azul    { background: rgba(96, 165, 250, .14); color: #60A5FA; }
.portal-faixa__icone--verde   { background: var(--ok-soft); color: var(--ok); }
.portal-faixa__icone--laranja { background: var(--signal-soft); color: var(--signal); }
.portal-faixa__itens b { display: block; font-size: .8rem; margin-bottom: .1rem; }
.portal-faixa__itens em { font-style: normal; font-size: .7rem; color: var(--muted); }

/* ---------- Rastreamento ---------- */
.portal-mapa {
  width: 100%;
  max-height: 230px;
  margin: .3rem 0 .9rem;
}
.portal-mapa--origem  { fill: rgba(96, 165, 250, .5); stroke: #60A5FA; }
.portal-mapa--destino { fill: rgba(255, 90, 31, .5);  stroke: var(--signal); }

.portal-rastreio { display: flex; gap: .5rem; }
.portal-rastreio input {
  flex: 1;
  min-width: 0;
  padding: .65rem .8rem;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: .8rem;
}
.portal-rastreio input:focus { outline: none; border-color: var(--signal); }
.portal-rastreio button {
  width: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--signal);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s var(--ease);
}
.portal-rastreio button:hover { background: #FF6F3C; }
.portal-rastreio button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }

.portal-rastreio__dica { font-size: .68rem; color: var(--muted); margin-top: .5rem; }
.portal-rastreio__erro {
  font-size: .74rem;
  color: #FF8555;
  margin-top: .6rem;
}
.portal-rastreio__achado {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: .7rem;
  padding: .7rem .8rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.portal-rastreio__achado b { display: block; font-size: .8rem; }
.portal-rastreio__achado span { font-size: .7rem; color: var(--muted); }

.portal-notificacoes { margin-top: .3rem; }
.notificacao-item__icone--laranja { background: var(--signal-soft); color: var(--signal); }
.notificacao-item__icone--roxo    { background: rgba(167, 139, 250, .14); color: #A78BFA; }

/* ---------- Ações rápidas ---------- */
.portal-acoes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-top: .3rem;
}
.portal-acao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .9rem .4rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}
.portal-acao svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.portal-acao.is-locked { opacity: .55; cursor: not-allowed; }

/* ---------- Rodapé ---------- */
.portal-rodape {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--line);
  font-size: .72rem;
  color: var(--muted);
}
.portal-rodape__marca { display: flex; align-items: center; gap: .5rem; }
.portal-rodape__marca svg { width: 22px; height: 18px; fill: none; stroke: var(--signal); stroke-width: 2; }
.portal-rodape__marca .peak { stroke: var(--signal); }
.portal-rodape__marca b {
  display: flex;
  flex-direction: column;
  font-family: var(--f-display);
  font-size: .8rem;
  line-height: 1;
  color: var(--text);
}
.portal-rodape__marca b small {
  font-family: var(--f-body);
  font-size: .48rem;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 500;
  margin-top: .15rem;
}
.portal-rodape__links { margin-left: auto; display: flex; gap: 1.2rem; }
.portal-rodape__links .is-locked { opacity: .6; cursor: not-allowed; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .portal-carga__topo { grid-template-columns: 40px 1fr; row-gap: .8rem; }
  .portal-carga__rota,
  .portal-carga__status { grid-column: 1 / -1; }
  .portal-timeline { grid-template-columns: repeat(3, 1fr); row-gap: 1rem; }
  .portal-faixa { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .portal-cards { grid-template-columns: 1fr; }
  .portal-acoes { grid-template-columns: repeat(2, 1fr); }
  .portal-timeline { grid-template-columns: repeat(2, 1fr); }
  .portal-topbar__user-info { display: none; }
  .portal-rodape { flex-direction: column; align-items: flex-start; gap: .7rem; }
  .portal-rodape__links { margin-left: 0; }
}

/* =============================================================
 | CADASTRO DE ACESSO AO PORTAL
 |
 | Formulário público (portal/cadastro) e gestão dos acessos na
 | tela interna do cliente (clientes/{id}).
 ============================================================= */

/* Dicas e marcações auxiliares de campo */
.field__dica {
  color: var(--muted);
  font-size: .72rem;
  margin-top: .35rem;
}
.field__opcional {
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Aviso de moderação no formulário público */
.auth__aviso {
  padding: .8rem .9rem;
  margin-bottom: 1.1rem;
  background: rgba(255, 176, 32, .08);
  border: 1px solid rgba(255, 176, 32, .25);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}

/* "Já tem acesso? Entrar" / "Criar agora" */
.auth__alternativa {
  margin-top: 1.1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--muted);
}
.auth__alternativa a { color: var(--signal); text-decoration: none; }
.auth__alternativa a:hover { text-decoration: underline; }

/* Tela de confirmação depois do cadastro */
.auth__box--centro { text-align: center; }
.auth__box--centro .auth__lead { margin-bottom: 1rem; }
.auth__box--centro .btn { margin-top: .6rem; }

.auth__icone-ok {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}
.auth__icone-ok svg {
  width: 26px; height: 26px;
  fill: none; stroke: currentColor; stroke-width: 2.2;
}

/* Bloco "Criar acesso para este cliente" (recolhido por padrão) */
.acesso-novo summary {
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: var(--signal);
  padding: .5rem 0;
  list-style: none;
}
.acesso-novo summary::-webkit-details-marker { display: none; }
.acesso-novo summary::before {
  content: '+ ';
  font-family: var(--f-mono);
}
.acesso-novo[open] summary::before { content: '− '; }
.acesso-novo[open] summary { margin-bottom: .9rem; }

/* Painel de cadastros pendentes na listagem de clientes */
.pendentes-painel {
  margin-bottom: 1.5rem;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid rgba(255, 176, 32, .3);
  border-radius: var(--radius);
}
.pendentes-painel__topo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3rem .7rem;
  align-items: center;
  margin-bottom: 1rem;
}
.pendentes-painel__topo svg {
  grid-row: span 2;
  width: 20px; height: 20px;
  fill: none; stroke: #FFB020; stroke-width: 1.8;
}
.pendentes-painel__topo b { font-size: .9rem; color: #FFB020; }
.pendentes-painel__topo span { font-size: .76rem; color: var(--muted); line-height: 1.45; }
.pendentes-painel .table-wrap { margin-bottom: 0; }
.pendentes-painel .badge { margin-left: .4rem; }

/* Aviso de acesso pendente/suspenso no login do portal — informativo,
   não é erro de credencial, então não usa o vermelho de .auth__error */
.auth__aviso--destaque {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.2rem;
  text-align: left;
}
.auth__aviso--destaque::before {
  content: 'i';
  flex: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255, 176, 32, .25);
  color: #FFB020;
  font-family: var(--f-mono);
  font-size: .7rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  margin-top: .1rem;
}

/* =============================================================
 | PORTAL DO CLIENTE — telas completas
 |
 | Minhas entregas, detalhe, rastreamento, comprovantes, faturas,
 | histórico, suporte, notificações e meus dados. Reaproveita
 | .filtro-bar, .paginacao, .table-wrap e .panel do sistema interno.
 ============================================================= */

/* Links que antes eram inertes (módulos travados) agora navegam */
a.portal-link-inerte:hover { text-decoration: underline; }
a.portal-link-inerte--botao { text-decoration: none; }
a.portal-link-inerte--botao:hover { border-color: var(--muted); text-decoration: none; }
a.portal-ajuda__botao { text-decoration: none; transition: background .2s var(--ease); }
a.portal-ajuda__botao:hover { background: #FF6F3C; }
a.portal-acao { text-decoration: none; transition: border-color .2s var(--ease), color .2s var(--ease); }
a.portal-acao:hover { border-color: var(--signal); color: var(--text); }
a.portal-topbar__item { text-decoration: none; transition: color .2s var(--ease); }
a.portal-topbar__item:hover,
a.portal-topbar__sino:hover { color: var(--text); }
.portal-topbar__perfil {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: inherit;
  text-decoration: none;
}
.portal-topbar__perfil:hover b { color: var(--signal); }
a.portal-rastreio__achado { color: inherit; text-decoration: none; transition: border-color .2s var(--ease); }
a.portal-rastreio__achado:hover { border-color: var(--signal); }

/* Cabeçalho de página com botão à direita */
.portal-hello--acao {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.portal-carga__codigo { color: var(--text); text-decoration: none; }
.portal-carga__codigo:hover { color: var(--signal); }

/* ---------- Abas de situação ---------- */
.portal-abas {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.1rem;
}
.portal-aba {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .85rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.portal-aba .mono { font-size: .7rem; opacity: .8; }
.portal-aba:hover { color: var(--text); border-color: var(--muted); }
.portal-aba.is-active {
  background: var(--signal-soft);
  border-color: var(--signal);
  color: var(--signal);
}

/* ---------- Pares rótulo/valor ---------- */
.portal-dados {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: .3rem 0 0;
}
.portal-dados--coluna { grid-template-columns: 1fr; }
.portal-dados dt {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.portal-dados dd { margin: 0; font-size: .88rem; line-height: 1.45; word-break: break-word; }
.portal-dados__largo { grid-column: 1 / -1; }

.portal-botoes { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }

.portal-nota {
  margin-top: 1rem;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--muted);
}
.portal-nota a { color: var(--signal); }

/* ---------- Marcos (acompanhamento vertical) ---------- */
.portal-marcos { list-style: none; margin: .3rem 0 0; padding: 0; }
.portal-marco {
  position: relative;
  display: flex;
  gap: .85rem;
  padding-bottom: 1.2rem;
}
.portal-marco:last-child { padding-bottom: 0; }
.portal-marco::before {
  content: '';
  position: absolute;
  left: 5px; top: 14px; bottom: 0;
  width: 2px;
  background: var(--line-2);
}
.portal-marco:last-child::before { display: none; }
.portal-marco i {
  flex: none;
  width: 12px; height: 12px;
  margin-top: .22rem;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--panel);
  position: relative;
  z-index: 1;
}
.portal-marco.is-feito i { background: var(--ok); border-color: var(--ok); }
.portal-marco.is-feito::before { background: var(--ok); opacity: .45; }
.portal-marco b { display: block; font-size: .84rem; margin-bottom: .15rem; }
.portal-marco:not(.is-feito) b { color: var(--muted); }
.portal-marco span { display: block; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.portal-marco time { display: block; margin-top: .25rem; font-size: .68rem; color: var(--muted); }

/* ---------- Rastreamento ---------- */
.portal-rastreio__rota {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-wrap: wrap;
  margin: .3rem 0 1rem;
  font-size: .9rem;
}
.portal-rastreio__rota svg { width: 22px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; }

.portal-progresso { margin: .4rem 0 .9rem; }
.portal-progresso__barra {
  height: 6px;
  border-radius: 3px;
  background: var(--line-2);
  overflow: hidden;
}
.portal-progresso__barra i {
  display: block;
  height: 100%;
  background: var(--signal);
  border-radius: 3px;
}
.portal-progresso span { display: block; margin-top: .4rem; font-size: .68rem; color: var(--muted); }

.portal-lista-rastreio { list-style: none; margin: 0; padding: 0; }
.portal-lista-rastreio li + li { border-top: 1px solid var(--line); }
.portal-lista-rastreio a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem .2rem;
  color: inherit;
  text-decoration: none;
}
.portal-lista-rastreio a:hover b { color: var(--signal); }
.portal-lista-rastreio b { display: block; font-size: .84rem; margin-bottom: .15rem; }
.portal-lista-rastreio span:not(.portal-badge) { font-size: .74rem; color: var(--muted); }

.portal-legenda { display: flex; gap: 1.2rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: .74rem; color: var(--muted); }
.portal-legenda li { display: flex; align-items: center; gap: .4rem; }
.portal-legenda__ponto { width: 10px; height: 10px; border-radius: 2px; border: 1px solid; display: inline-block; }
.portal-legenda__ponto--origem  { background: rgba(96, 165, 250, .5); border-color: #60A5FA; }
.portal-legenda__ponto--destino { background: rgba(255, 90, 31, .5); border-color: var(--signal); }

/* ---------- Faturas e prazo ---------- */
.portal-badge--fatura-aberta  { background: rgba(96, 165, 250, .16); color: #60A5FA; }
.portal-badge--fatura-vencida { background: var(--signal-soft); color: var(--signal); }
.portal-badge--fatura-paga    { background: var(--ok-soft); color: var(--ok); }

.portal-prazo { font-size: .8rem; color: var(--muted); }
.portal-prazo--ok { color: var(--ok); }
.portal-prazo--atraso { color: #FFB020; }

/* ---------- Formulários do portal ---------- */
.portal-form { max-width: 46rem; }
.portal-form .field select { width: 100%; }
.portal-form textarea { width: 100%; resize: vertical; }
.portal-form input:disabled { opacity: .6; cursor: not-allowed; }
.portal-grid .portal-form { max-width: none; }

/* ---------- Conversa de chamado (portal e sistema interno) ---------- */
.chamado-conversa { display: flex; flex-direction: column; gap: .9rem; margin-top: .4rem; }
.chamado-msg {
  max-width: 85%;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.chamado-msg--equipe { align-self: flex-start; border-left: 3px solid var(--signal); }
.chamado-msg--cliente { align-self: flex-end; border-right: 3px solid #60A5FA; }
.chamado-msg__topo { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.chamado-msg__topo b { font-size: .82rem; }
.chamado-msg__topo span { font-size: .7rem; color: var(--muted); }
.chamado-msg__topo time { margin-left: auto; font-size: .68rem; color: var(--muted); }
.chamado-msg p { font-size: .86rem; line-height: 1.6; word-break: break-word; }

/* ---------- Notificações ---------- */
.notificacao-item__icone--azul { background: rgba(96, 165, 250, .14); color: #60A5FA; }
.notificacao-item__link { color: inherit; text-decoration: none; }
.notificacao-item__link:hover b { color: var(--signal); }

@media (max-width: 900px) {
  .portal-dados { grid-template-columns: 1fr; }
  .chamado-msg { max-width: 100%; }
}

/* =============================================================
   SIMULADOR DE FRETE — grade da tabela de preços (UF × faixa)
   ============================================================= */
.frete-scroll { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); }
.frete-grid { width: 100%; border-collapse: collapse; min-width: 640px; }
.frete-grid th,
.frete-grid td { padding: .4rem .5rem; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.frete-grid thead th { font-size: .72rem; color: var(--muted); font-weight: 500; }
.frete-grid input {
  width: 100%;
  min-width: 4.2rem;
  background: var(--ink);
  color: inherit;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: .45rem .55rem;
  font-size: .85rem;
  font-family: inherit;
}
.frete-grid input:focus { outline: none; border-color: var(--signal); }
.frete-grid input::placeholder { color: var(--muted); opacity: .7; }
.frete-grid tr.has-error td { background: rgba(255, 133, 85, .08); }

/* =============================================================
   MODAL — cadastro rápido de cliente na tela de entregas
   ============================================================= */
.link-acao {
  background: none;
  border: 0;
  padding: 0;
  margin-left: .6rem;
  color: var(--signal);
  font-size: .78rem;
  cursor: pointer;
  text-decoration: underline;
}
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal__fundo { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.modal__caixa {
  position: relative;
  width: 100%;
  max-width: 28rem;
  max-height: 100%;
  overflow-y: auto;
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.modal__caixa h2 { margin-bottom: .25rem; }
.modal__sub { color: var(--muted); font-size: .85rem; margin-bottom: 1.25rem; }
.field__error:empty { display: none; }

/* =============================================================
   BALCÃO — atendimento na recepção, pagamento e caixa
   ============================================================= */
.badge--ativo     { background: var(--ok-soft); color: var(--ok); }
.badge--pago      { background: var(--ok-soft); color: var(--ok); }
.badge--cancelado { background: rgba(232, 237, 242, .07); color: rgba(140, 160, 179, .7); }

.balcao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.balcao-grid .form-panel { max-width: none; }

.balcao-rotulo {
  display: block;
  font-family: var(--f-mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: .3rem;
}

.balcao-cliente {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.4rem;
}
.balcao-cliente > div { display: flex; flex-direction: column; gap: .15rem; }
.balcao-cliente b { font-size: 1.05rem; }
.balcao-cliente .badge { align-self: flex-start; margin-top: .25rem; }
.balcao-cliente__portal { max-width: 26rem; }

.balcao-inline { display: flex; gap: .5rem; align-items: center; }
.balcao-inline input {
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  padding: .5rem .7rem;
  font: inherit;
  font-size: .85rem;
  min-width: 14rem;
}

.balcao-senha__dados {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin: .6rem 0 .4rem;
}
.balcao-senha__dados b { font-size: 1rem; }

.balcao-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line-2);
  font-family: var(--f-mono);
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--muted);
}
.balcao-total b { font-size: 1.9rem; color: var(--text); font-weight: 500; }

.balcao-formas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.balcao-forma { cursor: pointer; }
.balcao-forma input { position: absolute; opacity: 0; pointer-events: none; }
.balcao-forma span {
  display: block;
  text-align: center;
  padding: .85rem .6rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9rem;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.balcao-forma input:checked + span { border-color: var(--signal); background: var(--signal-soft); color: var(--text); }
.balcao-forma input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.balcao-troco { font-size: 1.35rem; font-weight: 500; padding: .55rem 0; color: var(--ok); }
.balcao-troco.is-falta { color: #FF8555; }

.balcao-acoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.balcao-acoes > div:first-child { display: flex; flex-direction: column; gap: .2rem; }
.balcao-acoes__botoes { display: flex; gap: .6rem; flex-wrap: wrap; }

@media (max-width: 900px) {
  .balcao-grid { grid-template-columns: 1fr; }
  .balcao-inline { flex-wrap: wrap; }
  .balcao-inline input { min-width: 0; width: 100%; }
}

/* Relatório de caixa impresso pela própria tela do sistema */
@media print {
  .sidebar, .topbar, .nao-imprimir, .status-bar { display: none !important; }
  html, body, .main, .content { background: #fff !important; color: #000 !important; }
  .form-panel, .table-wrap { background: #fff !important; border-color: #999 !important; }
  .balcao-grid { grid-template-columns: 1fr 1fr; }
  .stat-card, td, th, h1, h2, p, span, b, strong { color: #000 !important; }
}

/* =============================================================
 | SUPER ADMIN — Central técnica (visão geral, banco de dados, IA)
 |
 | Só o perfil superadmin (suporte WS) chega aqui. Reaproveita
 | .panel, .stat-card, .table-wrap, .badge e .alert; o que segue
 | é só o que essas telas têm de próprio.
 ============================================================= */
.sa-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
.sa-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
.sa-pilha { display: grid; gap: 1.25rem; }
.sa-secao { margin-bottom: 1.25rem; }
.sa-secao .panel-head { gap: .75rem; flex-wrap: wrap; }
.panel .sa-texto { margin-bottom: 1rem; }

.sa-badge--ok    { background: var(--ok-soft); color: var(--ok); }
.sa-badge--alerta { background: rgba(255, 176, 32, .13); color: #FFB020; }
.sa-badge--neutro { background: rgba(140, 160, 179, .16); color: var(--muted); }

/* Lista de verificações (✓ / !) */
.sa-checklist { display: grid; gap: .1rem; }
.sa-checklist li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line); }
.sa-checklist li:first-child { border-top: 0; }
.sa-checklist svg { flex: none; width: 18px; height: 18px; margin-top: .1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.sa-checklist .is-ok svg { color: var(--ok); }
.sa-checklist .is-falha svg { color: #FFB020; }
.sa-checklist b { font-weight: 500; font-size: .88rem; }
.sa-checklist small { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }

/* Pares rótulo → valor */
.sa-pares li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .85rem; }
.sa-pares li:first-child { border-top: 0; }
.sa-pares span { color: var(--muted); }
.sa-pares b { font-family: var(--f-mono); font-weight: 500; text-align: right; word-break: break-word; }

/* Pendências da estrutura */
.sa-pendencia { margin-bottom: .6rem; padding: .7rem .9rem; border-radius: var(--radius); background: rgba(255, 176, 32, .08); border: 1px solid rgba(255, 176, 32, .3); font-size: .84rem; }
.sa-pendencia code, .sa-code { font-family: var(--f-mono); font-size: .78rem; color: var(--text); word-break: break-word; }

/* Linhas de ação com campos inline */
.sa-acoes { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.sa-acoes form { display: inline-flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sa-input {
  background: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: .55rem .75rem;
  font-size: .85rem;
  min-width: 0;
}
.sa-input:focus { outline: none; border-color: var(--signal); }
.sa-input--dias { width: 5.5rem; }
.sa-input--confirmar { width: 9rem; font-family: var(--f-mono); text-transform: uppercase; }
.sa-input--senha { width: 12rem; }

.sa-operacao { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .95rem 0; border-top: 1px solid var(--line); }
.sa-operacao:first-of-type { border-top: 0; }
.sa-operacao strong { display: block; font-size: .9rem; font-weight: 600; }
.sa-operacao small { color: var(--muted); font-size: .78rem; }

.sa-console {
  margin-top: 1rem;
  padding: .9rem 1rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: .76rem;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 18rem;
  overflow: auto;
}

/* Interruptor (checkbox) */
.sa-interruptor { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1.1rem; cursor: pointer; }
.sa-interruptor input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--signal); }
.sa-interruptor small { display: block; color: var(--muted); font-size: .76rem; }

/* Barras de uso mensal da IA */
.sa-barras { display: flex; align-items: flex-end; gap: .5rem; height: 110px; padding-top: .5rem; }
.sa-barras span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .35rem; }
.sa-barras i { display: block; width: 100%; max-width: 2.2rem; background: var(--signal); border-radius: 4px 4px 0 0; min-height: 2px; }
.sa-barras i.is-zero { background: var(--line-2); }
.sa-barras em { font-style: normal; font-family: var(--f-mono); font-size: .64rem; color: var(--muted); }

.sa-progresso { height: 6px; border-radius: 999px; background: var(--line); margin-top: .55rem; overflow: hidden; }
.sa-progresso i { display: block; height: 100%; background: var(--signal); }

.sa-perigo { border-color: rgba(255, 90, 31, .35); }

@media (max-width: 1100px) {
  .sa-grid, .sa-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sa-operacao { grid-template-columns: 1fr; }
}

/* =============================================================
   ABAS (Lixeira, Configurações) — links, sem JavaScript
   ============================================================= */
.abas {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.abas__item {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  font-size: .84rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.abas__item:hover { color: var(--text); }
.abas__item.is-active { color: var(--text); border-bottom-color: var(--signal); }
.abas__contagem {
  font-family: var(--f-mono);
  font-size: .72rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: rgba(232, 237, 242, .07);
  color: var(--muted);
}
.abas__item.is-active .abas__contagem { background: var(--signal-soft); color: var(--signal); }
