/* ============================================================
   Prioriza Despachante — interface
   Identidade: dourado #F8C25A + grafite (da logo)
   ============================================================ */
@font-face {
  font-family: 'Inter';
  src: url('/static/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f5f3;
  --card: #ffffff;
  --texto: #17181b;
  --suave: #5f636b;
  --fraco: #8d9199;
  --borda: #e6e5e1;
  --borda-forte: #d3d1cb;
  --ouro: #f8c25a;
  --ouro-esc: #eeaf35;
  --ouro-claro: #fdf3dc;
  --sobre-ouro: #1b1508;
  --link: #94600a;
  --link-esc: #6f4705;
  --grafite: #111215;
  --grafite-2: #1c1e23;
  --ok: #157347;  --ok-bg: #e7f6ee;
  --alerta: #8f5300; --alerta-bg: #fff2d9;
  --erro: #b42318; --erro-bg: #fdeceb;
  --info: #1d4ed8; --info-bg: #eaf1ff;
  --zap: #1fa855; --zap-esc: #178a45;
  --raio: 12px;
  --raio-p: 8px;
  --sombra: 0 1px 2px rgba(17, 18, 21, .04), 0 1px 3px rgba(17, 18, 21, .06);
  --largura: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013; --card: #17191d; --texto: #ececea; --suave: #a3a6ad; --fraco: #7b7f87;
    --borda: #26282e; --borda-forte: #33363d;
    --ouro-claro: #2a2414; --link: #f8c25a; --link-esc: #ffd685;
    --grafite: #0a0b0d; --grafite-2: #16181c;
    --ok: #4cc38a; --ok-bg: #12301f; --alerta: #f0b44c; --alerta-bg: #33270f;
    --erro: #f3857a; --erro-bg: #3a1a17; --info: #7aa2ff; --info-bg: #172640;
    --sombra: 0 1px 2px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--texto); -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; font-weight: 550; }
