/* Componentes: botões, card, toggle on/off, toast, estado vazio e utilitários. */

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--controle-h);
  padding: 0 var(--sp-4);
  border-radius: var(--raio-8);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: 17px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-texto-sobre); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger, .btn-perigo { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-icone {
  width: 40px; height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: var(--raio-8);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 19px;
}
.btn-icone { transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.btn-icone:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* ---------- Card ---------- */
.cd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--raio-12);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.cd-titulo { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.cd-titulo i { color: var(--accent-texto); font-size: 20px; }
.grade-cards { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Número de destaque (KPI): Sora, como os títulos */
.kpi-valor { font-family: var(--font-titulo); font-weight: 700; font-size: var(--fs-2xl); letter-spacing: -.02em; }

/* ---------- Toggle on/off (.cv-sw) ---------- */
.cv-sw {
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.cv-sw input { display: none; }
.cv-sw .cv-sl {
  position: absolute; inset: 0;
  border-radius: 24px;
  background: var(--border);
  transition: background .15s;
}
.cv-sw .cv-sl::before {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.cv-sw input:checked + .cv-sl { background: #16a34a; }
.cv-sw input:checked + .cv-sl::before { transform: translateX(18px); }

.tema-alternador { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-dim); font-size: 17px; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--raio-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
  animation: toast-entra .18s ease-out;
}
.toast i { font-size: 18px; margin-top: 1px; }
.toast.sucesso { border-left-color: var(--success); }
.toast.sucesso i { color: var(--success); }
.toast.erro { border-left-color: var(--danger); }
.toast.erro i { color: var(--danger-texto); }
.toast.aviso { border-left-color: var(--warning); }
.toast.aviso i { color: var(--warning-texto); }
.toast.saindo { opacity: 0; transition: opacity .2s; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Estado vazio ---------- */
.vz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--text-dim);
}
.vz i { font-size: 40px; color: var(--accent-texto); }
.vz h3 { color: var(--text); }

/* ---------- Página de erro ---------- */
.erro-pagina {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
}
.erro-pagina .cd { max-width: 440px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; }
.erro-codigo { font-family: var(--font-titulo); font-size: 48px; font-weight: 800; color: var(--accent-texto); line-height: 1; }

/* ---------- Utilitários de formulário (substituem style= em template, R3) ---------- */
.campo-flex { flex: 1; }
.campo-num { min-width: 90px; }
.campo-data { min-width: 150px; }

@media (max-width: 720px) {
  .btn, .btn-icone { min-height: 44px; }
  .btn-icone { width: 44px; height: 44px; }
  .toasts { right: var(--sp-4); bottom: var(--sp-4); }
}

/* ---------- Formulário ---------- */
.form-pilha { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-linha { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; }
.form-estreito { max-width: 480px; }
.campo { display: flex; flex-direction: column; gap: var(--sp-1); }
.rotulo { font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); }
.input {
  box-sizing: border-box;
  height: var(--controle-h);
  padding: 0 var(--sp-3);
  border-radius: var(--raio-8);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  width: 100%;
}
.input { transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease); }
.input:hover:not(:focus) { border-color: color-mix(in srgb, var(--border) 60%, var(--text-dim)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.campo-invalido:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input.campo-invalido { border-color: var(--danger); }
.btn-bloco { width: 100%; }
.aviso-faixa {
  display: flex; gap: var(--sp-2); align-items: center;
  padding: var(--sp-3); margin-bottom: var(--sp-4);
  border-radius: var(--raio-8);
  background: var(--accent-soft); color: var(--accent-texto);
  font-size: var(--fs-sm);
}
.oculto { display: none !important; }

/* ---------- Tela de login ---------- */
.auth-pagina { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5); background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-marca { display: flex; align-items: center; gap: var(--sp-3); }
.auth-rodape { display: flex; justify-content: center; }

/* ---------- Tabela simples ---------- */
.tabela-wrap { overflow-x: auto; }
.tabela { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tabela th { text-align: left; font-weight: 600; color: var(--text-dim); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tabela td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabela tr:hover td { background: var(--surface-2); }
.tabela .acoes { text-align: right; white-space: nowrap; }
.tabela .centro { text-align: center; }
/* Selo: pílula com ponto colorido (cor do texto), status semântico */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--neutro); white-space: nowrap; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.selo:empty { display: none; }
.selo.ok, .selo.sucesso { background: var(--success-soft); color: var(--marca-verde-texto); }
.selo.info { background: var(--info-soft); color: var(--info); }
.selo.perigo { background: var(--danger-soft); color: var(--danger-texto); }
.selo.neutro { background: var(--surface-2); color: var(--neutro); }
.barra-acoes { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }

/* ---------- Modal (<dialog>) ---------- */
dialog.popup-centrado {
  border: 1px solid var(--border);
  border-radius: var(--raio-12);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: 92vw;
  max-height: 88vh;
  box-shadow: var(--shadow);
}
dialog.popup-centrado::backdrop { background: rgba(11, 18, 32, .45); }
dialog.modal-sm { max-width: min(420px, 92vw); }
dialog.modal-md { max-width: min(560px, 92vw); }
dialog.modal-lg { max-width: min(880px, 92vw); }
.modal-cab { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.modal-corpo { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-rodape { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }
.modal-aviso { color: var(--danger-texto); font-size: var(--fs-sm); }
.modal-aviso:empty { display: none; }

/* ---------- Grade de permissões ---------- */
.linha-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) 0; }

/* ---------- SelectBusca (substitui <select>, R8) ---------- */
.selectbusca { position: relative; }
.sb-display {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  height: var(--controle-h); padding: 0 var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--raio-8);
  background: var(--surface); color: var(--text); font-size: var(--fs-sm);
  cursor: pointer; width: 100%;
}
.sb-placeholder { color: var(--text-dim); }
.sb-panel {
  display: none; position: fixed; z-index: 1100;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio-8);
  box-shadow: var(--shadow); padding: var(--sp-2); max-height: 280px; overflow-y: auto;
}
.selectbusca.open .sb-panel { display: block; }
.sb-search { margin-bottom: var(--sp-2); }
.sb-opt { padding: var(--sp-2) var(--sp-3); border-radius: var(--raio-8); cursor: pointer; font-size: var(--fs-sm); }
.sb-opt:hover { background: var(--surface-2); }
@media (max-width: 720px) { .input, .sb-display { min-height: 44px; } }

.form-inline { display: inline; }
.grade-kpis { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: var(--sp-4); }
.lista-dados { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-2) var(--sp-4); margin-bottom: var(--sp-4); font-size: var(--fs-sm); }
.lista-dados dt { color: var(--text-dim); }
.pagina > .cd + .cd, .pagina > .grade-cards + .cd { margin-top: var(--sp-4); }
.rotulo-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-dim); }
@media (max-width: 520px) {
  .tb-acoes .btn .btn-texto { display: none; }
  .tb-acoes .btn { width: 44px; padding: 0; }
}
.btn-sm { height: 34px; padding: 0 var(--sp-3); }

/* ---------- Formulário em linha (.ra-bar) ---------- */
.ra-bar { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
.btn-icone.desabilitado { opacity: .35; cursor: default; pointer-events: none; }

/* ---------- TabelaAvancada ---------- */
.ta-cab { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.ta-ancora { position: relative; }
.ta-menu, .ta-painel {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50;
  min-width: 230px; padding: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--raio-8); box-shadow: var(--shadow);
}
.ta-menu[hidden], .ta-painel[hidden] { display: none; }
.ta-item {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; height: auto;
  padding: var(--sp-2) var(--sp-3); border: 0; border-radius: var(--raio-8);
  background: transparent; color: var(--text); font-size: var(--fs-sm); text-align: left; cursor: pointer;
}
.ta-item:hover { background: var(--surface-2); }
.ta-item i { font-size: 17px; color: var(--text-dim); }
span.ta-item { justify-content: flex-start; }
.ta-painel-tit { font-size: var(--fs-sm); font-weight: 600; color: var(--text-dim); padding: var(--sp-1) var(--sp-2) var(--sp-2); }
.ta-lista { display: flex; flex-direction: column; }
.ta-linha { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.ta-linha span:first-child { flex: 1; }
.ta-linha .btn-icone.ativo { color: var(--accent-texto); background: var(--accent-soft); }
.ta-botoes { display: flex; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2); }
.tabela-wrap { position: relative; }
.ta-filtros th { padding-top: var(--sp-1); padding-bottom: var(--sp-2); }
.ta-filtro { height: var(--controle-h-sm); font-size: var(--fs-xs); font-weight: 400; min-width: 80px; }
.tabela th.ta-ordenavel { cursor: pointer; user-select: none; }
.tabela th.ta-ordenavel:hover { color: var(--text); }
.tabela th.ord-asc::after { content: " 91"; color: var(--accent-texto); }
.tabela th.ord-desc::after { content: " 93"; color: var(--accent-texto); }
.tabela td.num, .tabela th[data-tipo="num"] { text-align: right; font-variant-numeric: tabular-nums; }
.selo-operando { background: var(--success-soft); color: var(--marca-verde-texto); }
.selo-manutencao { background: var(--warning-soft); color: var(--warning-texto); }
.selo-parada { background: var(--danger-soft); color: var(--danger-texto); }
.oc-pag {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--sp-3);
  padding-top: var(--sp-3); margin-top: var(--sp-2); border-top: 1px solid var(--border); font-size: var(--fs-sm);
}
.oc-cont { color: var(--text-dim); }
.oc-nav { display: flex; align-items: center; gap: var(--sp-1); }
.oc-num { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.oc-tam { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); }
.oc-tam-btn {
  height: var(--controle-h-sm); min-width: 38px; padding: 0 var(--sp-2); border-radius: var(--raio-8);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-size: var(--fs-xs); cursor: pointer;
}
.oc-tam-btn.ativo { background: var(--accent-soft); color: var(--accent-texto); border-color: var(--accent); font-weight: 600; }
@media (max-width: 720px) {
  .oc-pag { grid-template-columns: 1fr; justify-items: center; }
  .oc-tam { justify-content: center; }
  .oc-tam-btn { height: 44px; min-width: 44px; }
}

/* ---------- Loading ---------- */
.carregando::after {
  content: "Carregando..."; position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-dim); font-size: var(--fs-sm);
}
.loading-global {
  position: fixed; top: var(--sp-4); left: 50%; transform: translateX(-50%); z-index: 1200;
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: var(--fs-sm);
}
.loading-global[hidden] { display: none; }
.loading-giro { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }

