/* ================================================================
   TEMA AZUL DISTRIBUIDORA — carregado depois do app.css.
   Troca as cores da base (laranja) pelo padrão ERP² (menu escuro, azul)
   e traz os componentes das telas de rota, painel e rodapé com versão.
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;600;700&display=swap');

:root {
  --brand: #1463d6;
  --brand-dark: #0d4aa8;
  --brand-soft: #e3f2fd;
  --brand-rgb: 20, 99, 214;
  --ink: #101828;
  --muted: #5b6475;
  --page: #f3f5f9;
  --border: #e4e7ec;
  --radius: 10px;

  --sidebar-bg: #0b1437;
  --sidebar-brand-color: #ffffff;
  --sidebar-brand-muted: #b9c4e6;
  --sidebar-nav-color: #e6ebfa;
  --sidebar-nav-hover-bg: #1a2752;
  --sidebar-nav-hover-color: #ffffff;
  --sidebar-nav-active-bg: #1463d6;
  --sidebar-nav-active-color: #ffffff;
  --sidebar-nav-active-shadow: none;
  --sidebar-section-color: #9aa7cf;
  --sidebar-panel-border: 0;
  --sidebar-panel-shadow: none;
  --sidebar-brand-logo-bg: transparent;

  /* Rodapé padrão Erenhatec */
  --sidebar-width: 268px;
  --cl-azul: #0a6ed1;
  --cl-azul-claro: #e3f2fd;
  --cl-topo: #0b1437;
}
body { font-family: 'Fira Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.page-header h1 { font-family: inherit; font-weight: 600; }
.breadcrumb-small { color: var(--brand-dark); font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Menu lateral ---------- */
.sidebar-brand img { width: 40px; height: 40px; padding: 0; border-radius: 50%; box-shadow: none; }
.sidebar-brand strong { font-size: 1.5rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.sidebar-brand small { font-size: .62rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; margin-top: 3px; }
.sidebar-nav .nav-item { font-weight: 500; font-size: .97rem; min-height: 44px; border-radius: 8px; }
.sidebar-nav .nav-item.active { font-weight: 600; }
.nav-section { font-weight: 600; font-size: .69rem; }
.mobile-sidebar .btn-close { filter: invert(1); }

/* ---------- Cartões de indicador ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-card span { color: #3d4657; }
.kpi-card strong { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-card small { color: var(--muted); }
.kpi-verde { border-left-color: #17803d; }
.kpi-roxo { border-left-color: #6b3fc4; }
.kpi-laranja { border-left-color: #c2570c; }

.sec-title { display: flex; align-items: center; gap: 12px; font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #3d4657; margin: 0 0 10px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: #d9dde5; }

/* ---------- Cartão de rota (visão geral) ---------- */
.rota-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-left: 4px solid #c2570c; border-radius: var(--radius); padding: 14px 20px; margin-bottom: 10px; color: var(--ink); transition: box-shadow .15s; }
.rota-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); color: var(--ink); }
.rota-card.ok { border-left-color: #17803d; }
.rota-card .linha1 { display: flex; align-items: center; gap: 10px; color: #3d4657; font-size: .9rem; }
.rota-card .nome { font-size: 1.05rem; font-weight: 600; }
.rota-card .sub { color: #3d4657; font-size: .9rem; }
.rota-card .valor { text-align: right; }
.rota-card .valor strong { display: block; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.rota-card .valor small { color: var(--muted); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.tag-ok { background: #e6f4ea; color: #17602f; }
.tag-warn { background: #fdecd8; color: #8a4500; }
.tag-mute { background: #eef0f4; color: #3d4657; }

.aviso-revisar { display: flex; gap: 10px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); background: #fdecd8; color: #5c2f00; line-height: 1.45; }

.resumo-lista { list-style: none; margin: 0; padding: 0; }
.resumo-lista li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #eef0f4; }
.resumo-lista li:first-child { border-top: 0; padding-top: 0; }

.mes-nav { display: flex; align-items: center; gap: 8px; color: #3d4657; font-size: 1.05rem; }
.mes-nav a { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--brand-dark); }
.mes-nav a:hover { background: var(--brand-soft); }

/* ---------- Relatório de rota de carga ---------- */
.sec-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.sec-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; margin: 0 0 16px; }
.sec-card h2 .n { width: 26px; height: 26px; border-radius: 50%; background: #0b1437; color: #fff; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.calc, .form-control.calc { background: #f1f3f7; color: #3d4657; font-variant-numeric: tabular-nums; }
.linhas-tabela td { padding: 4px 6px 4px 0; vertical-align: middle; }
.linhas-tabela th { font-size: .78rem; font-weight: 600; color: #3d4657; padding: 0 6px 4px 0; }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ind { padding: 12px 14px; border-radius: 8px; background: #f1f3f7; }
.ind small { display: block; color: #3d4657; }
.ind strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.assinaturas { display: none; }

/* ---------- Rodapé padrão Erenhatec (versão + novidades) ---------- */
.app-footer { position: sticky; bottom: 0; z-index: 20; height: 28px; padding: 0 24px; align-items: center; font-size: 11px; line-height: 1; }
.app-footer .ver-btn { background: none; border: 0; padding: 3px 8px; border-radius: 12px; color: inherit; font: inherit; letter-spacing: .03em; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: background .15s, color .15s; }
.app-footer .ver-btn:hover, .app-footer .ver-btn:focus-visible { background: var(--cl-azul-claro); color: var(--cl-azul); outline: 0; }
.app-footer .ver-btn svg { width: 11px; height: 11px; fill: currentColor; opacity: .7; }

.cl-fundo { position: fixed; inset: 0; z-index: 1060; background: rgba(16,24,40,.45); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; animation: clFade .2s ease; }
.cl-modal { width: 100%; max-width: 800px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); font-size: 14px; color: #1d2939; }
.cl-modal-topo { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: var(--cl-topo); color: #fff; }
.cl-modal-topo h5 { margin: 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.cl-modal-topo svg { width: 18px; height: 18px; fill: currentColor; }
.cl-fechar { margin-left: auto; background: none; border: 0; color: #fff; opacity: .8; cursor: pointer; padding: 4px; line-height: 0; }
.cl-fechar:hover { opacity: 1; }
.cl-fechar svg { width: 16px; height: 16px; }
.cl-corpo { overflow-y: auto; padding: 4px 18px 14px; }
.cl-ver { padding: 14px 4px 10px; border-bottom: 1px solid #eaecf0; }
.cl-ver:last-child { border-bottom: 0; }
.cl-ver:not(.atual) { opacity: .85; }
.cl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-num { font-weight: 800; font-size: 15px; }
.cl-ver.atual .cl-num { color: var(--cl-azul); }
.cl-tag { font-size: 11px; font-weight: 700; background: var(--cl-azul-claro); color: var(--cl-azul); border-radius: 10px; padding: 2px 9px; }
.cl-data { margin-left: auto; font-size: 12px; color: #667085; }
.cl-tit { font-weight: 600; margin: 4px 0 6px; }
.cl-ver ul { margin: 0; padding-left: 20px; }
.cl-ver li { margin: 3px 0; line-height: 1.45; font-size: 13px; }

.cl-aviso { position: fixed; left: calc(var(--sidebar-width, 0px) + 16px); bottom: 44px; z-index: 1050; display: flex; gap: 12px; align-items: flex-start; max-width: 380px; padding: 12px 36px 12px 14px; background: #fff; border: 1px solid #bbdefb; border-left: 4px solid var(--cl-azul); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.18); animation: clIn .35s ease; font-size: 12.5px; }
.cl-aviso-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--cl-azul-claro); color: var(--cl-azul); display: flex; align-items: center; justify-content: center; flex: none; }
.cl-aviso-ic svg { width: 15px; height: 15px; fill: currentColor; }
.cl-aviso-txt { display: flex; flex-direction: column; gap: 2px; color: #667085; }
.cl-aviso-txt b { font-size: 13.5px; color: #1d2939; }
.cl-aviso-ver { align-self: flex-start; margin-top: 6px; background: var(--cl-azul); color: #fff; border: 0; border-radius: 7px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cl-aviso-ver:hover { background: #0854a0; }
.cl-aviso-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 20px; line-height: 1; color: #667085; cursor: pointer; padding: 2px 6px; }

@keyframes clIn { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes clFade { from { opacity: 0 } to { opacity: 1 } }

@media (max-width: 991.98px) {
  .cl-aviso { left: 12px; right: 12px; bottom: 40px; max-width: none; }
}
@media (max-width: 767.98px) {
  .app-footer { flex-direction: row; height: 28px; }
  .rota-card .valor { text-align: left; }
}
@media print {
  .cl-aviso, .cl-fundo, .toast-container { display: none !important; }
  body { background: #fff; }
  .sec-card { border: 1px solid #999; break-inside: avoid; margin-bottom: 10px; padding: 12px; }
  .form-control, .form-select { border: 0 !important; border-bottom: 1px solid #999 !important; border-radius: 0; min-height: 0; padding: 2px 4px; background: transparent !important; }
  .assinaturas { display: flex; gap: 48px; margin-top: 48px; }
  .assinaturas div { flex: 1; border-top: 1px solid #000; padding-top: 6px; text-align: center; font-size: .85rem; }
}
