:root {
  --azul: #1f4e79;
  --azul-claro: #2e6da4;
  --navy1: #0c1c3a;
  --navy2: #11264a;
  --cinza-bg: #f4f6f9;
  --borda: #d9dee5;
  --verde: #1a7f37;
  --vermelho: #c0392b;
  --texto: #2b333b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--cinza-bg);
  color: var(--texto);
}
.oculto { display: none !important; }

/* ===================== LOGIN (padrao CCS DataVision) ===================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #0c1c3a 0%, #11264a 50%, #0a1733 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 40px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.login-logo img { height: 80px; width: auto; object-fit: contain; }
.login-title { font-size: 26px; font-weight: 700; color: #1e293b; text-align: center; margin: 0; letter-spacing: -0.5px; }
.login-subtitle { font-size: 14px; color: #64748b; text-align: center; margin: 6px 0 26px; }
.login-field { display: block; margin-bottom: 16px; }
.login-field span { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.login-field input {
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #1e293b;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.login-field input::placeholder { color: #94a3b8; }
.login-msg { font-size: 13px; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; text-align: center; }
.login-msg-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.login-btn {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, transform .1s, opacity .15s;
}
.login-btn:hover { background: #1d4ed8; }
.login-btn:active { transform: scale(.99); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ===================== APP SHELL ===================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy1) 0%, var(--navy2) 100%);
  color: #cfd8e8;
  display: flex;
  flex-direction: column;
  transition: width .18s ease;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { height: 38px; width: auto; }
.sidebar-brand span { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; }

.menu { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  color: #cfd8e8;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background .15s, color .15s;
}
.menu-item svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; }
.menu-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-item.ativo { background: var(--azul-claro); color: #fff; font-weight: 600; }
.menu-item.breve { opacity: .5; cursor: default; }
.menu-item.breve:hover { background: none; color: #cfd8e8; }
.menu-item .tag-breve { margin-left: auto; font-size: 9px; background: rgba(255,255,255,.15); padding: 2px 6px; border-radius: 10px; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-foot { padding: 14px 18px; font-size: 11px; color: #6b7a93; border-top: 1px solid rgba(255,255,255,.08); }

/* [05/10/2026 - Alexandre Carvalho] Modulos do menu (Vendas, Materiais, Logistica, Manufatura): um aberto por vez.
   A barra lateral fica presa na altura da janela: em tela longa (Painel de Producao) o rodape com Usuarios
   ia para o fim da pagina. O menu rola por dentro se nao couber. */
.sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; }
.menu { overflow-y: auto; min-height: 0; }
.menu-grupo { display: flex; flex-direction: column; gap: 2px; }
.menu-grupo-cab {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: none; border-radius: 8px; background: none;
  color: #cfd8e8; font-size: 14px; font-weight: 600; font-family: inherit; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.menu-grupo-cab svg { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; }
.menu-grupo-cab:hover { background: rgba(255,255,255,.07); color: #fff; }
.menu-grupo.contem-ativo > .menu-grupo-cab { color: #fff; }
.menu-grupo-seta { margin-left: auto; display: inline-flex; transition: transform .15s; }
.menu-grupo-seta svg { width: 14px; height: 14px; }
.menu-grupo.aberto .menu-grupo-seta { transform: rotate(90deg); }
.menu-grupo-itens { display: none; flex-direction: column; gap: 2px; padding-left: 14px; }
.menu-grupo.aberto .menu-grupo-itens { display: flex; }
.menu-grupo-itens .menu-item { padding: 9px 12px; font-size: 13.5px; }
.menu-grupo-itens .menu-item svg { width: 18px; height: 18px; }
.menu-rodape { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; }

/* ----- Sidebar recolhida (trilho de icones) ----- */
.app.sidebar-collapsed .sidebar { width: 60px; }
.app.sidebar-collapsed .sidebar-brand span,
.app.sidebar-collapsed .menu-item span,
.app.sidebar-collapsed .sidebar-foot { display: none; }
.app.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 16px 0; }
.app.sidebar-collapsed .menu-item { justify-content: center; padding: 11px 0; gap: 0; }
/* [05/10/2026] recolhido: so o icone do modulo; clicar expande a barra e abre o modulo */
.app.sidebar-collapsed .menu-grupo-cab span { display: none; }
.app.sidebar-collapsed .menu-grupo-cab { justify-content: center; padding: 11px 0; gap: 0; }
.app.sidebar-collapsed .menu-grupo-itens { display: none; }

.topbar-left { display: flex; align-items: center; gap: 14px; }
.btn-toggle {
  background: #fff; border: 1px solid var(--borda); border-radius: 6px;
  width: 34px; height: 34px; cursor: pointer; color: var(--azul);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-toggle svg { width: 20px; height: 20px; }
.btn-toggle:hover { background: #eef2f7; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--borda);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--azul); }
.user-box { display: flex; align-items: center; gap: 14px; }
.user-name { font-size: 13px; color: #66707a; font-weight: 600; }
#btnSair {
  background: #fff; border: 1px solid var(--borda); color: #66707a;
  padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit;
}
#btnSair:hover { background: #fef2f2; border-color: #fecaca; color: var(--vermelho); }

#conteudo { padding: 20px 24px; overflow: auto; }
.tela { max-width: 1180px; margin: 0 auto; }
.em-breve { background: #fff; border: 1px dashed var(--borda); border-radius: 10px; padding: 60px 24px; text-align: center; color: #8a949e; }
.em-breve h3 { color: var(--azul); margin: 0 0 8px; }

/* ===================== ABAS (Kardex Mega / CCS) ===================== */
.abas { display: flex; gap: 4px; border-bottom: 2px solid var(--borda); margin-bottom: 16px; }
.aba {
  background: none; border: none; padding: 10px 22px; font-size: 14px; font-weight: 600;
  color: #66707a; cursor: pointer; font-family: inherit;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.aba:hover { color: var(--azul); }
.aba.ativa { color: var(--azul); border-bottom-color: var(--azul-claro); }

/* ===================== FILTROS / KARDEX ===================== */
.filtros {
  display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
  background: #fff; padding: 16px 18px; border: 1px solid var(--borda); border-radius: 8px;
}
.campo { display: flex; flex-direction: column; }
.campo label { font-size: 12px; color: #66707a; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.campo input, .campo select { padding: 8px 10px; border: 1px solid var(--borda); border-radius: 6px; font-size: 14px; min-width: 150px; }
.item-input { display: flex; gap: 6px; }
.item-input input { min-width: 120px; }
#btnBuscarItem {
  background: #fff; border: 1px solid var(--borda); border-radius: 6px;
  width: 38px; flex-shrink: 0; cursor: pointer; color: var(--azul-claro);
  display: flex; align-items: center; justify-content: center;
}
#btnBuscarItem svg { width: 18px; height: 18px; }
#btnBuscarItem:hover { background: #eef2f7; }

/* ----- Modal de busca de item ----- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(12, 28, 58, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 720px;
  max-height: 78vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--borda);
  font-size: 16px; font-weight: 700; color: var(--azul);
}
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: #8a949e; cursor: pointer; }
.modal-close:hover { color: var(--vermelho); }
#itemBusca { margin: 14px 18px 8px; padding: 11px 14px; border: 1px solid var(--borda); border-radius: 8px; font-size: 15px; outline: none; }
#itemBusca:focus { border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(46,109,164,.15); }
.modal-body { overflow-y: auto; margin: 4px 0 8px; }
.modal-body table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.modal-body thead th { position: sticky; top: 0; background: #eef2f7; text-align: left; padding: 8px 18px; border-bottom: 1px solid var(--borda); }
.modal-body tbody td { padding: 8px 18px; border-bottom: 1px solid #eef1f4; }
.modal-body tbody tr.clicavel { cursor: pointer; }
.modal-body tbody tr.clicavel:hover { background: #e3edf7; }
.modal-body tbody tr.vazio td { text-align: center; color: #8a949e; padding: 22px; }

#btnBuscar {
  background: var(--azul-claro); color: #fff; border: 0; padding: 10px 22px;
  border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; height: 38px;
}
#btnBuscar:hover { background: var(--azul); }
#btnBuscar:disabled { opacity: .6; cursor: progress; }

.cabecalho {
  margin-top: 18px; background: #fff; border: 1px solid var(--borda); border-radius: 8px;
  padding: 16px 18px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.prod strong { display: block; font-size: 17px; }
.prod .meta { color: #66707a; font-size: 13px; }
.saldos { display: flex; gap: 12px; flex-wrap: wrap; }
.saldo-box { background: var(--cinza-bg); border: 1px solid var(--borda); border-radius: 6px; padding: 8px 14px; text-align: right; min-width: 130px; }
.saldo-box span { display: block; font-size: 11px; color: #66707a; text-transform: uppercase; }
.saldo-box b { font-size: 18px; }
.saldo-box .ent { color: var(--verde); }
.saldo-box .sai { color: var(--vermelho); }
.saldo-box.final { background: var(--azul); }
.saldo-box.final span, .saldo-box.final b { color: #fff; }

.aviso { margin-top: 14px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.aviso.erro { background: #fdecea; color: var(--vermelho); border: 1px solid #f5c6cb; }
.aviso.info { background: #fff8e1; color: #8a6d00; border: 1px solid #ffe08a; }

.tabela-wrap { margin-top: 16px; background: #fff; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; }

/* Grid do Kardex com rolagem propria, mantendo a Caracteristica visivel abaixo */
#kardexGrid { max-height: 46vh; overflow-y: auto; }
#kardexGrid thead th { z-index: 2; }
#saldoGrid { max-height: 62vh; overflow-y: auto; }
.caract-wrap .tabela-wrap { max-height: 30vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th { background: #eef2f7; text-align: left; padding: 6px 8px; border-bottom: 2px solid var(--borda); position: sticky; top: 0; white-space: nowrap; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td { padding: 3px 8px; border-bottom: 1px solid #eef1f4; line-height: 1.3; }
tbody tr.linha-ent { background: #f0faf3; box-shadow: inset 3px 0 0 #9fd8b4; }
tbody tr.linha-sai { background: #fdf1f0; box-shadow: inset 3px 0 0 #e2a8a1; }
tbody tr:hover { background: #f7fafc; }
tbody tr.linha-ent:hover { background: #e6f5ec; }
tbody tr.linha-sai:hover { background: #fbe7e5; }
td.ent { color: var(--verde); }
td.sai { color: var(--vermelho); }
td.saldo { font-weight: 600; }
tr.saldo-ant td { background: #f0f4f8; font-style: italic; color: #555; }
tr.vazio td { text-align: center; color: #8a949e; padding: 28px; }

tbody tr.clicavel { cursor: pointer; }
tbody tr.sel { outline: 2px solid var(--azul-claro); outline-offset: -2px; background: #e3edf7 !important; }

/* ===================== CARACTERÍSTICA DE ESTOQUE ===================== */
.caract-wrap { margin-top: 18px; }
.caract-head {
  font-size: 14px; font-weight: 700; color: var(--azul);
  padding: 4px 2px 10px; display: flex; align-items: baseline; gap: 8px;
}
.caract-ctx { font-weight: 400; font-size: 12px; color: #8a949e; }
.caract-wrap table { font-size: 13px; }
.caract-wrap thead th { background: #e9f0f7; }

/* ===================== TOOLBAR (Carteira / Ordens) ===================== */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; padding: 12px 14px; border: 1px solid var(--borda); border-radius: 8px;
}
.toolbar .spacer { flex: 1; }
.toolbar-search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px; max-width: 460px;
  border: 1px solid var(--borda); border-radius: 8px; padding: 0 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar-search:focus-within { border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(46,109,164,.15); }
.toolbar-search svg { width: 17px; height: 17px; color: #8a949e; flex-shrink: 0; }
.toolbar-search input { border: 0; outline: 0; padding: 9px 0; font-size: 14px; width: 100%; background: transparent; font-family: inherit; }
.btn-primary {
  background: var(--azul-claro); color: #fff; border: 0; padding: 9px 18px;
  border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.btn-primary:hover { background: var(--azul); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost {
  background: #fff; color: #66707a; border: 1px solid var(--borda); padding: 9px 16px;
  border-radius: 7px; font-size: 14px; cursor: pointer; font-family: inherit; transition: background .15s, color .15s;
}
.btn-ghost:hover { background: #eef2f7; color: var(--azul); }
/* [14/08/2026 - Alexandre Carvalho] Ação destrutiva (confirmação de exclusão) */
.btn-danger {
  background: var(--vermelho); color: #fff; border: 0; padding: 9px 18px;
  border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: filter .15s;
}
.btn-danger:hover { filter: brightness(.88); }
.btn-danger:disabled { opacity: .6; cursor: progress; }
.btn-obs.btn-excluir:hover { background: #fdeeee; color: var(--vermelho); border-color: var(--vermelho); }
.col-acao { text-align: center; width: 44px; }
.confirm-msg { padding: 14px 18px 4px; font-size: 14px; color: var(--texto); line-height: 1.55; }
.rel-form { padding: 12px 18px 0; }
/* [14/08/2026 - Alexandre Carvalho] Linha de total do dia na lista "Meus apontamentos" */
.frac-total td { background: #f2f7ff; border-top: 2px solid #cfe0f5; color: var(--azul); }
/* [14/08/2026 - Alexandre Carvalho] Tela Embalagem Padrao */
.embpad-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--azul-claro); vertical-align: middle; }
/* [14/08/2026 - Alexandre Carvalho] Lookup (input com dropdown de resultados) */
.lookup-campo { position: relative; min-width: 420px; }
.lookup-campo input {
  width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--borda);
  border-radius: 7px; font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
.lookup-campo input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.lookup-drop {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 60; background: #fff;
  border: 1px solid var(--borda); border-radius: 8px; margin-top: 4px; max-height: 320px;
  overflow-y: auto; box-shadow: 0 12px 26px -12px rgba(15, 40, 80, .4);
}
.lookup-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.lookup-item:last-child { border-bottom: 0; }
.lookup-item:hover { background: #f2f7ff; }
.lookup-item b { display: block; font-size: 13px; color: var(--texto); }
.lookup-item span { color: #66707a; font-size: 12.5px; }
.lookup-vazio { padding: 10px 12px; color: #8a949e; font-size: 13px; }
/* [14/08/2026 - Alexandre Carvalho] Tela Permissoes */
.perm-telas { max-width: 560px; white-space: normal; }
.perm-tela { display: inline-flex; align-items: center; gap: 5px; margin: 3px 12px 3px 0; font-size: 12.5px; color: var(--texto); white-space: nowrap; cursor: pointer; }
.perm-tela input { accent-color: var(--azul-claro); cursor: pointer; }
/* [05/10/2026] permissoes agrupadas pelos modulos do menu */
.perm-grupo { margin: 2px 0 6px; }
.perm-grupo-nome { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--azul); margin-bottom: 1px; }
.col-acao button + button { margin-left: 6px; }
.usu-nome { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--borda); border-radius: 6px; font-size: 13px; font-family: inherit; }
.count-chip { font-size: 12.5px; color: #66707a; background: var(--cinza-bg); border: 1px solid var(--borda); padding: 6px 12px; border-radius: 20px; font-weight: 600; white-space: nowrap; }

/* Botões de exportação (Excel / PDF) */
.exp-group { display: inline-flex; gap: 6px; }
.btn-exp { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 8px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--borda); background: #fff; cursor: pointer; font-family: inherit; color: #556; transition: background .15s, border-color .15s, color .15s; }
.btn-exp svg { width: 15px; height: 15px; }
.btn-exp.xls { color: #1a7f37; border-color: #bfe3c8; }
.btn-exp.xls:hover { background: #eaf7ee; }
.btn-exp.pdf { color: #c0392b; border-color: #f2c9c3; }
.btn-exp.pdf:hover { background: #fdecea; }
.btn-exp:disabled { opacity: .5; cursor: not-allowed; }

/* ===================== KPI CARDS ===================== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--azul-claro); }
.kpi.tone-verde::before { background: var(--verde); }
.kpi.tone-amber::before { background: #d99816; }
.kpi.tone-vermelho::before { background: var(--vermelho); }
.kpi.tone-azul::before { background: var(--azul); }
.kpi-ico { width: 38px; height: 38px; border-radius: 9px; background: #eef2f7; color: var(--azul); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi.tone-verde .kpi-ico { background: #e7f5ec; color: var(--verde); }
.kpi.tone-amber .kpi-ico { background: #fdf3e0; color: #b9770a; }
.kpi.tone-vermelho .kpi-ico { background: #fdecea; color: var(--vermelho); }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 11.5px; color: #66707a; text-transform: uppercase; letter-spacing: .03em; }
.kpi-value { font-size: 22px; font-weight: 700; color: var(--texto); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11px; color: #8a949e; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; white-space: nowrap; line-height: 1.5; border: 1px solid transparent;
}
.badge-info    { background: #e7f0fb; color: #1c5aa8; border-color: #cfe0f5; }
.badge-success { background: #e7f5ec; color: #1a7f37; border-color: #c9e9d4; }
.badge-warn    { background: #fdf3e0; color: #99700a; border-color: #f6e2bc; }
.badge-danger  { background: #fdecea; color: #b3271b; border-color: #f5cfc9; }
.badge-neutral { background: #eef1f4; color: #5b6570; border-color: #e0e4e9; }

/* Pill de dias parados */
.pill-dias { display: inline-block; min-width: 34px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill-dias.ok    { background: #e7f5ec; color: #1a7f37; }
.pill-dias.warn  { background: #fdf3e0; color: #99700a; }
.pill-dias.crit  { background: #fdecea; color: #b3271b; }

/* ===================== PROGRESSO (empenho) ===================== */
.progresso { display: inline-flex; align-items: center; gap: 7px; justify-content: flex-end; }
.progresso .barra { width: 52px; height: 7px; border-radius: 4px; background: #e6eaef; overflow: hidden; }
.progresso .barra i { display: block; height: 100%; background: var(--azul-claro); border-radius: 4px; }
.progresso.full .barra i { background: var(--verde); }
.progresso .pct { font-size: 11.5px; font-weight: 600; color: #66707a; min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }

/* ===================== HEADERS ORDENÁVEIS ===================== */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #e3ebf4; }
th.sortable::after { content: "\2195"; opacity: .28; margin-left: 5px; font-size: 10px; }
th.sortable[data-dir="asc"]::after { content: "\2191"; opacity: 1; }
th.sortable[data-dir="desc"]::after { content: "\2193"; opacity: 1; }

/* Telas de dados usam a largura total disponivel */
.tela-wide { max-width: 100%; }
#conteudo:has(.tela-wide:not(.oculto)) { padding: 20px 20px; }

/* Células com corte por reticências (mantém a linha em 1 altura) */
td.cel-descr { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.cel-cliente { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.num { white-space: nowrap; }
td .un { color: #9aa4ad; font-size: 10.5px; }
td.center { text-align: center; }
.grid-hover tbody tr:hover { background: #f2f7fc; }
#cartGrid, #ordGrid { max-height: 68vh; overflow: auto; }
#cartGrid table, #ordGrid table { font-size: 12.5px; }

.mat-sim { color: var(--verde); font-weight: 700; }
.mat-nao { color: #c3cbd3; }

/* Botão de observação na célula */
.btn-obs {
  background: none; border: 1px solid var(--borda); border-radius: 6px; width: 28px; height: 26px;
  cursor: pointer; color: #9aa4ad; display: inline-flex; align-items: center; justify-content: center;
}
.btn-obs svg { width: 15px; height: 15px; }
/* [14/09/2026 - Alexandre Carvalho] os icones SVG usam fill="none": sem stroke ficavam invisiveis (botoes vazios em Carrinhos e Usuarios) */
.btn-obs svg { stroke: currentColor; }
/* botao de acao com texto ao lado do icone (tela Carrinhos) */
.btn-obs.btn-acao-txt { width: auto; padding: 0 9px; gap: 5px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--texto); }
.btn-obs.btn-acao-txt svg { width: 14px; height: 14px; }
.col-acao.col-acao-txt { width: auto; white-space: nowrap; }
.btn-obs:hover { background: #eef2f7; color: var(--azul-claro); border-color: var(--azul-claro); }
.btn-obs.tem { color: var(--azul); border-color: var(--azul-claro); background: #eaf1fa; }
.col-obs { text-align: center; width: 44px; }

/* ===================== MODAL DE OBSERVAÇÃO ===================== */
.modal.modal-sm { max-width: 520px; }
.obs-ctx { padding: 12px 18px; font-size: 13px; color: var(--texto); background: var(--cinza-bg); border-bottom: 1px solid var(--borda); line-height: 1.5; }
.obs-ctx-desc { color: #66707a; }
.obs-sub { margin: 12px 18px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8a949e; }
.obs-hist-wrap { }
.obs-hist { margin: 0 18px; padding: 10px 12px; background: #f7fafc; border: 1px solid var(--borda); border-radius: 8px; font-size: 13px; line-height: 1.55; color: var(--texto); white-space: pre-wrap; max-height: 150px; overflow-y: auto; }
.obs-textarea { margin: 4px 18px 14px; padding: 11px 13px; border: 1px solid var(--borda); border-radius: 8px; font-size: 14px; font-family: inherit; min-height: 110px; resize: vertical; outline: none; }
.obs-textarea:focus { border-color: var(--azul-claro); box-shadow: 0 0 0 3px rgba(46,109,164,.15); }
.obs-textarea:disabled { background: #f4f6f9; color: #66707a; }
.obs-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 18px 16px; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #12264a; color: #fff; padding: 11px 20px; border-radius: 8px; font-size: 14px;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.5); opacity: 0; transition: opacity .2s, transform .2s; z-index: 200;
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: var(--vermelho); }
.toast svg { width: 17px; height: 17px; }

/* ===================== CADASTRO DE OPERADORES [05/08/2026 - Alexandre Carvalho] ===================== */
.op-form { padding: 14px 18px 4px; }
.op-form .login-field { margin-bottom: 12px; }
.op-hint { margin: -4px 0 12px; font-size: 12px; color: #8a949e; line-height: 1.45; }
.op-inativo { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13.5px; color: #334155; cursor: pointer; }
.op-inativo input { width: 15px; height: 15px; accent-color: #b23a3a; }
.op-form .obs-actions { padding: 4px 0 14px; }
.badge svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 3px; }

/* ===================== PAINEL DE FRACIONAMENTO [05/08/2026 - Alexandre Carvalho] ===================== */
.fdx-toolbar { align-items: flex-end; flex-wrap: wrap; }
.fdx-toolbar .campo label { display: block; font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.fdx-toolbar .campo input, .fdx-toolbar .campo select {
  padding: 9px 10px; border: 1px solid var(--borda); border-radius: 8px; font-size: 14px; font-family: inherit;
  background: #fff; outline: none; min-width: 140px;
}
.fdx-toolbar .campo input:focus, .fdx-toolbar .campo select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.fdx-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .fdx-charts { grid-template-columns: 1fr; } }
.fdx-chart { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; }
.fdx-chart h3 { margin: 0 0 10px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: #8a949e; }
.fdx-chart-body svg { width: 100%; height: auto; display: block; }
.fdx-val { font-size: 11px; fill: #334155; font-weight: 600; }
.fdx-lab { font-size: 10.5px; fill: #8a949e; }
.fdx-bar rect { transition: opacity .12s; }
.fdx-bar:hover rect { opacity: .75; }
.fdx-vazio { color: #8a949e; font-size: 13px; margin: 6px 0; }
.fdx-frx { white-space: normal; min-width: 140px; font-variant-numeric: tabular-nums; }

/* [14/08/2026 - Alexandre Carvalho] Carrinhos: preview e chip da etiqueta */
.car-campos { display: flex; gap: 12px; }
.car-campos .login-field { flex: 1; }
.etq-preview {
  border: 2px dashed var(--borda); border-radius: 10px; background: #fff;
  padding: 14px 10px; margin: 4px 0 10px; text-align: center; min-height: 96px;
}
.etq-preview svg { max-width: 260px; width: 100%; height: auto; }
.etq-preview .etq-vazia { color: #8a949e; font-size: 13px; padding-top: 26px; display: block; }
.etq-chip { font-family: "SF Mono", Consolas, monospace; font-weight: 700; letter-spacing: .04em; }
.car-lote-nota { margin: 0 0 8px; font-size: 12.5px; color: #66707a; text-align: center; }

/* [14/09/2026 - Alexandre Carvalho] Roteiro do Carrinho */
.cr-bloco { background: #fff; border: 1px solid var(--borda); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.cr-bloco-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cr-roteiro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-seta { color: #94a3b8; font-weight: 700; }
.cr-volta { font-size: 12px; color: #64748b; font-style: italic; }
.cr-badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--cr) 14%, #fff); color: color-mix(in srgb, var(--cr) 80%, #000); border: 1px solid color-mix(in srgb, var(--cr) 35%, #fff); }
.cr-sem { font-size: 12px; color: #94a3b8; }
.cr-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.cr-kpi { background: #fff; border: 1px solid var(--borda); border-left: 4px solid var(--cr); border-radius: 8px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; }
.cr-kpi span { font-size: 12px; color: #5b6570; } .cr-kpi b { font-size: 20px; }
/* [06/11/2026] card do resumo filtra a grid */
.cr-kpi { gap: 8px; }
.cr-kpi-filtro { cursor: pointer; user-select: none; transition: box-shadow .12s, background .12s; }
.cr-kpi-filtro:hover { box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.cr-kpi-filtro.ativo { background: color-mix(in srgb, var(--cr) 12%, #fff); border-color: var(--cr); box-shadow: 0 0 0 1px var(--cr) inset; }
.cr-kpi-filtro.ativo span { color: color-mix(in srgb, var(--cr) 80%, #000); font-weight: 600; }
.cr-atrasado { color: var(--vermelho); font-weight: 700; }
.cr-sit-M { color: #9a6700; font-weight: 600; } .cr-sit-I { color: #94a3b8; }
.cr-motivo { font-size: 11px; color: #5b6570; }
.cr-info { margin: 0 0 12px; font-size: 13px; color: #5b6570; }
.cr-erro { margin-top: 10px; }
.cr-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.cr-hist { max-height: 60vh; overflow: auto; }
.cr-rot-lista { padding-left: 22px; margin: 0 0 12px; } .cr-rot-lista li { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.cr-rot-add { display: flex; gap: 8px; }
.cr-rot-add select { flex: 1; border: 1px solid var(--borda); border-radius: 6px; padding: 7px; }
.modal .login-field select { width: 100%; border: 1px solid var(--borda); border-radius: 8px; padding: 11px; font: inherit; }

/* [14/09/2026] numero clicavel de carrinhos no setor */
.cr-link-num { background: none; border: 0; color: var(--azul-claro); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 0 4px; }
.cr-link-num:hover { color: var(--azul); }

/* ===================== [14/09/2026 - Alexandre Carvalho] Explosao e Implosao com custo (tela explosao) ===================== */
.bx-dica { margin: 14px 2px; font-size: 13px; color: #66707a; }
.bx-carregando { padding: 26px; text-align: center; color: #8a949e; font-size: 13.5px; }
.bx-vazio { padding: 22px; text-align: center; color: #8a949e; font-size: 13.5px; }
.bx-muted { color: #8a949e; font-weight: 400; }
.bx-clicavel { cursor: pointer; }
.bx-lista td.cel-descr { max-width: 460px; }
.bx-cab { display: flex; justify-content: space-between; gap: 14px; margin-top: 14px; }
.bx-cod { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #66707a; }
.bx-cod b { color: var(--azul); font-size: 15px; }
.bx-desc { font-size: 18px; font-weight: 700; color: var(--texto); margin: 4px 0 6px; }
.bx-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: #66707a; }
.bx-seg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.bx-seg-row .spacer { flex: 1; }
.bx-seg { display: inline-flex; border: 1px solid var(--borda); border-radius: 8px; overflow: hidden; background: #fff; }
.bx-seg button { border: 0; background: #fff; padding: 8px 18px; font: inherit; font-size: 14px; color: #66707a; cursor: pointer; }
.bx-seg button + button { border-left: 1px solid var(--borda); }
.bx-seg button.ativo { background: var(--azul-claro); color: #fff; font-weight: 600; }
.bx-ferr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: #66707a; }
.bx-ferr input[type=text], .bx-ferr select { height: 34px; border: 1px solid var(--borda); border-radius: 7px; padding: 0 9px; font: inherit; font-size: 13px; background: #fff; }
.bx-ferr input[type=text] { width: 230px; }
.bx-ferr label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.bx-link { background: none; border: 0; padding: 0 2px; font: inherit; font-size: 13px; color: var(--azul-claro); cursor: pointer; }
.bx-link:hover { text-decoration: underline; }
#bxTabelaWrap { max-height: 64vh; overflow: auto; }
.bx-tab tbody td { padding: 6px 8px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.bx-tab tbody tr.bx-inativo td { color: #9aa4ad; }
.bx-tab tbody tr.bx-imp-alto td:first-child { box-shadow: inset 3px 0 0 var(--vermelho); }
.bx-tab tbody tr.bx-imp-medio td:first-child { box-shadow: inset 3px 0 0 #d99816; }
.bx-nivel { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 10px; background: #eef2f7; color: var(--azul); font-weight: 700; font-size: 11px; text-align: center; }
.bx-cel-cod { white-space: nowrap; }
.bx-exp { width: 20px; height: 20px; margin-right: 4px; border: 0; border-radius: 4px; background: transparent; color: #66707a; font-size: 16px; line-height: 1; cursor: pointer; transition: transform .15s; vertical-align: middle; }
.bx-exp:hover { background: #e3ebf4; color: var(--azul); }
.bx-exp.aberto { transform: rotate(90deg); }
.bx-exp-vazio { display: inline-block; width: 24px; }
.bx-sub { font-style: normal; font-size: 11px; color: #8a949e; margin-left: 4px; }
.bx-perda { font-size: 10.5px; color: #b9770a; }
.bx-fonte { font-style: normal; font-size: 9.5px; font-weight: 700; color: #8a949e; margin-left: 4px; vertical-align: super; }
.bx-part { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: #eef2f7; overflow: hidden; vertical-align: middle; }
.bx-part i { display: block; height: 100%; background: var(--azul-claro); }
.bx-part-v { font-size: 11.5px; margin-left: 6px; color: #5b6570; font-variant-numeric: tabular-nums; }
.bx-part-larga { width: 160px; }
.bx-impacto { display: grid; grid-template-columns: 130px 1fr 170px 190px; align-items: center; gap: 10px; padding: 6px 4px; border-top: 1px solid #eef1f4; font-size: 13px; }
.bx-impacto:hover { background: #f2f7fc; }
.bx-impacto-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #5b6570; }
.bx-impacto-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bx-impacto-val em { font-style: normal; font-weight: 400; color: #8a949e; margin-left: 6px; }
.bx-legenda { margin: 8px 2px 0; font-size: 11.5px; color: #8a949e; }
.bx-sub-tit { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--azul); }
.bx-mini { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bx-mini thead th { position: static; }
.bx-mini tbody td { padding: 5px 8px; border-bottom: 1px solid #eef1f4; }
.bx-mini tbody tr.bx-clicavel:hover { background: #f2f7fc; }
.modal.bx-modal { max-width: 1000px; max-height: 86vh; }
.bx-modal-desc { font-size: 15px; font-weight: 700; color: var(--texto); margin-top: 2px; }
.bx-abas { display: flex; gap: 4px; padding: 8px 18px 0; border-bottom: 1px solid var(--borda); }
.bx-abas button { border: 0; background: none; padding: 8px 12px; font: inherit; font-size: 13.5px; color: #66707a; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.bx-abas button.ativo { color: var(--azul); border-bottom-color: var(--azul-claro); font-weight: 600; }
.bx-modal-corpo { overflow-y: auto; padding: 14px 18px 18px; }
.bx-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 18px; }
.bx-kv div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bx-kv span { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #8a949e; }
.bx-kv b { font-size: 13.5px; font-weight: 600; color: var(--texto); overflow-wrap: anywhere; }
.bx-kv b em { font-style: normal; }
.bx-kv-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bx-acoes { display: flex; gap: 8px; margin-top: 16px; }
.bx-kpis-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.bx-kpi-mini { border: 1px solid var(--borda); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.bx-kpi-mini span { font-size: 11px; text-transform: uppercase; color: #8a949e; }
.bx-kpi-mini b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bx-kpi-mini em { font-style: normal; font-size: 11px; color: #8a949e; }
.bx-ruim { color: var(--vermelho); } .bx-bom { color: var(--verde); }
.bx-forn { border: 1px solid var(--borda); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.bx-forn-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
@media (max-width: 760px) { .bx-impacto { grid-template-columns: 1fr; } .bx-ferr input[type=text] { width: 100%; } }
/* [14/09/2026] icone do KPI com fill="none" precisa de stroke herdado (mesma pegadinha do .btn-obs) */
#tela-explosao .kpi-ico svg { stroke: currentColor; }
#bxTabelaWrap td:has(.bx-part) { white-space: nowrap; }

/* [05/10/2026 - Alexandre Carvalho] Etiquetas de produto (Argox) */
.etq-form { background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 12px; }
.etq-campos { display: grid; grid-template-columns: 1fr 2fr 110px 90px; /* [06/11/2026] Ordem (estreita) antes do Produto (largo) */ gap: 10px 14px; align-items: end; }
.etq-campo { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #52606d; }
.etq-campo input { height: 38px; border: 1px solid var(--borda); border-radius: 8px; padding: 0 10px; font-size: 15px; font-family: inherit; }
.etq-campo input:disabled { background: #f3f5f8; color: #9aa5b1; }
.etq-tipos { grid-column: 1 / span 2; }
.etq-tipos > div { display: flex; gap: 18px; flex-wrap: wrap; }
.etq-tipos label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--texto); cursor: pointer; }
.etq-tipos small { color: #8a949e; }
.etq-acoes { display: flex; gap: 10px; justify-content: flex-end; }
.etq-info { background: #eef4fb; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 10px; }
.etq-sem { color: var(--vermelho); }
.etq-preview-grande svg { max-width: 520px; }
.etq-preview-2col svg { max-width: 760px; }
@media (max-width: 900px) { .etq-campos { grid-template-columns: 1fr 1fr; } .etq-tipos { grid-column: 1 / -1; } }

/* ===================== [06/11/2026] DASHBOARD DA METALIZACAO (cardash.js) ===================== */
.cdx-toolbar, .cdx-filtro { margin-bottom: 10px; }
.cdx-per { display: flex; gap: 4px; }
.cdx-filtro select.cdx-on { border-color: var(--azul-claro); background: #eef5fc; font-weight: 600; }
.cdx-linha { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cdx-ativos { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; align-items: center; }
.cdx-chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 14px; background: #eef2f7; border: 1px solid var(--borda); font-size: 12px; color: #334155; }
.cdx-chip-x { cursor: pointer; } .cdx-chip-x:hover { background: #fdecea; border-color: #f3b4ae; }
.cdx-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cdx-card { text-align: left; font: inherit; background: #fff; border: 1px solid var(--borda); border-left: 4px solid var(--azul-claro); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; cursor: pointer; transition: box-shadow .12s, transform .12s; }
.cdx-card:hover, .cdx-card:focus-visible { box-shadow: 0 2px 10px rgba(15,23,42,.10); transform: translateY(-1px); outline: none; border-color: var(--azul-claro); }
.cdx-card.tom-verde { border-left-color: var(--verde); } .cdx-card.tom-azul { border-left-color: var(--azul); }
.cdx-card-rot { font-size: 11.5px; color: #66707a; text-transform: uppercase; letter-spacing: .03em; }
.cdx-card b { font-size: 24px; color: var(--texto); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cdx-card-sub { font-size: 11px; color: #8a949e; }
.cdx-graf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1200px) { .cdx-graf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .cdx-graf { grid-template-columns: 1fr; } }
.cdx-barras { display: flex; flex-direction: column; gap: 2px; }
.cdx-barra { display: grid; grid-template-columns: minmax(90px, 32%) 1fr 13em; gap: 8px; align-items: center; font: inherit; font-size: 12.5px; background: none; border: 0; padding: 5px 4px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--texto); }
.cdx-barra:hover, .cdx-barra:focus-visible { background: #eef5fc; outline: none; }
.cdx-barra-rot { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdx-barra-trilho { height: 14px; background: transparent; position: relative; }
.cdx-barra-fill { display: block; height: 100%; background: var(--azul-claro); border-radius: 0 4px 4px 0; }
.cdx-barra:hover .cdx-barra-fill { background: var(--azul); }
.cdx-barra-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cdx-barra-val small, .cdx-leg small, .cdx-tab small, .cdx-mini small { font-weight: 400; color: #8a949e; font-size: 11px; }
.cdx-sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--cr); margin-right: 6px; vertical-align: 1px; }
.cdx-cols { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-top: 16px; overflow-x: auto; }
.cdx-col { flex: 1 0 26px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; background: none; border: 0; padding: 0 2px; cursor: pointer; font: inherit; border-radius: 6px; }
.cdx-col:hover, .cdx-col:focus-visible { background: #eef5fc; outline: none; }
.cdx-col-fill { width: 70%; max-width: 34px; background: var(--azul-claro); border-radius: 4px 4px 0 0; }
.cdx-col:hover .cdx-col-fill { background: var(--azul); }
.cdx-col-val { font-size: 11px; font-weight: 600; color: var(--texto); font-variant-numeric: tabular-nums; }
.cdx-col-rot { font-size: 10.5px; color: #66707a; padding-bottom: 2px; }
.cdx-pilha { display: flex; gap: 2px; height: 30px; margin: 6px 0 10px; }
.cdx-pilha-seg { background: var(--cr); border: 0; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; min-width: 4px; }
.cdx-pilha-seg:first-child { border-radius: 4px 0 0 4px; } .cdx-pilha-seg:last-child { border-radius: 0 4px 4px 0; }
.cdx-pilha-seg:hover { filter: brightness(.9); }
.cdx-legenda { display: flex; flex-direction: column; gap: 2px; }
.cdx-leg { display: flex; align-items: center; gap: 6px; background: none; border: 0; font: inherit; font-size: 12.5px; padding: 4px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--texto); }
.cdx-leg:hover { background: #eef5fc; } .cdx-leg i { width: 10px; height: 10px; border-radius: 2px; background: var(--cr); } .cdx-leg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.cdx-nota { font-size: 12px; color: #66707a; margin: 8px 0 0; }
.cdx-vazio { padding: 22px; text-align: center; color: #8a949e; font-size: 13px; }
.cdx-bloco { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; min-width: 0; }
.cdx-bloco-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cdx-bloco-tit h3 { margin: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: #8a949e; }
.cdx-bloco > .cdx-nota { margin: 4px 0 10px; }
.cdx-duas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 1100px) { .cdx-duas { grid-template-columns: 1fr; } }
.cdx-mat-ctl { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: #475569; }
.cdx-mat-ctl select { padding: 5px 8px; border: 1px solid var(--borda); border-radius: 6px; font: inherit; }
.cdx-tab { margin-top: 6px; overflow-x: auto; }
.cdx-tab table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cdx-tab th { background: #eef2f7; text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--borda); white-space: nowrap; font-size: 12px; }
.cdx-tab th.num, .cdx-tab td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cdx-tab td { padding: 7px 10px; border-bottom: 1px solid #eef1f4; white-space: nowrap; }
.cdx-th { cursor: pointer; user-select: none; } .cdx-th:hover { color: var(--azul); }
.cdx-tab tr.clicavel { cursor: pointer; } .cdx-tab tr.clicavel:hover td { background: #e3edf7; }
.cdx-mat-f td:first-child { padding-left: 34px; color: #334155; }
.cdx-mat-g td { background: #fafbfc; }
.cdx-exp { background: none; border: 0; cursor: pointer; width: 20px; font-size: 12px; color: #475569; padding: 0; margin-right: 4px; }
.cdx-cel { background: none; border: 0; font: inherit; cursor: pointer; color: var(--azul-claro); font-weight: 600; padding: 2px 4px; border-radius: 4px; }
.cdx-cel:hover { background: #e3edf7; } .cdx-zero { color: #cbd5e1; }
.cdx-link { background: none; border: 0; color: var(--azul-claro); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.cdx-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; color: color-mix(in srgb, var(--cr) 75%, #000); background: color-mix(in srgb, var(--cr) 14%, #fff); border: 1px solid color-mix(in srgb, var(--cr) 35%, #fff); }
.cdx-pag { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 8px 0 0; font-size: 12.5px; color: #475569; }
/* modal do drill-down */
.modal.cdx-modal { max-width: min(1280px, 96vw); max-height: 90vh; }
.cdx-ov { padding-top: 4vh; }
.cdx-mh { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cdx-bc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.cdx-bc button { background: none; border: 0; color: var(--azul-claro); cursor: pointer; font: inherit; padding: 0; } .cdx-bc button:hover { text-decoration: underline; }
.cdx-bc span { color: #94a3b8; }
.cdx-mb { padding: 12px 18px 16px; }
.cdx-mb .cdx-tab table { font-size: 13px; }
.cdx-mb .cdx-tab td, .cdx-mb .cdx-tab th { padding: 7px 10px; position: static; }
.cdx-ctx { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cdx-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px; }
.cdx-mini > div { background: #f6f8fb; border: 1px solid #e5e9ef; border-radius: 8px; padding: 7px 10px; display: flex; flex-direction: column; }
.cdx-mini span { font-size: 11px; color: #66707a; text-transform: uppercase; letter-spacing: .02em; } .cdx-mini b { font-size: 16px; font-variant-numeric: tabular-nums; }
.cdx-abas { margin-bottom: 4px; flex-wrap: wrap; }
.cdx-carro { background: #f6f8fb; border: 1px solid #e5e9ef; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.cdx-reg { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.cdx-reg section { border: 1px solid #e5e9ef; border-radius: 8px; padding: 10px 12px; }
.cdx-reg h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #8a949e; }
.cdx-reg dl { display: grid; grid-template-columns: minmax(120px, 46%) minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.cdx-reg dt { color: #66707a; } .cdx-reg dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.cdx-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 640px) { .cdx-barra { grid-template-columns: 34% 1fr 9.5em; } .cdx-modal .modal-head { flex-wrap: wrap; } }
.cdx-barra-tot { border-bottom: 1px solid var(--borda); border-radius: 6px 6px 0 0; margin-bottom: 2px; font-weight: 700; }
.cdx-barra-tot .cdx-barra-fill { background: var(--azul); }
.cdx-tab tfoot td { border-top: 2px solid var(--borda); background: #f6f8fb; font-weight: 600; }

/* [06/11/2026 - Alexandre Carvalho] Gestao Producao x Estoque e Separacao WMS (public/kdash.js, prddash.js, wmsdash.js). Reaproveita .cdx-* */
.cdx-card.tom-vermelho { border-left-color: var(--vermelho); }
.cdx-card.kd-semclique { cursor: default; }
.kd-busca { margin: 0 0 8px; }
.kd-busca input { width: min(320px, 100%); padding: 6px 10px; border: 1px solid var(--borda); border-radius: 8px; font: inherit; }
.kd-pag1 { justify-content: flex-end; color: #64748b; font-size: 12px; }
.kd-col-pilha { display: flex; flex-direction: column-reverse; width: 70%; max-width: 34px; border-radius: 4px 4px 0 0; overflow: hidden; gap: 1px; background: #fff; }
.kd-col-pilha span { display: block; min-height: 1px; }
.cdx-col:hover .kd-col-pilha { filter: brightness(0.9); }
.kd-exec { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kd-exec .cdx-bloco { margin: 0; }
@media (max-width: 1100px) { .kd-exec { grid-template-columns: 1fr; } }
.kd-cards-p { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 10px; }
.kd-cards-p .cdx-card b { font-size: 20px; }
.kd-graf4 { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .kd-graf4 { grid-template-columns: 1fr; } }
.kd-sub { margin: 10px 0 6px; font-size: 13px; color: #475569; font-weight: 600; }
.kd-mudo { color: #64748b; font-size: 11.5px; }
.kd-alerta { color: var(--vermelho); }
.pdx-tol input { width: 90px; }
.pdx-abas { margin-top: 4px; }
.kd-conc-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--borda);
  border-left: 5px solid var(--cr); border-radius: 10px; background: color-mix(in srgb, var(--cr) 6%, #fff); }
.kd-conc-box span { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; }
.kd-conc-box b { font-size: 20px; }
.kd-g { margin-bottom: 10px; }