/* ---------- Formulário em grade (cadastros) ---------- */
.grade-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3) var(--sp-4); align-items: end; }
.grade-form .campo { margin: 0; }

/* ---------- Abas (.xx-tab) ---------- */
.xx-tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); overflow-x: auto; }
.xx-tab {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  height: 40px; padding: 0 var(--sp-3); box-sizing: border-box;
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--text-dim); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.xx-tab:hover { color: var(--text); }
.xx-tab.ativo { color: var(--accent-texto); border-bottom-color: var(--accent); }
.xx-tab.com-erro { color: var(--danger-texto); }

/* Modal alto: cabeçalho e rodapé fixos, só o corpo rola (o painel do SelectBusca é fixed e escapa) */
dialog.popup-centrado > form { display: flex; flex-direction: column; max-height: 88vh; }
dialog.popup-centrado .modal-corpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.tabela td.codigo { text-align: right; font-variant-numeric: tabular-nums; }
.tabela td[data-col="descricao"], .tabela td[data-col="nome"] { min-width: 220px; }

/* ---------- Barra de filtros (Padrao_Barra_de_Filtros) ---------- */
.fu-bar { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; margin-bottom: var(--sp-4); --fu-h: 38px; }
.fu-bar .g { display: flex; flex-direction: column; gap: var(--sp-1); }
.fu-lbl { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.fu-bar .input, .fu-bar .btn { height: var(--fu-h); }
.fu-bar .sp { flex: 1; }
.fu-datas { display: flex; gap: var(--sp-2); }
.fu-presets { align-self: flex-start; display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: nowrap; height: var(--fu-h); padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.fu-presets button, .fu-presets a { height: calc(var(--fu-h) - 8px); display: inline-flex; align-items: center; border: 1px solid transparent; background: transparent; border-radius: var(--raio-6); padding: 0 10px; font: inherit; font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); cursor: pointer; white-space: nowrap; text-decoration: none; }
.fu-presets button:hover, .fu-presets a:hover { color: var(--accent-texto); }
.fu-presets .on { border-color: var(--accent); background: var(--accent-suave); color: var(--accent-texto); }
@media (max-width: 720px) {
  .fu-bar .g { flex: 1 1 100%; }
  .fu-presets { flex-wrap: wrap; height: auto; }
  .fu-bar .sp { display: none; }
}

/* ---------- KPIs de painel (Padrao_KPI_Dashboard) ---------- */
.mg-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
@media (max-width: 1300px) { .mg-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .mg-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.mg-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; }
.mg-kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--border); }
.mg-kpi.ac-prod::before { background: var(--accent); }
.mg-kpi.ac-meta::before { background: var(--text-dim); }
.mg-kpi.ac-horas::before { background: var(--accent-escura); }
.mg-kpi.ac-parada::before { background: var(--warning); }
.mg-kpi.pos::before { background: var(--success); }
.mg-kpi.neg::before { background: var(--danger); }
.mg-kpi .ico { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-texto); }
.mg-kpi.ac-parada .ico { background: var(--warning-soft); color: var(--warning-texto); }
.mg-kpi.pos .ico { background: var(--success-soft); color: var(--success); }
.mg-kpi.neg .ico { background: var(--danger-soft); color: var(--danger-texto); }
.mg-kpi .corpo { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.mg-kpi .lbl { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; font-weight: 700; line-height: 1.2; min-height: 25px; display: flex; align-items: flex-end; }
.mg-kpi .val { font-size: 20px; font-weight: 800; letter-spacing: -.5px; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 3px; white-space: nowrap; }
.mg-kpi .disc { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.2; font-style: italic; min-height: 14px; }
@media (max-width: 720px) {
  .mg-kpi { padding: 12px 11px; gap: 9px; }
  .mg-kpi .ico { width: 36px; height: 36px; font-size: 18px; border-radius: 9px; }
  .mg-kpi .lbl { font-size: 9.5px; min-height: 23px; }
  .mg-kpi .val { font-size: 18px; }
}
.tabela-num td.num, .tabela-num th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.forte { font-weight: 700; }

/* ---------- Apontamento no tablet: alvos de 44px+, 8px entre eles ---------- */
.tablet { max-width: 880px; }
.tablet-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.tablet-form .t-cheio { grid-column: 1 / -1; }
.tablet-form .input, .tablet-form .sb-display { min-height: 48px; font-size: 16px; }
.tablet-form .sb-opt { min-height: 44px; display: flex; align-items: center; }
.t-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.t-chip { position: relative; }
.t-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.t-chip span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-weight: 600; }
.t-chip input:checked + span { border-color: var(--accent); background: var(--accent-suave); color: var(--accent-texto); }
.t-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.t-salvar { min-height: 52px; font-size: 16px; }
@media (max-width: 560px) { .tablet-form { grid-template-columns: 1fr; } }