a:hover { color: var(--link-esc); text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0 0 1.1rem; }
h2 { font-size: 1.05rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 .9rem; }
p { margin: 0 0 .75rem; }
strong { font-weight: 650; }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- estrutura (padrão do painel da TV: menu lateral) ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.shell.sem-lateral { grid-template-columns: minmax(0, 1fr); }
html, body { overflow-x: clip; }
.sidebar {
  display: flex; flex-direction: column; gap: 1.6rem; padding: 1.4rem 1rem 1.1rem;
  background: var(--grafite); color: #e7e7e5; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid #000; min-width: 0;
}
.brand { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; padding-bottom: 1.2rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand:hover { text-decoration: none; }
.brand img { width: 150px; height: auto; display: block; }
.brand small { color: rgba(255,255,255,.5); font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a { display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 8px; color: rgba(255,255,255,.74); font-weight: 500; font-size: .93rem; }
.menu a .ico { width: 18px; height: 18px; opacity: .8; }
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.menu a.ativo { background: rgba(248,194,90,.16); color: var(--ouro); font-weight: 650; }
.menu a.ativo .ico { opacity: 1; }
.me { margin: auto 0 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: .75rem; font-size: .88rem; }
.me-id { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.me-id > div { min-width: 0; }
.me-id strong { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-id small { display: block; color: rgba(255,255,255,.5); font-size: .76rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ouro); color: var(--sobre-ouro); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.me-acoes { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.me-acoes a, .me-acoes .btn-link { color: rgba(255,255,255,.62); font-weight: 500; font-size: .84rem; display: inline-flex; align-items: center; gap: .35rem; }
.me-acoes a:hover, .me-acoes .btn-link:hover { color: var(--ouro); text-decoration: none; }
.me-acoes .ico { width: 16px; height: 16px; }
.topo { background: var(--grafite); border-bottom: 2px solid var(--ouro); padding: .7rem 16px; display: flex; justify-content: center; }
.brand-topo { display: flex; align-items: center; gap: .6rem; }
.brand-topo img:first-child { height: 32px; width: auto; }
.brand-topo img:last-child { height: 30px; width: auto; }
.principal { display: flex; flex-direction: column; min-width: 0; }

/* ---------- conteúdo ---------- */
.conteudo { width: 100%; max-width: 1240px; padding: 1.9rem 2.2rem 3rem; flex: 1; }
.shell.sem-lateral .conteudo { margin: 0 auto; max-width: 1100px; }
.rodape { border-top: 1px solid var(--borda); color: var(--fraco); font-size: .8rem; padding: 1rem 2.2rem; display: flex; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.4rem; margin-bottom: 1.25rem; box-shadow: var(--sombra); }
.card > h2:first-child { padding-bottom: .85rem; border-bottom: 1px solid var(--borda); margin-bottom: 1.1rem; }
.grade { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 1.25rem; }
.grade-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); margin-bottom: 1.25rem; }
.grade-2 > .card { margin-bottom: 0; }

.kpi { background: var(--card); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.1rem 1.25rem; box-shadow: var(--sombra); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--ouro); }
.kpi .rot { color: var(--suave); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.kpi .val { font-size: 1.9rem; font-weight: 750; letter-spacing: -.025em; margin-top: .35rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--suave); font-size: .82rem; margin-top: .3rem; }

.barra { height: 6px; background: var(--borda); border-radius: 99px; overflow: hidden; margin-top: .6rem; }
.barra > span { display: block; height: 100%; background: var(--ouro-esc); border-radius: 99px; }

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; margin: 0 -1.4rem; padding: 0 1.4rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--borda); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fraco); font-weight: 650; border-bottom-color: var(--borda-forte); }
tbody tr:hover td { background: color-mix(in srgb, var(--bg) 70%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.vazio { color: var(--suave); text-align: center; padding: 2.25rem 1rem; }

/* ---------- placa (padrão Mercosul) ---------- */
.placa-chip {
  display: inline-flex; flex-direction: column; min-width: 94px; vertical-align: middle;
  border: 1.5px solid #1b2433; border-radius: 5px; background: #fff; color: #111; overflow: hidden;
  font: 700 .9rem/1 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: .08em; text-align: center;
}
.placa-chip::before { content: 'BRASIL'; display: block; background: #1b4fb8; color: #fff; font: 700 .45rem/1 'Inter', sans-serif; letter-spacing: .25em; padding: 2px 0; }
.placa-chip > span { padding: .28rem .5rem .3rem; }
.placa-chip.grande { min-width: 196px; font-size: 1.8rem; border-width: 2.5px; border-radius: 8px; }
.placa-chip.grande::before { font-size: .62rem; padding: 4px 0; }
.placa-chip.grande > span { padding: .45rem .9rem .5rem; }

/* ---------- etiquetas ---------- */
.tag { display: inline-flex; align-items: center; gap: .38rem; font-size: .76rem; font-weight: 600; padding: .2rem .62rem; border-radius: 99px; white-space: nowrap; line-height: 1.4; }
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-alerta { background: var(--alerta-bg); color: var(--alerta); }
.tag-erro { background: var(--erro-bg); color: var(--erro); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-neutro { background: var(--bg); color: var(--suave); border: 1px solid var(--borda); }
.tag-neutro::before { display: none; }

/* ---------- avisos ---------- */
.flash { padding: .85rem 1rem; border-radius: var(--raio-p); margin-bottom: 1.25rem; border: 1px solid transparent; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.flash-erro { background: var(--erro-bg); color: var(--erro); border-color: color-mix(in srgb, var(--erro) 22%, transparent); }

/* ---------- formulários ---------- */
form.linha { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
label { display: block; font-size: .84rem; font-weight: 550; color: var(--texto); margin-bottom: .35rem; }
.campo { margin-bottom: 1rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--texto); background: var(--card);
  border: 1px solid var(--borda-forte); border-radius: var(--raio-p); padding: .62rem .8rem;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--fraco); }
input:hover, select:hover, textarea:hover { border-color: var(--fraco); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ouro-esc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ouro) 35%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--ouro-esc); }
input.placa {
  font: 700 1.6rem/1 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .14em; text-align: center;
  max-width: 260px; color: #111; background: #fff; padding: .75rem .8rem .6rem;
  border: 2.5px solid #1b2433; border-top: 14px solid #1b4fb8; border-radius: 8px;
}
input.placa::placeholder { color: #c2c5cb; }
input.placa:hover, input.placa:focus { border-color: #1b2433; border-top-color: #1b4fb8; }

button, .btn {
  font: inherit; font-size: .92rem; font-weight: 650; border: 1px solid transparent; border-radius: var(--raio-p);
  padding: .62rem 1.1rem; cursor: pointer; background: var(--ouro); color: var(--sobre-ouro); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; line-height: 1.2; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .05s;
}
button:hover, .btn:hover { background: var(--ouro-esc); color: var(--sobre-ouro); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--ouro-esc) 55%, transparent); outline-offset: 2px; }
.btn-sec { background: var(--card); color: var(--texto); border-color: var(--borda-forte); }
.btn-sec:hover { background: var(--bg); color: var(--texto); border-color: var(--fraco); }
.btn-escuro { background: var(--grafite); color: #fff; }
.btn-escuro:hover { background: var(--grafite-2); color: #fff; }
.btn-perigo { background: var(--erro); color: #fff; }
.btn-perigo:hover { background: color-mix(in srgb, var(--erro) 85%, #000); color: #fff; }
.btn-zap { background: var(--zap); color: #fff; }
.btn-zap:hover { background: var(--zap-esc); color: #fff; }
.btn-link { background: none; color: var(--link); padding: 0; font-weight: 550; border: 0; }
.btn-link:hover { background: none; color: var(--link-esc); text-decoration: underline; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- consulta ---------- */
.resultado {
  white-space: pre-wrap; font: 14.5px/1.7 'Inter', system-ui, sans-serif; color: var(--texto);
  background: var(--bg); border: 1px solid var(--borda); border-left: 3px solid var(--ouro); border-radius: var(--raio-p); padding: 1.1rem 1.25rem; overflow-x: auto;
}
.cab-consulta { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.cab-consulta .sobre { font-size: .74rem; color: var(--suave); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .55rem; }
.cab-consulta .id { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cab-consulta .veic { font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
.cab-consulta .meta { display: flex; gap: .4rem .9rem; flex-wrap: wrap; align-items: center; color: var(--suave); font-size: .86rem; margin-top: .3rem; }
.processando { display: flex; align-items: center; gap: .9rem; }
.processando p { margin: 0; }
.giro { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--borda); border-top-color: var(--ouro-esc); animation: giro .8s linear infinite; flex: none; }
@keyframes giro { to { transform: rotate(360deg); } }
.visualizador { display: block; width: 100%; height: 80vh; min-height: 480px; border: 1px solid var(--borda); border-radius: var(--raio-p); background: #fff; }
.visualizador-img { display: block; max-width: 100%; height: auto; border: 1px solid var(--borda); border-radius: var(--raio-p); }
.so-celular { display: none; margin: .75rem 0 0; }
.nota { display: flex; gap: .5rem; align-items: center; color: var(--suave); font-size: .86rem; }

/* ---------- utilitários ---------- */
.suave { color: var(--suave); }
.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cabecalho h1, .cabecalho h2 { margin: 0; padding: 0; border: 0; }
.card > .cabecalho:first-child { padding-bottom: .85rem; border-bottom: 1px solid var(--borda); margin-bottom: 1.1rem; }
.qr { max-width: 280px; background: #fff; padding: .75rem; border-radius: var(--raio-p); border: 1px solid var(--borda); }

/* ---------- login ---------- */
body.tela-cheia .shell .conteudo { max-width: none; margin: 0; padding: 0; display: flex; }
.login-wrap { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-marca {
  background: radial-gradient(700px 420px at 15% 0%, rgba(248,194,90,.14), transparent 65%), linear-gradient(165deg, #17181c 0%, #0b0c0e 100%);
  color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: relative; overflow: hidden;
}
.login-marca::after { content: ''; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 70px solid rgba(248,194,90,.05); }
.login-marca .logo { width: 220px; height: auto; display: block; }
.login-marca h2 { font-size: 2.15rem; line-height: 1.18; font-weight: 750; letter-spacing: -.03em; margin: 0 0 1rem; max-width: 470px; }
.login-marca h2 em { font-style: normal; color: var(--ouro); }
.login-marca p { color: rgba(255,255,255,.68); max-width: 440px; font-size: 1.02rem; }
.login-marca ul { list-style: none; padding: 0; margin: 1.75rem 0 0; display: grid; gap: .85rem; }
.login-marca li { display: flex; gap: .75rem; align-items: center; color: rgba(255,255,255,.86); }
.login-marca li .ico { color: var(--ouro); }
.login-marca .rod { color: rgba(255,255,255,.4); font-size: .8rem; position: relative; z-index: 1; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--card); }
.login { width: 100%; max-width: 380px; }
.login h1 { font-size: 1.65rem; margin-bottom: .35rem; }
.login .sub { color: var(--suave); margin-bottom: 1.75rem; }
.login button { width: 100%; padding: .82rem; font-size: 1rem; margin-top: .4rem; }
.login .contato { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--borda); color: var(--suave); font-size: .88rem; }

/* página isolada (link público, link expirado) */
.isolada { max-width: 480px; margin: 6vh auto; text-align: center; }
.isolada .icone-grande { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1rem; background: var(--ouro-claro); color: var(--link); }
.isolada .icone-grande .ico { width: 28px; height: 28px; }

/* ---------- telas menores ---------- */
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
  .login-marca { padding: 1.25rem 1.5rem; flex-direction: row; align-items: center; justify-content: center; }
  .login-marca > div:not(.rod) { display: none; }
  .login-marca .logo { width: 150px; }
  .login-marca h2, .login-marca p, .login-marca ul, .login-marca .rod { display: none; }
  .login-form { align-items: flex-start; padding-top: 2.25rem; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { overflow: hidden; position: sticky; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .6rem 16px 0; border-right: 0; border-bottom: 2px solid var(--ouro); }
  .brand { flex-direction: row; padding: 0; border: 0; }
  .brand img { width: 92px; }
  .brand small { display: none; }
  .me { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; gap: .9rem; }
  .me-id > div, .me-acoes a { display: none; }
  .avatar { width: 32px; height: 32px; }
  .menu { order: 3; flex-direction: row; flex-basis: calc(100% + 32px); margin: 0 -16px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid rgba(255,255,255,.07); }
  .menu::-webkit-scrollbar { display: none; }
  .menu a { padding: .7rem .75rem; border-radius: 0; font-size: .88rem; white-space: nowrap; border-bottom: 3px solid transparent; }
  .menu a.ativo { background: none; border-bottom-color: var(--ouro); }
  .conteudo { padding: 1.4rem 16px 2.5rem; }
  .rodape { padding: 1rem 16px; }
}
@media (max-width: 760px) {
  h1 { font-size: 1.35rem; }
  .card { padding: 1.1rem; }
  .tabela-wrap { margin: 0 -1.1rem; padding: 0 1.1rem; }
  .esconde-cel { display: none; }
  .grade { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .grade .kpi { padding: .9rem 1rem; }
  .kpi .val { font-size: 1.45rem; }
  .grade-2 { grid-template-columns: 1fr; }
  .cab-consulta .acoes { width: 100%; }
  .cab-consulta .acoes .btn { flex: 1 1 auto; }
  .placa-chip.grande { min-width: 164px; font-size: 1.5rem; }
  .visualizador { height: 70vh; min-height: 360px; }
  .so-celular { display: block; }
  form.linha > div, form.linha input.placa { width: 100%; max-width: none; }
  form.linha button { width: 100%; }
}
@media (max-width: 400px) { .grade { grid-template-columns: 1fr; } }

/* cartão de emissão do CRLV */
.linha-crlv { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: .75rem; align-items: end; }
.linha-crlv input.placa { max-width: none; }
@media (max-width: 760px) { .linha-crlv { grid-template-columns: 1fr; } }
td.num { white-space: nowrap; }

/* configurações */
.tabela-config td { vertical-align: middle; }
.com-sufixo { display: flex; align-items: center; gap: .5rem; }
.com-sufixo input { width: 90px; }
.com-sufixo span { color: var(--suave); font-size: .86rem; white-space: nowrap; }
.chave { position: relative; display: inline-block; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.chave input { opacity: 0; width: 0; height: 0; position: absolute; }
.chave span { position: absolute; inset: 0; background: var(--borda-forte); border-radius: 99px; transition: background .15s; }
.chave span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.chave input:checked + span { background: var(--ok); }
.chave input:checked + span::after { transform: translateX(20px); }
.chave input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--ouro-esc) 55%, transparent); outline-offset: 2px; }
.linha-check { display: flex; gap: .55rem; align-items: center; font-weight: 500; color: var(--texto); margin-top: .5rem; }
.barra-salvar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; padding: .9rem 0; margin-bottom: 1.25rem; background: linear-gradient(to top, var(--bg) 70%, transparent); }

.com-prefixo { display: inline-flex; align-items: center; gap: .4rem; justify-content: flex-end; }
.com-prefixo span { color: var(--suave); font-size: .86rem; }
.com-prefixo input { width: 110px; text-align: right; }
tfoot td { border-top: 1px solid var(--borda-forte); border-bottom: 0; font-weight: 600; }

.barra-salvar { background: none; padding: .75rem 0; }
.barra-salvar button { box-shadow: 0 6px 20px rgba(17,18,21,.18); }
@media (max-width: 760px) {
  .tabela-config thead { display: none; }
  .tabela-config, .tabela-config tbody { display: block; }
  .tabela-config tr { display: grid; grid-template-columns: auto 1fr; gap: .6rem 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--borda); }
  .tabela-config tr:last-child { border-bottom: 0; }
  .tabela-config td { display: contents; }
  .tabela-config td.cel-tipo { display: block; grid-column: 1 / -1; padding: 0; border: 0; }
  .tabela-config td[data-rotulo]::before { content: attr(data-rotulo); font-size: .82rem; font-weight: 600; color: var(--suave); }
  .tabela-config td[data-rotulo] > * { justify-self: end; }
  .tabela-config .com-prefixo, .tabela-config td.num > .suave { text-align: right; }
  .barra-salvar button { width: 100%; }
}
@media (max-width: 760px) { .tabela-config td.num > .suave { grid-column: 1 / -1; justify-self: end; margin-top: -.3rem !important; } }

/* ================= Dashboard ================= */
:root {
  --s1: #257de0; --s2: #f47230; --s3: #00b894;
  --st-bom: #0aac23; --st-atencao: #fbb315; --st-critico: #dc3c3d;
  --grade-graf: #e7e7e7; --base-graf: #c2c2c2; --tinta-2: #666666;
  --sobe-bom: #006c10;
}
@media (prefers-color-scheme: dark) {
  :root { --s1: #338ced; --s2: #e76624; --s3: #00a888; --grade-graf: #2a2d33; --base-graf: #474747; --tinta-2: #9c9c9c; --sobe-bom: #53c556; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dash-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.dash-cab h1 { margin: 0; }
.periodos { display: inline-flex; background: var(--card); border: 1px solid var(--borda); border-radius: 10px; padding: 3px; gap: 2px; box-shadow: var(--sombra); }
.periodos a { padding: .42rem .85rem; border-radius: 7px; color: var(--suave); font-weight: 550; font-size: .88rem; white-space: nowrap; }
.periodos a:hover { color: var(--texto); background: var(--bg); text-decoration: none; }
.periodos a.ativo { background: var(--grafite); color: var(--ouro); }
.grade-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-dash::before { display: none; }
.kpi-cab { display: flex; align-items: center; gap: .55rem; }
.kpi-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ouro-claro); color: var(--link); flex: none; }
.kpi-ico .ico { width: 16px; height: 16px; }
.kpi-dash .val { font-size: 2rem; margin-top: .55rem; }
.kpi-dash .sub { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin-top: .4rem; }
.delta { display: inline-flex; align-items: center; gap: .2rem; font-weight: 650; font-size: .78rem; padding: .08rem .45rem; border-radius: 99px; white-space: nowrap; }
.delta.bom { color: var(--sobe-bom); background: var(--ok-bg); }
.delta.ruim { color: var(--erro); background: var(--erro-bg); }
.delta.neutro { color: var(--suave); background: var(--bg); }
.grade-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1.25rem; }
.grade-3 > .card { margin-bottom: 0; }
h2.secao { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); margin: 2rem 0 .9rem; }

.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .grade { stroke: var(--grade-graf); stroke-width: 1; }
.grafico .base { stroke: var(--base-graf); stroke-width: 1; }
.grafico .eixo { fill: var(--tinta-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico .s1, .s1 { fill: var(--s1); background: var(--s1); }
.grafico .s2, .s2 { fill: var(--s2); background: var(--s2); }
.grafico .s3, .s3 { fill: var(--s3); background: var(--s3); }
.grafico .alvo { fill: transparent; cursor: default; outline: none; }
.grafico .alvo:hover, .grafico .alvo:focus-visible, .grafico .alvo.foco-dado { fill: color-mix(in srgb, var(--texto) 6%, transparent); }
.legenda { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; font-size: .84rem; color: var(--suave); }
.legenda > span { display: inline-flex; align-items: center; gap: .4rem; }
.amostra { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.st-bom { background: var(--st-bom); } .st-atencao { background: var(--st-atencao); } .st-critico { background: var(--st-critico); }

.barras-h { display: grid; gap: 1rem; }
.bh { outline: none; border-radius: 6px; }
.bh:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ouro-esc) 45%, transparent); }
.bh-topo { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .35rem; }
.bh-topo strong { font-variant-numeric: tabular-nums; }
.bh-trilho { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bh-trilho span { display: block; height: 100%; border-radius: 99px; }

.seg { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; margin-bottom: 1rem; }
.seg span { display: block; min-width: 4px; outline: none; }
.seg span:first-child { border-radius: 4px 0 0 4px; } .seg span:last-child { border-radius: 0 4px 4px 0; }
.seg span:focus-visible, .seg span.foco-dado { filter: brightness(1.1); box-shadow: inset 0 0 0 2px var(--card); }
.legenda-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.legenda-lista li { display: grid; grid-template-columns: 10px 16px 1fr auto auto; align-items: center; gap: .5rem; font-size: .9rem; }
.legenda-lista strong { font-variant-numeric: tabular-nums; }
.legenda-lista .suave { font-size: .82rem; min-width: 3.2em; text-align: right; }
.ico-status { font-weight: 700; color: var(--suave); text-align: center; }

.saude { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.saude li { display: flex; gap: .75rem; align-items: flex-start; }
.saude strong { display: block; font-size: .92rem; }
.saude li span:not(.pino) { color: var(--suave); font-size: .84rem; }
.pino { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.pino.ok { background: var(--ok-bg); color: var(--ok); }
.pino.alerta { background: var(--alerta-bg); color: var(--alerta); }

.ver-tabela { margin-top: .75rem; }
.ver-tabela summary { cursor: pointer; color: var(--suave); font-size: .84rem; font-weight: 550; }
.ver-tabela[open] summary { margin-bottom: .5rem; }
.ver-tabela table { font-size: .86rem; }

.dica-flutuante {
  position: fixed; z-index: 50; pointer-events: none; white-space: pre-line;
  background: var(--grafite); color: #fff; font-size: .82rem; line-height: 1.45;
  padding: .5rem .7rem; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 260px;
}
.dica-flutuante::first-line { font-weight: 700; color: var(--ouro); }

@media (max-width: 1100px) { .grade-3 { grid-template-columns: 1fr 1fr; } .grade-3 > .card:last-child { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .grade-kpi { grid-template-columns: 1fr 1fr; }
  .kpi-dash .val { font-size: 1.5rem; }
  .grade-3 { grid-template-columns: 1fr; }
  .periodos { width: 100%; overflow-x: auto; }
  .periodos a { flex: 1; text-align: center; }
}

.so-estreito { display: none; }
@media (max-width: 760px) { .so-largo { display: none; } .so-estreito { display: block; } }

.opcoes-avancadas { margin-top: .25rem; border-top: 1px solid var(--borda); padding-top: .9rem; }
.opcoes-avancadas summary { cursor: pointer; font-weight: 600; color: var(--link); }
.acordo { background: var(--ouro-claro); border: 1px solid color-mix(in srgb, var(--ouro) 45%, transparent); border-radius: var(--raio-p); padding: .75rem .9rem; margin-bottom: .9rem; font-size: .9rem; display: grid; gap: .25rem; }

.relacionada { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--borda); border-left: 3px solid var(--ouro); border-radius: var(--raio-p); padding: .7rem 1rem; margin-bottom: 1rem; box-shadow: var(--sombra); }
.relacionada > span:first-child { display: inline-flex; align-items: center; gap: .5rem; flex: 1; }
.relacionada .btn { padding: .4rem .9rem; }

/* solicitações de cadastro */
.contador { margin-left: auto; background: var(--ouro); color: var(--sobre-ouro); font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 99px; display: inline-grid; place-items: center; padding: 0 .35rem; }
.aviso-pendente { display: flex; align-items: center; gap: .75rem; background: var(--alerta-bg); border: 1px solid color-mix(in srgb, var(--alerta) 30%, transparent); color: var(--texto); border-radius: var(--raio); padding: .8rem 1rem; margin-bottom: 1.25rem; font-weight: 500; }
.aviso-pendente:hover { text-decoration: none; filter: brightness(.98); }
.aviso-pendente span:nth-child(2) { flex: 1; }
.aviso-pendente span:last-child { color: var(--link); font-weight: 650; white-space: nowrap; }
.ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem 1.25rem; margin: 0 0 1.25rem; }
.ficha dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--suave); font-weight: 650; }
.ficha dd { margin: .15rem 0 0; font-weight: 550; word-break: break-word; }
.caixa-acao { border: 1px solid var(--borda); border-radius: var(--raio-p); padding: 1rem; background: var(--bg); }
.caixa-acao h3 { display: flex; align-items: center; gap: .4rem; font-size: .95rem; margin: 0 0 .8rem; }

.card.recarga { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 3px solid var(--ouro); }
.card.recarga select { width: auto; min-width: 200px; }
@media (max-width: 760px) { .card.recarga select { width: 100%; } }

details.pagas summary { cursor: pointer; list-style: revert; }
details.pagas[open] summary { padding-bottom: .85rem; border-bottom: 1px solid var(--borda); }