/* ---------- Pareto: barras horizontais, rótulo sempre na horizontal ---------- */
.grafico-cab { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); margin-bottom: var(--sp-4); }
.grafico-cab h3 { margin: 0; }
.legenda { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-dim); }
.leg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.leg-barra { background: var(--accent); }
.leg-item-acum { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: var(--sp-2); }
.leg-acum { background: var(--accent-soft); border: 1px solid var(--accent); }
.pareto { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto auto; gap: 8px var(--sp-3); align-items: center; }
.pareto-linha { display: contents; }
.pareto-nome { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pareto-trilho svg { display: block; width: 100%; height: 18px; }
.pareto-barra { fill: var(--accent); }
.pareto-val, .pareto-acum { text-align: right; font-variant-numeric: tabular-nums; }
.pareto-total > * { font-weight: 700; border-top: 1px solid var(--border); padding-top: var(--sp-2); align-self: stretch; }
@media (max-width: 560px) { .pareto { grid-template-columns: minmax(90px, 1fr) 1.2fr auto; } .pareto-acum, .leg-item-acum { display: none; } }

/* ---------- Fase 7: identidade, convites, acessar como, notificações ---------- */
.marca-icone.marca-logo { background: transparent; overflow: hidden; }
.marca-icone.marca-logo img { width: 100%; height: 100%; object-fit: contain; }
.ajuda { font-size: var(--fs-xs); color: var(--text-dim); }
.texto-accent { color: var(--accent-texto); font-weight: 600; }
.selo.aviso { background: var(--warning-soft); color: var(--warning-texto); }

.cor-linha { display: flex; gap: var(--sp-2); align-items: center; }
.input-cor { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.ident-previa { display: flex; flex-direction: column; gap: var(--sp-4); }
.ident-marca { display: flex; align-items: center; gap: var(--sp-2); }
.ident-marca .marca-icone { width: 40px; height: 40px; border-radius: var(--raio-8); display: grid; place-items: center; background: var(--accent); color: var(--accent-texto-sobre); font-size: 20px; }
.ident-marca .marca-icone.marca-logo { background: transparent; }
.ident-icones { display: flex; gap: var(--sp-4); align-items: flex-end; }
.ident-icones figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--text-dim); }
.ident-icones img { width: 64px; height: 64px; border-radius: var(--raio-12); border: 1px solid var(--border); }
.ident-rampa { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.ident-rampa li { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.amostra { width: 24px; height: 24px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.amostra-accent { background: var(--accent); }
.amostra-accent-hover { background: var(--accent-hover); }
.amostra-accent-escura { background: var(--accent-escura); }
.amostra-accent-suave { background: var(--accent-suave); }
.amostra-accent-texto { background: var(--accent-texto); }

.faixa-acessar-como { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-2) var(--sp-4);
  background: var(--warning-soft); color: var(--text); border-bottom: 2px solid var(--warning); position: sticky; top: 0; z-index: 30; font-size: var(--fs-sm); }
.faixa-acessar-como i { color: var(--warning-texto); font-size: 20px; }
.faixa-acessar-como span { flex: 1; min-width: 200px; }

.sino { position: relative; }
.sino-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }

.convite-novo { border: 1px solid var(--accent); }
.convite-estado { padding: var(--sp-3) 0; }
.notif-lista { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item > i { font-size: 20px; color: var(--text-dim); margin-top: 2px; }
.notif-item.nao-lida > i { color: var(--accent-texto); }
.notif-corpo { flex: 1; min-width: 0; }
.notif-corpo p { margin: 2px 0; color: var(--text-dim); }
.notif-item.nao-lida strong { color: var(--text); }

/* Upload com arrastar e soltar (Padrao_Upload_Arquivo) */
.im-drop { display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: var(--sp-5); text-align: center;
  color: var(--text-dim); cursor: pointer; transition: .15s; user-select: none; }
.im-drop:hover, .im-drop.over { border-color: var(--accent); background: var(--accent-suave); color: var(--accent-escura); border-style: solid; }
.im-drop.loaded { border-style: solid; border-color: var(--success); background: var(--success-soft); color: var(--text); }
.im-drop.im-off { cursor: not-allowed; opacity: .6; }
.im-drop i { font-size: 36px; display: block; margin-bottom: 6px; }
.im-drop.loaded i { color: var(--success); }
.im-arq { display: block; margin-top: 6px; font-weight: 600; color: var(--text); }
.im-arq:empty { display: none; }
.im-inp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
:root[data-theme="dark"] .im-drop:hover, :root[data-theme="dark"] .im-drop.over { background: var(--accent-soft); color: var(--text); }

/* ---------- Fase 8: seleção em lote (Padrao_Selecao_em_Lote), importação e pedidos ---------- */
.col-sel { width: 40px; text-align: center; }
.tsel { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; margin: 0; position: relative; vertical-align: middle;
  border: 1.5px solid var(--border); border-radius: 5px; background: var(--surface); cursor: pointer; transition: background .12s, border-color .12s; }
.tsel:hover { border-color: var(--accent); }
.tsel:checked, .tsel:indeterminate { background: var(--accent); border-color: var(--accent); }
.tsel:checked::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid var(--accent-texto-sobre); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tsel:indeterminate::after { content: ''; position: absolute; left: 3px; top: 7px; width: 10px; height: 2px; background: var(--accent-texto-sobre); }
.tsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabela tr.sel td { background: var(--accent-soft); }
.tsel-bar { position: fixed; bottom: 0; left: var(--sidebar-width); right: 0; z-index: 90; display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; background: #1E293B; color: #fff; font-size: 13.5px; box-shadow: 0 -4px 24px rgba(0, 0, 0, .2); animation: tselSobe .18s ease; }
.tsel-bar.visivel { display: flex; }
.tsel-bar .btn { min-height: 36px; }
.tsel-conta { font-weight: 700; }
.tsel-acoes { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
@keyframes tselSobe { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (max-width: 880px) { .tsel-bar { left: 0; padding: 12px 16px; } }
.selo.erro { background: var(--danger-soft); color: var(--danger-texto); }
.mg-kpi .val.val-texto { font-size: var(--fs-base); white-space: normal; overflow-wrap: anywhere; }
.ta-cab form { margin: 0; }
.nomes-lista { list-style: none; padding: 0; margin: 0 0 var(--sp-3); display: flex; flex-wrap: wrap; gap: 6px; }
.nomes-lista li { padding: 2px var(--sp-2); border: 1px solid var(--border); border-radius: 999px; font-size: var(--fs-xs); }
.lista-dados > div { display: contents; }

/* Romaneio de bobinas (Fase 11): uma faixa por linha, papel mais largo que os números */
.form-romaneio h2.cd-titulo { font-size: var(--fs-base); margin-top: var(--sp-4); }
.form-romaneio h2.cd-titulo:first-of-type { margin-top: 0; }
.romaneio-linhas { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.romaneio-linha { grid-template-columns: minmax(200px, 2fr) repeat(5, minmax(100px, 1fr)); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
@media (max-width: 900px) { .romaneio-linha { grid-template-columns: repeat(2, minmax(0, 1fr)); } .romaneio-linha > .campo-flex { grid-column: 1 / -1; } }

/* Expedição (Fase 12): cabeçalho da carga, título de seção solta e selos da situação da carga */
.carga-cab { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); }
.secao-titulo { font-size: var(--fs-lg); font-weight: 700; margin: var(--sp-5) 0 var(--sp-3); }
.carga-rodape { display: flex; justify-content: flex-end; margin-top: var(--sp-4); }
.selo-aberta { background: var(--accent-soft); color: var(--accent-texto); }
.selo-fechada { background: var(--surface-2); color: var(--text-dim); }
.selo-entrega { background: var(--accent-soft); color: var(--accent-texto); }
.selo-retira { background: var(--warning-soft); color: var(--warning-texto); }

/* Pop-up de tela inteira (a[data-popup] em modal.js) */
dialog.modal-pagina { width: min(1100px, 94vw); max-width: min(1100px, 94vw); height: 88vh; padding: 0; display: none; flex-direction: column; overflow: hidden; }
dialog.modal-pagina[open] { display: flex; }
.modal-pagina-quadro { flex: 1; width: 100%; border: 0; background: var(--bg); }
.em-popup .sidebar, .em-popup .sidebar-fundo, .em-popup .topbar, .em-popup .faixa-acessar-como { display: none; }
.em-popup .pagina { padding: var(--sp-4); }

/* =====================================================================
   Acabamento Soropel: minimalista e profissional.
   Fica no fim para refinar as regras acima sem mexer no comportamento.
   ===================================================================== */
body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .tb-titulo, .kpi-valor { letter-spacing: -.015em; }

/* Casca: menu e barra do topo mais leves */
.sidebar { background: var(--bg-elev); border-right-color: var(--border); }
.sidebar-marca { border-bottom: 0; }
.sidebar-marca .marca-icone.marca-logo { background: #fff; border: 1px solid var(--border); padding: 3px; border-radius: 10px; }
.nav-item { position: relative; color: var(--text-dim); font-weight: 500; transition: background .12s ease, color .12s ease; }
.nav-item:hover { color: var(--text); }
.nav-item.ativo { background: var(--accent-soft); color: var(--accent-texto); font-weight: 600; }
.nav-item.ativo::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
:root[data-theme="dark"] .nav-item.ativo { background: var(--accent-soft); color: var(--text); }
.nav-grupo { font-size: 11px; letter-spacing: .08em; }
.btn-home-side { background: var(--accent); color: var(--accent-texto-sobre); box-shadow: 0 1px 2px var(--accent-sombra); }
.btn-home-side:hover { background: var(--accent-hover); filter: none; }
.avatar { background: var(--accent-soft); color: var(--accent-texto); }
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom-color: var(--border); }
.tb-titulo { font-size: 17px; }
.pagina { padding-top: var(--sp-5); }

/* Cartões e indicadores: superfície plana, borda fina, sem barra colorida */
.cd { border-radius: 14px; box-shadow: none; }
.cd-titulo h3 { font-size: 15px; font-weight: 700; }
.mg-kpi { border-radius: 14px; padding: 16px; box-shadow: none; }
.mg-kpi::before { display: none; }
.mg-kpi .ico { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }
.mg-kpi.ac-meta .ico { background: var(--surface-2); color: var(--text-dim); }
.mg-kpi.ac-horas .ico { background: var(--surface-2); color: var(--accent-texto); }
.mg-kpi .lbl { font-weight: 600; letter-spacing: .05em; }
.mg-kpi .val { font-family: var(--font-titulo); font-weight: 700; font-size: 22px; }
.mg-kpi .disc { font-style: normal; }

/* Botões e campos */
.btn { border-radius: 9px; font-weight: 600; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
.btn-primary { box-shadow: 0 1px 2px var(--accent-sombra); }
.btn:focus-visible, .btn-icone:focus-visible, .input:focus-visible, .nav-item:focus-visible, .nav-grupo:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--accent-sombra); }
.input { border-radius: 9px; transition: border-color .12s ease, box-shadow .12s ease; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-display { border-radius: 9px; }

/* Tabelas: cabeçalho discreto, linhas arejadas */
.tabela th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 10px var(--sp-3); }
.tabela td { padding: 11px var(--sp-3); border-bottom-color: var(--border); }
.tabela tr:hover td { background: var(--accent-suave); }

/* Pop-ups */
dialog.popup-centrado { border-radius: 16px; box-shadow: 0 24px 64px rgba(19, 38, 57, .22); }
dialog.popup-centrado::backdrop { background: rgba(11, 18, 32, .5); backdrop-filter: blur(2px); }
.modal-cab h3 { font-size: 16px; }

/* Tela de entrada: dividida, imagem da marca à esquerda e formulário à direita */
.auth-pagina.auth-dividida { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); place-items: stretch; padding: 0; background: var(--bg); }
.auth-visual { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px;
  color: #fff; background: radial-gradient(900px 500px at 15% 10%, rgba(77, 151, 255, .35), transparent 60%), radial-gradient(700px 420px at 100% 100%, rgba(76, 174, 79, .22), transparent 60%), linear-gradient(160deg, #0B3F8C 0%, #0A2A5E 55%, #081C40 100%); }
.auth-visual::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%); }
.auth-visual-conteudo { position: relative; max-width: 440px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-5); animation: auth-sobe .6s var(--ease) both; }
.auth-visual-selo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); }
.auth-visual-selo i { color: var(--marca-verde); }
.auth-visual-banner { margin: 0; padding: 8px; border-radius: 22px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); box-shadow: 0 30px 60px rgba(0, 0, 0, .35); }
.auth-visual-banner img { display: block; width: 346px; max-width: 100%; height: auto; border-radius: 16px; }
.auth-pagina .auth-visual h2 { color: #fff; font-family: var(--font-titulo); font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.auth-visual h2 span { color: #7DDC80; }
.auth-visual p { margin: 0; color: rgba(255, 255, 255, .78); font-size: var(--fs-base); }
.auth-visual-itens { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.auth-visual-itens li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-sm); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.auth-lado { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; gap: var(--sp-5); position: relative; min-height: 100vh; }
.auth-lado-topo { position: absolute; top: 20px; right: 24px; }
.auth-dividida .auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--sp-5); animation: auth-sobe .5s var(--ease) both; }
.auth-dividida .auth-marca { display: flex; justify-content: flex-start; }
.auth-logo { width: 150px; height: auto; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: var(--shadow-md); }
.auth-titulo h1 { font-family: var(--font-titulo); font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-titulo p { margin: 0; }
.auth-input { position: relative; display: block; }
.auth-input > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 18px; pointer-events: none; }
.auth-input .input { padding-left: 40px; height: 46px; }
.auth-input .input[type="password"], .auth-input .input[name="senha"] { padding-right: 44px; }
.auth-ver-senha { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: var(--text-dim); border-radius: var(--raio-8); cursor: pointer; display: grid; place-items: center; font-size: 18px; }
.auth-ver-senha:hover { color: var(--text); background: var(--surface-2); }
.auth-entrar { height: 46px; font-size: var(--fs-base); }
.auth-ajuda { margin: 0; font-size: var(--fs-sm); color: var(--text-dim); text-align: center; }
.auth-copy { position: absolute; bottom: 20px; margin: 0; font-size: var(--fs-xs); color: var(--text-dim); }
@keyframes auth-sobe { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .auth-pagina.auth-dividida { grid-template-columns: 1fr; }
  .auth-visual { padding: 28px 20px 32px; }
  .auth-visual-banner, .auth-visual-itens, .auth-visual p { display: none; }
  .auth-pagina .auth-visual h2 { font-size: 22px; }
  .auth-visual-conteudo { gap: var(--sp-3); }
  .auth-lado { min-height: auto; padding: 16px 16px 64px; }
  .auth-lado-topo { position: static; align-self: flex-end; }
  .auth-dividida .auth-marca { justify-content: center; }
  .auth-titulo { text-align: center; }
}

/* Início: blocos coloridos por módulo (cada um abre as telas num pop-up) */
.inicio-topo { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; }
.inicio-ola { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.inicio-ola span { color: var(--accent-texto); }
.inicio-busca { position: relative; width: min(320px, 100%); }
.inicio-busca i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 17px; pointer-events: none; }
.inicio-busca .input { height: 42px; padding-left: 38px; border-radius: 12px; }
.inicio-blocos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(140px, 160px)); }
.inicio-bloco {
  position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 14px; padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; text-align: left;
  color: #fff; font: inherit; box-shadow: 0 6px 18px rgba(19, 38, 57, .18);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.inicio-bloco:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(19, 38, 57, .26); filter: brightness(1.05); }
.inicio-bloco:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--accent); }
.inicio-bloco-qtd { position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .22); font-size: 11px; font-weight: 700; }
.inicio-bloco-ico { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -62%); font-size: 40px; }
.inicio-bloco-nome { font-family: var(--font-titulo); font-size: 14px; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.inicio-bloco.cor-0 { background: linear-gradient(145deg, #3b82f6, #1d4ed8); }
.inicio-bloco.cor-1 { background: linear-gradient(145deg, #f59e0b, #c2410c); }
.inicio-bloco.cor-2 { background: linear-gradient(145deg, #a855f7, #6d28d9); }
.inicio-bloco.cor-3 { background: linear-gradient(145deg, #0e7490, #1e3a8a); }
.inicio-bloco.cor-4 { background: linear-gradient(145deg, #22c55e, #15803d); }
.inicio-bloco.cor-5 { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.inicio-bloco.cor-6 { background: linear-gradient(145deg, #f97316, #c2410c); }
.inicio-bloco.cor-7 { background: linear-gradient(145deg, #6366f1, #4338ca); }
.inicio-bloco.cor-8 { background: linear-gradient(145deg, #ec4899, #be185d); }
.inicio-bloco.cor-9 { background: linear-gradient(145deg, #2563eb, #1e40af); }
.inicio-bloco.cor-10 { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.inicio-bloco.cor-11 { background: linear-gradient(145deg, #eab308, #a16207); }
.inicio-telas { gap: var(--sp-2); }
.inicio-tela { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: var(--fs-sm); font-weight: 600; transition: border-color .12s ease, background .12s ease; }
.inicio-tela:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.inicio-tela > span:nth-child(2) { flex: 1; }
.inicio-tela-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-texto); font-size: 18px; }
.inicio-tela-seta { color: var(--text-dim); }
@media (max-width: 720px) { .inicio-blocos { grid-template-columns: repeat(2, 1fr); gap: 12px; } .inicio-ola { font-size: 24px; } }

/* ---------- Tabela premium (plano de design, Fase B) ---------- */
/* Rolagem própria: o cabeçalho fica fixo e a primeira coluna acompanha o scroll horizontal */
[data-tabela-paginada="1"] .tabela-wrap { max-height: calc(100vh - 280px); min-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--raio-8); }
.tabela thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  height: 40px; padding: 0 var(--sp-3);
}
.tabela thead tr.ta-filtros th { top: 40px; text-transform: none; letter-spacing: 0; height: auto; padding: var(--sp-1) var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--border); }
.tabela td { height: var(--linha-h); padding: 0 var(--sp-3); white-space: nowrap; transition: background var(--dur-1) var(--ease); }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tr:hover td { background: var(--accent-suave); }
.tabela tbody tr.sel td { background: var(--accent-soft); }
.tabela tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.densa .tabela td { height: var(--linha-h-densa); }
.densa .tabela thead th { height: 34px; }
.densa .tabela thead tr.ta-filtros th { top: 34px; }
[data-tabela-paginada="1"] .tabela tbody td:first-child:not(.col-sel),
[data-tabela-paginada="1"] .tabela thead th:first-child:not(.col-sel) { position: sticky; left: 0; z-index: 1; background: var(--surface); }
[data-tabela-paginada="1"] .tabela thead th:first-child:not(.col-sel) { z-index: 3; background: var(--surface-2); }
[data-tabela-paginada="1"] .tabela tr:hover td:first-child:not(.col-sel), [data-tabela-paginada="1"] .tabela tr.sel td:first-child:not(.col-sel) { background: linear-gradient(var(--accent-suave), var(--accent-suave)), var(--surface); }

/* Ordenação: caret Phosphor, coluna ordenada sai do tom apagado */
.tabela th.ord-asc::after, .tabela th.ord-desc::after { content: none; }
.tabela th .ta-seta { margin-left: var(--sp-1); font-size: 12px; color: var(--accent-texto); vertical-align: -1px; }
.tabela th.ord-asc, .tabela th.ord-desc { color: var(--text); }
.tabela td.num.neg { color: var(--danger-texto); }

/* Ações da linha: sempre visíveis; editar na cor da marca, excluir em vermelho */
.tabela td.acoes .btn-icone { width: 32px; height: 32px; font-size: 18px; color: var(--accent-texto); }
.tabela td.acoes .btn-icone:hover { background: var(--accent-soft); color: var(--accent-texto); }
.tabela td.acoes .btn-perigo-icone { color: var(--danger-texto); }
.tabela td.acoes .btn-perigo-icone:hover { color: var(--danger-texto); background: var(--danger-soft); }

/* Cabeçalho da tabela: título, chips de filtro e ferramentas */
.ta-cab h3 { display: flex; align-items: baseline; gap: var(--sp-2); }
.ta-total { font-family: var(--font); font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); background: var(--surface-2); border-radius: 999px; padding: 1px var(--sp-2); }
.ta-ferramentas { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; }
.ta-ferramentas .btn-icone.on { color: var(--accent-texto); background: var(--accent-soft); }
.ta-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.ta-chips:empty { display: none; }
.ta-chip { display: inline-flex; align-items: center; gap: var(--sp-1); height: 28px; padding: 0 var(--sp-1) 0 var(--sp-3); border-radius: 999px; border: 1px solid var(--accent); background: var(--accent-suave); color: var(--accent-texto); font-size: var(--fs-xs); font-weight: 600; }
.ta-chip b { font-weight: 700; color: var(--text); }
.ta-chip button { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.ta-chip button:hover { background: var(--accent-soft); }
.ta-chip-limpar { border: 0; background: none; color: var(--text-dim); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; padding: 0 var(--sp-2); }
.ta-chip-limpar:hover { color: var(--danger-texto); }
.ta-menu, .ta-painel { box-shadow: var(--shadow-md); }

/* Carregando: skeleton na primeira carga; depois, linhas esmaecidas + barra fina no topo */
.ta-esq td { pointer-events: none; }
.ta-esq span { display: block; height: 10px; border-radius: 4px; width: 70%;
  background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 40%, var(--surface)) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: ta-brilho 1.2s linear infinite; }
.ta-esq td:nth-child(odd) span { width: 45%; }
@keyframes ta-brilho { to { background-position: -200% 0; } }
.tabela-wrap.carregando::after { content: ""; position: absolute; z-index: 4; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: ta-barra 1s var(--ease) infinite; display: block; }
.tabela-wrap.carregando .tabela tbody { opacity: .55; transition: opacity var(--dur-2) var(--ease); }
@keyframes ta-barra { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* Estado vazio dentro da tabela */
.tabela-wrap .vz { padding: var(--sp-6) var(--sp-4) calc(var(--sp-6) + var(--sp-2)); }
.vz .vz-icone { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--raio-12); background: var(--accent-soft); }
.vz .vz-icone i { font-size: 28px; }
.vz p { max-width: 360px; font-size: var(--fs-sm); }

/* Rodapé de paginação */
.oc-pag { border-top: 0; margin-top: 0; }

/* Barra de seleção em lote: pílula flutuante */
.tsel-bar { left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width)) / 2); right: auto; bottom: var(--sp-5); transform: translateX(-50%);
  max-width: calc(100vw - var(--sidebar-width) - 48px); border-radius: var(--raio-12); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: var(--text); color: var(--bg); font-size: var(--fs-sm); box-shadow: var(--shadow-lg); animation: tsel-flutua var(--dur-2) var(--ease); }
@keyframes tsel-flutua { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 880px) { .tsel-bar { left: 50%; max-width: calc(100vw - 32px); padding: var(--sp-2) var(--sp-3); } }
.vz .btn i { font-size: 17px; color: inherit; }

/* ---------- Pop-up premium (plano de design, Fase C) ---------- */
dialog.popup-centrado { border-radius: var(--raio-18); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.popup-centrado[open] { animation: modal-entra var(--dur-2) var(--ease); }
dialog.popup-centrado[open]::backdrop { backdrop-filter: blur(4px); animation: fundo-entra var(--dur-2) var(--ease); }
@keyframes modal-entra { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fundo-entra { from { opacity: 0; } to { opacity: 1; } }
dialog.modal-md { max-width: min(640px, 92vw); }
dialog.modal-lg { max-width: min(920px, 92vw); }

.modal-cab { gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-5); }
.modal-cab-titulo { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.modal-cab-icone { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--raio-8); background: var(--accent-soft); color: var(--accent-texto); font-size: 19px; }
.modal-cab-textos { min-width: 0; }
.modal-cab-textos h3 { line-height: 1.25; }
.modal-sub { font-size: var(--fs-xs); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-sub:empty { display: none; }

/* Corpo: grade de 2 colunas fixas; campo largo ocupa as duas */
dialog.popup-centrado .grade-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
dialog.modal-lg .grade-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade-form .campo-largo { grid-column: 1 / -1; }
.grade-form .campo-num, .grade-form .campo-data { min-width: 0; }
dialog.popup-centrado .rotulo { color: var(--text); font-weight: 600; }
.obrig { color: var(--danger-texto); margin-left: 2px; }
.campo-ajuda { font-size: var(--fs-xs); color: var(--text-dim); line-height: 1.4; }
.campo-erro-msg { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--danger-texto); }
.input-sufixo { position: relative; display: block; }
.input-sufixo .input { padding-right: 44px; }
.input-sufixo-txt { position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); font-weight: 600; color: var(--text-dim); pointer-events: none; }
.modal-aviso:not(:empty) { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--raio-8); background: var(--danger-soft); }
.xx-tab.com-erro::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }

/* Rodapé: Ativo e Excluir à esquerda, ações à direita */
.modal-rodape { justify-content: space-between; align-items: center; }
dialog.popup-centrado .modal-rodape { background: var(--surface-2); }
.modal-rodape-esq, .modal-rodape-dir { display: flex; align-items: center; gap: var(--sp-3); }
.modal-rodape-dir { margin-left: auto; gap: var(--sp-2); }
.modal-rodape .linha-toggle { margin: 0; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; }
.btn-texto-perigo { border: 0; background: none; color: var(--danger-texto); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1) var(--sp-2); border-radius: var(--raio-6); }
.btn-texto-perigo:hover { background: var(--danger-soft); }
.atalho { font-family: inherit; font-size: var(--fs-2xs); font-weight: 600; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: var(--sp-1); }
.btn.salvando { pointer-events: none; opacity: .8; }
.btn.salvando i { display: none; }
.btn.salvando::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: giro .7s linear infinite; }

@media (max-width: 720px) {
  dialog.popup-centrado:not(.modal-sm) { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; border: 0; }
  dialog.popup-centrado:not(.modal-sm) > form { max-height: 100dvh; height: 100%; }
  dialog.popup-centrado .grade-form, dialog.modal-lg .grade-form { grid-template-columns: 1fr; }
  .atalho { display: none; }
}
.xx-tabs { overflow-y: hidden; scrollbar-width: none; }

/* ---------- Painel de consulta (plano de design, Fase D) ---------- */
dialog.painel-lateral {
  margin: 0 0 0 auto; padding: 0; border: 0; border-left: 1px solid var(--border);
  width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.painel-lateral[open] { display: flex; flex-direction: column; animation: painel-entra var(--dur-2) var(--ease); }
dialog.painel-lateral::backdrop { background: rgba(11, 18, 32, .35); backdrop-filter: blur(2px); }
@keyframes painel-entra { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.pl-cab { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.pl-cab-textos { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.pl-cab-textos h3 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.pl-meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-dim); }
.pl-acoes { display: flex; align-items: center; gap: var(--sp-1); }
.pl-barra { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text-dim); }
.pl-nav { display: flex; gap: var(--sp-1); }
.pl-nav .btn-icone { width: 32px; height: 32px; font-size: 16px; }
.pl-corpo { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-5); }
.pl-secao h4 { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
.pl-dl { margin: 0; display: grid; grid-template-columns: minmax(120px, 40%) 1fr; border: 1px solid var(--border); border-radius: var(--raio-8); overflow: hidden; }
.pl-dl dt, .pl-dl dd { margin: 0; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); border-bottom: 1px solid var(--border); }
.pl-dl dt { color: var(--text-dim); background: var(--surface-2); }
.pl-dl dd { font-weight: 500; overflow-wrap: anywhere; }
.pl-dl dd.num { font-variant-numeric: tabular-nums; }
.pl-dl dd.vazio { color: var(--text-dim); font-weight: 400; }
.pl-dl dt:nth-last-child(2), .pl-dl dd:last-child { border-bottom: 0; }
[data-consulta] .tabela tbody tr:not(.ta-esq) { cursor: pointer; }
@media (max-width: 520px) { .pl-dl { grid-template-columns: 1fr; } .pl-dl dt { border-bottom: 0; padding-bottom: 0; background: none; } }

/* Painel de consulta: abas Estoque e Movimentos */
.pl-abas { margin: 0; padding: 0 var(--sp-5); }
.pl-painel { display: flex; flex-direction: column; gap: var(--sp-5); }
.pl-painel[hidden] { display: none; }
.pl-carregando { color: var(--text-dim); font-size: var(--fs-sm); padding: var(--sp-4) 0; }
.pl-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.pl-kpi { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--raio-8); background: var(--surface-2); }
.pl-kpi-rot { font-size: var(--fs-xs); color: var(--text-dim); }
.pl-kpi strong { font-family: var(--font-titulo); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.pl-kpi.neg strong { color: var(--danger-texto); }
.pl-linha-tempo { list-style: none; margin: 0; padding: 0; position: relative; }
.pl-linha-tempo::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.pl-mov { position: relative; display: flex; gap: var(--sp-3); padding: 0 0 var(--sp-4); }
.pl-mov-ponto { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--surface); border: 2px solid var(--neutro); position: relative; z-index: 1; }
.pl-mov-producao .pl-mov-ponto, .pl-mov-entrada .pl-mov-ponto { border-color: var(--success); }
.pl-mov-expedicao .pl-mov-ponto, .pl-mov-consumo .pl-mov-ponto { border-color: var(--accent); }
.pl-mov-ajuste .pl-mov-ponto { border-color: var(--warning); }
.pl-mov-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.pl-mov-topo { display: flex; justify-content: space-between; gap: var(--sp-2); }
.pl-mov-qtd { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--marca-verde-texto); white-space: nowrap; }
.pl-mov-qtd.neg { color: var(--danger-texto); }
.pl-mov-meta { font-size: var(--fs-xs); color: var(--text-dim); }
.pl-mov-obs { font-size: var(--fs-xs); color: var(--text); background: var(--surface-2); border-radius: var(--raio-6); padding: var(--sp-1) var(--sp-2); align-self: flex-start; }

/* Fase E: valor do KPI cabe no cartão em telas de celular */
@media (max-width: 420px) { .mg-kpi .val { font-size: clamp(15px, 4.4vw, 22px); letter-spacing: -.3px; } }

/* Barra do topo no celular: o título ganha espaço (alternador só com o interruptor, ações mais justas) */
@media (max-width: 520px) {
  .topbar { gap: var(--sp-2); padding: 0 var(--sp-3); }
  .tb-titulo { min-width: 64px; }
  .tb-acoes { gap: 2px; flex: none; }
  .tema-alternador > i { display: none; }
  .tb-acoes .btn, .tb-acoes .btn-icone { width: 40px; }
}

/* ---------- Calendário próprio (calendario.js) ---------- */
.cal-campo { position: relative; display: block; width: 100%; }
.cal-original { display: none !important; }
.cal-campo .cal-display { width: 100%; padding-right: 40px; font-variant-numeric: tabular-nums; }
.cal-botao { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: var(--raio-6); background: transparent; color: var(--text-dim); display: grid; place-items: center; font-size: 18px; cursor: pointer; }
.cal-botao:hover { color: var(--accent-texto); background: var(--accent-soft); }
.cal-campo:has(.cal-original.campo-invalido) .cal-display { border-color: var(--danger); }
.cal-pop { position: fixed; z-index: 1300; display: none; width: 296px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); color: var(--text); font-size: var(--fs-sm); }
.cal-pop.aberto { display: block; animation: cal-entra var(--dur-2) var(--ease); }
@keyframes cal-entra { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-titulo { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text); font-family: var(--font-titulo); font-weight: 700; font-size: 15px; padding: 6px 8px; border-radius: var(--raio-8); cursor: pointer; }
.cal-titulo i { font-size: 13px; color: var(--text-dim); }
.cal-titulo:hover { background: var(--surface-2); }
.cal-nav { display: flex; gap: 2px; }
.cal-seta { width: 32px; height: 32px; border: 0; border-radius: var(--raio-8); background: transparent; color: var(--text-dim); display: grid; place-items: center; font-size: 16px; cursor: pointer; }
.cal-seta:hover { background: var(--surface-2); color: var(--text); }
.cal-grade { display: grid; gap: 2px; }
.cal-dias { grid-template-columns: repeat(7, 1fr); }
.cal-meses { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.cal-sem { text-align: center; font-size: var(--fs-2xs); font-weight: 700; color: var(--text-dim); padding: 4px 0 6px; }
.cal-dia, .cal-cel { border: 0; background: transparent; color: var(--text); border-radius: 9px; cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; position: relative; transition: background var(--dur-1) var(--ease); }
.cal-dia { height: 36px; }
.cal-cel { height: 48px; font-weight: 600; }
.cal-dia:hover, .cal-cel:hover { background: var(--surface-2); }
.cal-dia.fora { color: var(--text-dim); opacity: .55; }
.cal-dia.hoje, .cal-cel.hoje { color: var(--accent-texto); font-weight: 700; }
.cal-dia.hoje::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cal-dia.sel, .cal-cel.sel, .cal-dia.sel:hover, .cal-cel.sel:hover { background: var(--accent); color: var(--accent-texto-sobre); font-weight: 700; opacity: 1; }
.cal-dia:disabled, .cal-cel:disabled { opacity: .3; cursor: not-allowed; background: transparent; }
.cal-dia:focus-visible, .cal-cel:focus-visible, .cal-titulo:focus-visible, .cal-seta:focus-visible, .cal-link:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--accent-sombra); }
.cal-rodape { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.cal-link { border: 0; background: transparent; color: var(--text-dim); font: inherit; font-weight: 600; padding: 6px 10px; border-radius: var(--raio-8); cursor: pointer; }
.cal-link.forte { color: var(--accent-texto); }
.cal-link:hover { background: var(--surface-2); }
.cal-link:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Lista suspensa: largura mínima para o texto caber ---------- */
.sb-panel { min-width: 240px; max-width: calc(100vw - 16px); }
.sb-opt { line-height: 1.35; }

/* ---------- Cartões de resumo do topo (mg-kpi), visual novo ---------- */
.mg-kpis { gap: 14px; }
.mg-kpi { --kpi-cor: var(--accent); --kpi-texto: var(--accent-texto); --kpi-soft: var(--accent-soft);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 4px 12px;
  padding: 18px 18px 16px; border-radius: 16px; border: 1px solid var(--border);
  background: radial-gradient(160px 120px at 100% 0%, var(--kpi-soft), transparent 70%), var(--surface);
  box-shadow: var(--shadow-md); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.mg-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--kpi-cor) 35%, var(--border)); }
.mg-kpi::before { display: block; content: ""; position: absolute; left: 18px; right: auto; top: auto; bottom: 0; width: 32px; height: 3px; border-radius: 3px 3px 0 0; background: var(--kpi-cor); }
.mg-kpi .corpo { grid-column: 1; grid-row: 1; }
.mg-kpi .ico { grid-column: 2; grid-row: 1; width: 40px; height: 40px; border-radius: 12px; font-size: 20px; background: var(--kpi-soft); color: var(--kpi-texto); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--kpi-cor) 22%, transparent); }
.mg-kpi .lbl { min-height: 0; display: block; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; color: var(--text-dim); margin-bottom: 8px; }
.mg-kpi .val { font-family: var(--font-titulo); font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-top: 0; }
.mg-kpi .disc { margin-top: 6px; min-height: 0; font-style: normal; font-size: var(--fs-xs); }
.mg-kpi.ac-meta { --kpi-cor: var(--marca-verde); --kpi-texto: var(--marca-verde-texto); --kpi-soft: var(--success-soft); }
.mg-kpi.ac-horas { --kpi-cor: var(--info); --kpi-texto: var(--accent-texto); --kpi-soft: var(--info-soft); }
.mg-kpi.ac-parada { --kpi-cor: var(--warning); --kpi-texto: var(--warning-texto); --kpi-soft: var(--warning-soft); }
.mg-kpi.pos { --kpi-cor: var(--success); --kpi-texto: var(--marca-verde-texto); --kpi-soft: var(--success-soft); }
.mg-kpi.neg { --kpi-cor: var(--danger); --kpi-texto: var(--danger-texto); --kpi-soft: var(--danger-soft); }
.mg-kpi.ac-meta .ico, .mg-kpi.ac-horas .ico, .mg-kpi.ac-parada .ico, .mg-kpi.pos .ico, .mg-kpi.neg .ico { background: var(--kpi-soft); color: var(--kpi-texto); }
@media (max-width: 720px) {
  .mg-kpi { padding: 14px 14px 12px; gap: 2px 8px; }
  .mg-kpi .ico { width: 32px; height: 32px; font-size: 16px; border-radius: 10px; }
  .mg-kpi .val { font-size: 20px; }
  .mg-kpi::before { left: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mg-kpi:hover { transform: none; } }
