@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");
/* =====================================================================
   TEMA UserVoz (claro) - cores, fontes, espacamentos, raios e sombras.
   Tudo o que define a aparencia fica AQUI; o resto do arquivo so usa estas variaveis.
   Aprovado em 08/10/2026 (previa docs/previa-tema). Contraste conferido (WCAG AA).
   ===================================================================== */
:root {
  /* superficies */
  --bg: #F4F7FB;            /* fundo da pagina */
  --surface: #FFFFFF;       /* cartoes, menu, modais */
  --surface-2: #F8FAFD;     /* faixas e areas secundarias dentro de cartoes */
  --border: #E5EDF5;        /* bordas discretas */
  --border-strong: #D3DEEA; /* campos de formulario */
  /* texto */
  --text: #0B1B3A;          /* titulos e texto principal (17:1) */
  --text-2: #5B6B87;        /* texto secundario pequeno (5:1) */
  --muted: #5B6B87;         /* nome antigo do texto secundario (mantido para compatibilidade) */
  --icon: #7183A0;          /* icones, eixos e rotulos grandes */
  /* cor principal (turquesa) */
  --primary: #00B3A4;       /* icones, graficos, indicadores, item selecionado */
  --primary-ink: #00857A;   /* texto e botoes turquesa (4,5:1) */
  --primary-soft: #E8FAF7;  /* fundo de item selecionado */
  --accent: var(--primary-ink);   /* nome antigo: links e destaques (a cor da marca em Configuracoes sobrescreve) */
  --accent2: var(--primary-ink);  /* nome antigo: botao principal */
  /* estados: cor de preenchimento (barras, legendas, bordas) + tom escuro para texto + fundo suave */
  --ok: #10B981;   --ok-ink: #047857;   --ok-soft: #E8F8F1;
  --bad: #FF6B6B;  --bad-ink: #C93A3A;  --bad-soft: #FFF0F0;
  --warn: #F5A524; --warn-ink: #8A5300; --warn-soft: #FFF6E5;
  --info: #5B7BD5; --info-ink: #3A57AD; --info-soft: #EEF2FC;
  /* series dos graficos (validadas para daltonismo) */
  --series-allowed: var(--primary);
  --series-blocked: var(--bad);
  --series-rejected: var(--info);
  /* nomes antigos usados pelo portal e por estilos inline */
  --panel: var(--surface); --panel2: var(--surface-2); --bg2: var(--surface);
  /* tipografia */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px; --fs-hero: 32px;
  /* espacamentos */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  /* forma */
  --radius: 12px; --radius-sm: 10px; --radius-xs: 8px; --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(11, 27, 58, .04), 0 2px 8px rgba(11, 27, 58, .04);
  --shadow-lg: 0 12px 40px rgba(11, 27, 58, .16);
  --focus: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--primary-ink);
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); }
h1 { font-size: var(--fs-2xl); margin: 0 0 var(--s5); font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: var(--fs-lg); margin: 0 0 var(--s3); font-weight: 700; color: var(--text); letter-spacing: -.01em; }
h3 { font-size: var(--fs-md); margin: var(--s4) 0 var(--s2); font-weight: 700; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-xs); }
.right { text-align: right; }
.mono { font-family: var(--mono); font-size: .95em; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.err { color: var(--bad-ink); font-size: var(--fs-sm); min-height: 18px; margin-bottom: 8px; }
.ok-txt { color: var(--ok-ink); }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: var(--fs-xs); font-family: var(--mono); }
pre { background: var(--bg); padding: 12px; border-radius: var(--radius-xs); overflow: auto; font-size: var(--fs-xs); font-family: var(--mono); border: 1px solid var(--border); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; box-shadow: var(--shadow); }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- estrutura e menu lateral */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--surface); border-right: 1px solid var(--border); padding: var(--s5) var(--s3) 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 30; }
.brand { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.01em; padding: 4px 10px 16px; }
.brand small { display: block; color: var(--text-2); font-weight: 500; font-size: var(--fs-xs); margin-top: 2px; }
.brand-logo { background: var(--surface); border-radius: var(--radius-sm); padding: 4px 6px; display: flex; align-items: center; justify-content: flex-start; margin-bottom: 6px; }
.brand-logo img { max-width: 100%; max-height: 64px; display: block; }
.nav { flex: 1 0 auto; padding-bottom: var(--s2); }
.nav .sec { margin: 18px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--icon); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; margin-bottom: 2px; text-decoration: none; }
.nav a .ic { width: 20px; min-width: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--icon); }
.nav a .ic svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.nav a.active .ic { color: var(--primary); }
.sidefoot { position: sticky; bottom: 0; background: var(--surface); padding: 12px 10px 14px; margin: 16px -12px 0; border-top: 1px solid var(--border); color: var(--text-2); font-size: var(--fs-xs); box-shadow: 0 -8px 12px -8px rgba(11, 27, 58, .08); }
.sidefoot #who { padding: 0 2px; }
.sidefoot button { width: 100%; margin-top: 8px; }
.main { flex: 1; min-width: 0; padding: var(--s6) var(--s8) var(--s8); max-width: none; }   /* 29/10/2026: usa toda a largura da janela (era 1560px, sobrava espaco a direita e as tabelas largas cortavam os botoes) */
.mobilebar { display: none; }
.sidebar-backdrop { display: none; }

/* ---------------------------------------------------------------- cartoes e caixas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4) var(--s5); box-shadow: var(--shadow); min-width: 0; }
.card .label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.card .value { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.card .sub { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }
.card.ok .value { color: var(--ok-ink); } .card.bad .value { color: var(--bad-ink); } .card.warn .value { color: var(--warn-ink); }
.card.info .value { color: var(--text); }
.card.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.clickable:hover { border-color: var(--primary); }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5) var(--s6); margin-bottom: var(--s4); box-shadow: var(--shadow); min-width: 0; }
.box > h2:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.warnbox { border-color: #FFE1A8; background: var(--warn-soft); color: var(--warn-ink); }
.howto { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: var(--radius-xs); font-size: var(--fs-sm); color: var(--text-2); line-height: 1.55; }
.howto b { color: var(--text); font-weight: 600; }
.howto p { margin: 0 0 6px; } .howto p:last-child { margin-bottom: 0; }
.small-cards .card .value { font-size: var(--fs-xl); }

/* ---------------------------------------------------------------- dashboard (novo layout) */
.page-head { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-2); font-size: var(--fs-sm); }
.page-head .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 600; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .label { color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: var(--fs-xs); color: var(--text-2); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; line-height: 1.45; }
.ico { width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.ico svg { width: 20px; height: 20px; }
.ico.ok { background: var(--ok-soft); color: var(--ok-ink); }
.ico.bad { background: var(--bad-soft); color: var(--bad-ink); }
.ico.info { background: var(--info-soft); color: var(--info-ink); }
.ico.warn { background: var(--warn-soft); color: var(--warn-ink); }
.delta { font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); }
.delta.up { background: var(--ok-soft); color: var(--ok-ink); }
.delta.down { background: var(--bad-soft); color: var(--bad-ink); }
.delta.flat { background: var(--bg); color: var(--text-2); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5); margin-bottom: var(--s5); }
.dash-grid.half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-grid > .box { margin-bottom: 0; }
.hint { color: var(--text-2); font-size: var(--fs-sm); margin: -6px 0 var(--s4); }
.svgchart { position: relative; }
.svgchart svg { width: 100%; height: 250px; display: block; overflow: visible; }
.svgchart .hb { cursor: default; outline: none; }
.svgchart .hb:focus-visible rect.hit { stroke: var(--primary-ink); stroke-width: 2; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: #fff; font-size: var(--fs-xs); border-radius: 8px; padding: 8px 10px; white-space: nowrap; transform: translate(-50%, -100%); opacity: 0; transition: opacity .1s; z-index: 5; line-height: 1.6; }
.chart-tip.on { opacity: 1; }
.stackbar { display: flex; height: 14px; border-radius: var(--radius-pill); overflow: hidden; gap: 2px; background: var(--bg); margin: 4px 0 14px; }
.stackbar span { display: block; height: 100%; }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.dist-row:first-of-type { border-top: 0; }
.dist-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.dist-row .n { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.dist-row .p { color: var(--text-2); font-size: var(--fs-sm); min-width: 56px; text-align: right; }
.mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--s4); }
.mini b { display: block; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; }
.mini span { color: var(--text-2); font-size: var(--fs-sm); }
.bar-track { height: 8px; background: var(--bg); border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--s3); }
.bar-track span { display: block; height: 100%; background: var(--primary); border-radius: var(--radius-pill); }
details.defs > summary { cursor: pointer; font-weight: 700; color: var(--text); }
details.defs dl { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 14px 0 0; font-size: var(--fs-sm); }
details.defs dt { font-weight: 700; }
details.defs dd { margin: 0; color: var(--text-2); }
.who b { display: block; font-size: var(--fs-md); color: var(--text); }
.who span { color: var(--text-2); font-size: var(--fs-sm); display: block; }
.who .chip { margin-top: 4px; }

/* ---------------------------------------------------------------- grafico antigo (Ao vivo, portal) */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.chart .bar { flex: 1; display: flex; flex-direction: column-reverse; min-width: 3px; height: 100%; position: relative; gap: 1px; }
.chart .bar div { width: 100%; border-radius: 3px; }
.chart .bar .a { background: var(--series-allowed); }
.chart .bar .b { background: var(--series-blocked); }
.chart .bar .r { background: var(--series-rejected); }
.chart .bar:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 6px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; z-index: 5; }
.legend { display: flex; gap: 16px; font-size: var(--fs-sm); color: var(--text-2); margin-top: 10px; flex-wrap: wrap; align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------------------------------------------------------------- tabelas */
.table-scroll { overflow-x: auto; }
.box > table, .box .table-scroll { margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-2); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); }
thead th:first-child { border-top-left-radius: var(--radius-xs); } thead th:last-child { border-top-right-radius: var(--radius-xs); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #F7FAFD; }
th.right, td.right { text-align: right; font-variant-numeric: tabular-nums; }
/* 29/10/2026: a coluna de acoes nunca e cortada: quando falta largura, os botoes quebram em linhas (antes: nowrap + rolagem lateral) */
th.actions, td.actions { text-align: right; white-space: normal; min-width: 132px;
  position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 10px -8px rgba(0, 0, 0, .18); }   /* fixa na borda direita: visivel mesmo se a tabela rolar */
tbody tr:hover td.actions { background: #F7FAFD; }
tr.clickable:hover td.actions { background: var(--primary-soft); }
td.actions button { vertical-align: middle; margin: 2px 0 2px 4px; white-space: nowrap; }
td.actions button:first-child { margin-left: 0; }
td { overflow-wrap: break-word; }                      /* e-mails, call-ids e textos longos quebram em vez de alargar a tabela */
td.nowrap, td.mono { overflow-wrap: normal; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 12px; color: var(--text-2); text-align: center; font-size: var(--fs-sm); }
.empty b { color: var(--text); font-size: var(--fs-md); }
.svc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; }
.svc .lbl { color: var(--text-2); font-size: var(--fs-xs); min-width: 118px; }
.lbl { color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; }
.filterbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); }
.filterbar label { margin: 0; }
th.fin-start, td.fin-start { border-left: 2px solid var(--border-strong); }
tr.sel-row td { background: var(--primary-soft); }
tr.total td { border-top: 2px solid var(--border-strong); font-weight: 700; background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--primary-soft); }
tr.loss td { background: var(--bad-soft); }
tr.row-off td { background: var(--bad-soft); }
tr.new td { animation: liveflash 2.5s ease-out; }
@keyframes liveflash { from { background: var(--primary-soft); } to { background: transparent; } }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; color: var(--text-2); }

/* ---------------------------------------------------------------- etiquetas */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; line-height: 1.5; }
.badge.ALLOWED, .badge.on, .badge.allow, .badge.ctype-both, .badge.disk-normal { background: var(--ok-soft); color: var(--ok-ink); }
.badge.BLOCKED, .badge.block, .badge.disk-critico { background: var(--bad-soft); color: var(--bad-ink); }
.badge.REJECTED, .badge.warnc, .badge.disk-atencao { background: var(--warn-soft); color: var(--warn-ink); }
.badge.disk-alerta { background: #FFEDE0; color: #9A3D00; }
.badge.ERROR, .badge.info, .badge.ctype-mobile { background: var(--info-soft); color: var(--info-ink); }
.badge.ctype-fixed { background: var(--primary-soft); color: var(--primary-ink); }
.badge.off { background: var(--bg); color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; margin: 2px 4px 2px 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius-pill); font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; }
.chip b { color: var(--text); }
.chip a { text-decoration: none; opacity: .7; }
.chip a:hover { opacity: 1; }
.chip.off { opacity: .5; text-decoration: line-through; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.status-dot.ok { background: var(--ok); } .status-dot.bad { background: var(--bad); }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 4px var(--ok-soft); animation: livepulse 1.4s infinite; }
.live-dot.off { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); animation: none; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------------------------------------------------------------- botoes e formularios */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { border-color: var(--primary); background: var(--surface-2); text-decoration: none; }
button.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
button.primary:hover { filter: brightness(1.08); background: var(--accent2); }
button.danger { background: var(--bad-soft); border-color: #FFC9C9; color: var(--bad-ink); }
button.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
button.small { padding: 5px 10px; font-size: var(--fs-xs); line-height: 18px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; font: inherit; font-size: var(--fs-sm); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=file] { padding: 6px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary-ink); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.row.end { justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.field label { font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 16px; }
.form .wide { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
details.adv { margin-top: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface-2); }
details.adv > summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 24px; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(11,27,58,.2); }
.switch input:checked + span { background: var(--primary-ink); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------------------------------------------------------------- abas */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: var(--s4); }
.tabs .tab, .tabs > button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 14px; color: var(--text-2); font-weight: 600; }
.tabs .tab:hover, .tabs > button:hover { background: none; color: var(--text); }
.tabs .tab.active, .tabs > button.active, .tabs > button.primary { color: var(--primary-ink); border-bottom-color: var(--primary); background: var(--primary-soft); border-radius: var(--radius-xs) var(--radius-xs) 0 0; font-weight: 700; }

/* ---------------------------------------------------------------- avisos, modal, login */
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: var(--radius-sm); max-width: 420px; z-index: 70; box-shadow: var(--shadow-lg); white-space: pre-line; }
.toast.err { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 27, 58, .45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s6); width: 680px; max-width: 100%; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal.wide { width: 1180px; }
.modal h3 { margin: 0 0 16px; font-size: var(--fs-xl); letter-spacing: -.01em; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg); }
.login { width: 400px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.login h1 { text-align: center; margin-bottom: 4px; }
.login p { text-align: center; color: var(--text-2); margin: 0 0 22px; }
.login input { width: 100%; margin-bottom: 12px; }
.login button { width: 100%; padding: 11px; }
.login-brand { background: var(--surface); border-radius: 12px; padding: 6px 12px 14px; display: flex; justify-content: center; margin-bottom: 8px; }
.login-brand img { max-width: 100%; max-height: 110px; display: block; }
.brand-prev { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px; display: inline-flex; min-width: 64px; min-height: 40px; align-items: center; justify-content: center; }
.brand-prev img { max-height: 70px; max-width: 220px; display: block; }
.result-box { padding: 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; }
.result-box.ALLOWED { background: var(--ok-soft); color: var(--ok-ink); }
.result-box.BLOCKED { background: var(--bad-soft); color: var(--bad-ink); }
.standby-banner { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 65; max-width: min(900px, 92vw); background: var(--warn-soft); border: 1px solid #FFD28A; color: var(--warn-ink); padding: 10px 16px; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-lg); }
.standby-banner a { color: var(--warn-ink); text-decoration: underline; }

/* ---------------------------------------------------------------- Classe 4: etapas, ordem, chaves */
.policy { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); margin-bottom: 10px; background: var(--surface-2); }
.policy .big { font-size: var(--fs-lg); font-weight: 700; }
.policy.open .big { color: var(--warn-ink); } .policy.closed .big { color: var(--bad-ink); }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 12px; font-size: var(--fs-sm); }
.kv .k { color: var(--text-2); }
.steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 var(--s4); }
.step { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface); color: var(--text-2); text-decoration: none; }
.step:hover { text-decoration: none; border-color: var(--primary); }
.step b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: var(--bg); color: var(--text); font-size: var(--fs-sm); }
.step .st { display: block; color: var(--text); font-weight: 600; font-size: var(--fs-sm); }
.step small { font-size: var(--fs-xs); }
.step.cur { border-color: var(--primary); background: var(--primary-soft); }
.step.cur b { background: var(--primary-ink); color: #fff; }
.step-arrow { color: var(--icon); font-size: 18px; }
.ord { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; background: var(--surface); }
.ord-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.ord-row:last-of-type { border-bottom: 0; }
.ord-n { display: inline-flex; min-width: 38px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.ord-name { flex: 1; }
.ord-btns { display: flex; gap: 4px; }
.exc { margin: 10px 0; }
.ipline { padding: 2px 0; white-space: nowrap; }
.ipline a { margin-left: 4px; text-decoration: none; opacity: .75; }

/* ---------------------------------------------------------------- Custo e Lucro / Armazenamento */
.fin-hl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fin-hl > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); min-width: 0; overflow-wrap: anywhere; }
.fin-hl > div > b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
/* 29/10/2026: notebooks (ate 1440 px): menos margem e celulas mais compactas para as tabelas largas caberem sem rolagem */
@media (max-width: 1440px) {
  .main { padding: var(--s5) var(--s5) var(--s6); }
  th, td { padding: 8px 8px; }
  .box { padding: var(--s4) var(--s5); }
  th { white-space: normal; }
  table { font-size: var(--fs-sm); }
  .svc .lbl { min-width: 0; }
  .badge { padding: 2px 8px; }
}
@media (max-width: 1200px) { .fin-hl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .fin-hl { grid-template-columns: minmax(0, 1fr); } }
.fin-hl .label { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.diskbar { height: 22px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; margin: 10px 0 4px; }
.diskbar > div { height: 100%; background: var(--ok); transition: width .4s; }
.diskbar.warn > div { background: var(--warn); }
.diskbar.alert > div { background: #F97316; }
.diskbar.bad > div { background: var(--bad); }
td .diskbar { height: 10px; margin: 0; }
.disk-pct { font-size: 28px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- celular e telas menores */
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid, .dash-grid.half { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .layout { display: block; }
  .mobilebar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 25; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px; }
  .mobilebar b { font-size: var(--fs-lg); }
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop.on { display: block; position: fixed; inset: 0; background: rgba(11, 27, 58, .35); z-index: 29; }
  .main { padding: var(--s4); }
  h1 { font-size: var(--fs-xl); }
  .box, .card { padding: var(--s4); }
  .box { overflow-x: auto; }
  .kv, details.defs dl { grid-template-columns: 1fr; }
  .kpi .value { font-size: var(--fs-2xl); }
  .modal { padding: var(--s4); }
  td.actions { white-space: normal; }
  .kpi .value { font-size: 24px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: minmax(0, 1fr); } .cards { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* D3 (14/10/2026): painel da revenda - avisos e grafico de barras dos ultimos 14 dias (sem biblioteca) */
.alert { padding: 8px 12px; border-radius: 8px; margin: 4px 0; font-size: var(--fs-sm); border: 1px solid var(--border); background: var(--surface); }
.alert.bad { color: var(--bad-ink); border-color: var(--bad-ink); } .alert.warn { color: var(--warn-ink); border-color: var(--warn-ink); } .alert.info { color: var(--text-2); }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 150px; padding: 4px 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; height: 100%; }
.bar-wrap { flex: 1; width: 100%; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.bar { width: 40%; min-height: 2px; border-radius: 3px 3px 0 0; }
.bar.a { background: var(--accent, #2563eb); } .bar.m { background: var(--ok-ink, #0e9f6e); opacity: .75; }
.bar-lbl { font-size: 10px; color: var(--text-2); margin-top: 4px; white-space: nowrap; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.lg.a { background: var(--accent, #2563eb); } .lg.m { background: var(--ok-ink, #0e9f6e); opacity: .75; }

/* IPs e roteamentos por cliente, recolhidos na tabela (16/10/2026) */
.ips-box { margin-top: 6px; }
.ipgroups { max-height: 260px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--border); border-radius: var(--radius-xs); background: var(--surface-2); min-width: 420px; max-width: 100%; }
.ipgrp .ipline { white-space: normal; }
.ipgrp { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ipgrp:last-child { border-bottom: 0; }
.ipgrp-h { font-weight: 600; margin-bottom: 2px; }
.ipgrp .ipline { padding-left: 10px; }
.ips-toggle { white-space: nowrap; }
@media (max-width: 720px) { .ipgroups { max-height: 200px; min-width: 0; } }

.cad-filled { background: #F1FBF7; }
.cad-warn { color: var(--warn-ink); }

/* painel lateral (detalhe do cliente na revenda, 21/10/2026) e botao so com icone */
.modal-bg:has(.modal.drawer) { justify-content: flex-end; align-items: stretch; padding: 0; }
.modal.drawer { width: min(640px, 100vw); max-height: 100vh; height: 100vh; border-radius: 0; border-width: 0 0 0 1px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 8px; color: var(--primary-ink); }
.icon-btn:hover { background: var(--primary-soft); }

/* Protecao em duas etapas (MFA), 25/10/2026 */
.mfa-qr svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }
.mfa-key { font-size: 15px; letter-spacing: 1px; word-break: break-all; margin-top: 4px; }
.mfa-steps { margin: 8px 0 12px 18px; padding: 0; } .mfa-steps li { margin: 4px 0; }
.mfa-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; font-size: 15px; }
.mfa-codes span { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; text-align: center; }
.mfa-login input { width: 100%; font-size: 20px; letter-spacing: 4px; text-align: center; }
a.button { display: inline-block; text-decoration: none; }
.badge.on { background: rgba(46, 204, 113, .18); color: #2ecc71; } .badge.off { background: rgba(160, 160, 160, .18); color: var(--muted); }
button.danger { background: var(--bad); color: #fff; border-color: transparent; }

/* Documento a enviar ao pagar (06/11/2026): caixa com as duas opcoes no cadastro do cliente e da revenda */
.docpick { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); max-width: 780px; }
.docpick-title { font-weight: 700; margin-bottom: 10px; color: var(--text); }
.docpick-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.docpick-opt { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; background: var(--surface); font-weight: 600; color: var(--text); }
.docpick-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.docpick-opt input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }
.docpick-opt svg { width: 18px; height: 18px; flex: none; opacity: .8; }

/* Terminações agrupadas por fornecedor (06/11/2026): só apresentação */
.supgrp { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.supgrp-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.supgrp-head:hover, .supgrp.open > .supgrp-head { background: var(--surface-2); }
.supgrp-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.supgrp-arrow { width: 14px; flex: none; font-size: 11px; color: var(--muted); }
.supgrp-name { font-weight: 700; }
.supgrp-n { color: var(--muted); font-size: 13px; }
.supgrp-meta { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.supgrp > .table-scroll { border-top: 1px solid var(--border); }
@media (max-width: 640px) { .supgrp-meta { margin-left: 24px; width: 100%; } }
.supgrp td:first-child { min-width: 190px; }

/* Painel em blocos (06/11/2026): só apresentação. Cores fixas por sentido: saída azul, entrada DID verde, entrada 0800 laranja */
:root { --flow-out: #2563EB; --flow-did: #16A34A; --flow-tf: #EA580C; --flow-ans: #1E3A8A; }
.dblocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); margin-bottom: var(--s5); }
.dblocks > .box { margin-bottom: 0; }
.flowdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.flowdot.out { background: var(--flow-out); } .flowdot.did { background: var(--flow-did); } .flowdot.tf { background: var(--flow-tf); }
.simnow { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.simnow b { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; } .simnow span { color: var(--muted); font-size: 13px; }
.dsec > .kpis { margin-bottom: var(--s4); }
@media (max-width: 900px) { .dblocks { grid-template-columns: minmax(0, 1fr); } }

/* Administradores e permissoes (07/11/2026): caixas de selecao por modulo */
.permgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; padding: 10px 4px 4px; }
.permmod { border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 8px 10px; background: var(--surface-2); }
.permtitle { font-weight: 600; margin-bottom: 6px; }
.permmod label.checkbox { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0; font-size: var(--fs-sm); line-height: 1.4; }
.permmod label.checkbox input { margin-top: 3px; flex: none; }
.permgrid .row { grid-column: 1 / -1; }
tr.permrow > td { background: var(--surface-2); }

/* Ordem das terminacoes: arrastar e soltar, setas, salvar/cancelar (07/11/2026) */
.ord-head { margin: 0 0 6px; line-height: 1.45; }
.ord-handle { cursor: grab; color: var(--text-3, #8a94a6); font-size: 18px; letter-spacing: -3px; user-select: none; padding: 0 4px 0 0; }
.ord-row.ord-drag { cursor: grab; }
.ord-row.ord-drag:active { cursor: grabbing; }
.ord-row.dragging { opacity: .45; }
.ord-row.drop-before { box-shadow: inset 0 3px 0 0 var(--primary, #2563eb); }
.ord-row.drop-after { box-shadow: inset 0 -3px 0 0 var(--primary, #2563eb); }
.ord-actions { gap: 8px; align-items: center; flex-wrap: wrap; }
.warn-ink { color: var(--warn-ink, #b45309); }
.ok-ink { color: var(--ok-ink, #15803d); }

/* ---------------------------------------------------------------- lista + painel de detalhes (ui_ld.js, 07/11/2026) */
.ld-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 14px; }
.ld-search { position: relative; flex: 1; min-width: 240px; max-width: 520px; display: flex; align-items: center; }
.ld-search .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--icon, #6B7F94); display: inline-flex; }
.ld-search .ic svg { width: 16px; height: 16px; }
.ld-search input { width: 100%; height: 42px; padding: 0 12px 0 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: var(--text); }
.ld-filter select { height: 42px; min-width: 200px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: 0 12px; font: inherit; color: var(--text); }
.ld { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ld-list { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 64px; min-width: 0; }
.ld-list-head { font-size: 17px; margin: 2px 2px 12px; color: var(--text); }
.ld-cards { display: flex; flex-direction: column; gap: 10px; }
.ld-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 10px; padding: 12px 12px 12px 14px; min-height: 60px; cursor: pointer; font: inherit; color: inherit; transition: background .12s, border-color .12s; }
.ld-card:hover { background: var(--surface-2); border-color: var(--border-strong); }
.ld-card.sel { background: var(--primary-soft); border-color: var(--primary); border-left-color: var(--primary); }
.ld-card:focus-visible { outline: 0; box-shadow: var(--focus, 0 0 0 3px var(--primary-soft)); }
.ld-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ld-name { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-sub { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-meta { font-size: 12px; color: var(--text-2); }
.ld-status { flex: none; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.ld-arrow { flex: none; color: var(--icon, #6B7F94); font-size: 22px; line-height: 1; }
.ld-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px 20px; min-height: 240px; min-width: 0; }
.ld-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 240px; color: var(--text-2); text-align: center; }
.ld-empty-ic { width: 44px; height: 44px; color: var(--icon, #6B7F94); } .ld-empty-ic svg { width: 44px; height: 44px; }
.ld-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ld-back { display: none; }
.ld-head-main { flex: 1; min-width: 0; }
.ld-title { font-size: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text); }
.ld-head-meta { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.ld-close { border: 0; background: transparent; font-size: 28px; line-height: 1; color: var(--text-2); cursor: pointer; padding: 0 6px; min-height: 0; }
.ld-close:hover { color: var(--text); background: transparent; }
.ld-sec { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; overflow: hidden; background: var(--surface); }
.ld-sec-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface-2); border: 0; border-radius: 0; cursor: pointer; font: inherit; color: var(--text); font-size: 16px; min-height: 0; }
.ld-sec-ic { width: 20px; height: 20px; color: var(--text); display: inline-flex; } .ld-sec-ic svg { width: 20px; height: 20px; }
.ld-sec-n { margin-left: auto; font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.ld-chev { width: 10px; height: 10px; border-right: 1.7px solid var(--text-2); border-bottom: 1.7px solid var(--text-2); transform: rotate(45deg); margin: -4px 6px 0 auto; transition: transform .15s; flex: none; }
.ld-sec-n + .ld-chev { margin-left: 10px; }
.ld-sec.open .ld-chev { transform: rotate(-135deg); margin-top: 4px; }
.ld-sec-body { padding: 4px 14px 10px; }
.ld-kv { display: grid; grid-template-columns: 1fr; margin: 0; }
.ld-kv > div { display: grid; grid-template-columns: minmax(170px, 34%) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.ld-kv > div:last-child { border-bottom: 0; }
.ld-kv dt { color: var(--text); font-size: 14px; } .ld-kv dd { margin: 0; color: var(--text); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.ld-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ld-foot button { min-height: 42px; padding: 0 18px; font-size: 14px; }
.ld-actions-top { display: flex; gap: 10px; flex-wrap: wrap; } .ld-actions-top button { min-height: 42px; padding: 0 16px; }
.ld-mini .ld-mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ld-mini .ld-mini-row:last-child { border-bottom: 0; } .ld-mini .ld-name { flex: 1; min-width: 160px; } .ld-mini .ld-sub { flex: 2; min-width: 160px; } .ld-mini-act { margin-left: auto; }
@media (max-width: 1100px) { .ld { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); } }
@media (max-width: 860px) {
  .ld { grid-template-columns: minmax(0, 1fr); } .ld-list { position: static; max-height: none; }
  .ld.view-detail .ld-list { display: none; } .ld:not(.view-detail) .ld-detail { display: none; }
  .ld-back { display: inline-flex; min-height: 40px; } .ld-close { display: none; }
  .ld-kv > div { grid-template-columns: 1fr; gap: 2px; } .ld-kv dt { color: var(--text-2); font-size: 12.5px; }
  .ld-card { min-height: 64px; } .ld-title { font-size: 20px; }
  .ld-filters .ld-search { max-width: none; min-width: 0; width: 100%; } .ld-filter { flex: 1; } .ld-filter select { min-width: 0; width: 100%; }
}
/* blocos de configuracao como secoes expansiveis (ldBoxes) */
.ld-box > h2.ld-box-h { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.ld-box > h2.ld-box-h .ld-chev { margin-left: auto; margin-right: 4px; transform: rotate(-135deg); margin-top: 4px; }
.ld-box.closed > h2.ld-box-h .ld-chev { transform: rotate(45deg); margin-top: -4px; }
.ld-box.closed > h2.ld-box-h { margin-bottom: 0; border-bottom: 0 !important; padding-bottom: 0 !important; }
.ld-box.closed > :not(h2.ld-box-h) { display: none; }
.ld-box > h2.ld-box-h:focus-visible { outline: 0; box-shadow: var(--focus, 0 0 0 3px var(--primary-soft)); border-radius: 6px; }
.ld-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.ld-sub { white-space: normal; overflow-wrap: anywhere; }

/* Painel de suporte (07/11/2026) */
.sd-filters select { min-width: 180px; }
.sd-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--text-2); }
.sd-legend i, .sd-donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sd-donut { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.sd-donut svg { width: 170px; height: 170px; flex: none; }
.sd-donut-legend { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.sd-donut-legend > div { display: grid; grid-template-columns: 16px 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; }
.sd-donut-legend .sd-dn { font-size: 16px; } .sd-donut-legend .sd-dp { min-width: 52px; text-align: right; }
#sd_cdr_box .ld { margin-top: 4px; } #sd_cdr_box .ld-list { position: static; max-height: 560px; }
@media (max-width: 860px) { .sd-filters { width: 100%; } .sd-filters .ld-filter { flex: 1; } .sd-donut { justify-content: center; } }

/* ---------------------------------------------------------------- refinamento visual (07/11/2026): cartoes, proporcoes, controles
   Padrao compartilhado: controles de 40 px nas barras de filtro e acoes de pagina; cartao em grade (texto | status | seta) com
   altura pelo conteudo; lista 36% / painel 64%; cabecalho do painel com os indicadores a direita; KPI sem esticar sozinho. */
.ld { grid-template-columns: minmax(300px, 36%) minmax(0, 1fr); gap: 18px; }
.ld-list { padding: 16px 12px 16px 16px; scrollbar-gutter: stable; }
.ld-list::-webkit-scrollbar { width: 8px; } .ld-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.ld-cards { gap: 10px; padding-right: 2px; }
.ld-card { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; gap: 6px 12px; align-items: center; height: auto; min-height: 76px; padding: 14px 12px 14px 16px; white-space: normal; }
.ld-card-main { gap: 4px; min-width: 0; }
.ld-name { font-size: 15.5px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }
.ld-sub { font-size: 13.5px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.ld-meta { font-size: 13px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.ld-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 150px; justify-self: end; }
.ld-status .badge { white-space: nowrap; }
.ld-arrow { font-size: 22px; justify-self: end; }
.ld-detail { padding: 20px 22px 22px; }
.ld-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: start; margin-bottom: 16px; }
.ld-head-main { min-width: 0; }
.ld-title { font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.ld-head-meta { font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; }
.ld-head-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; padding-top: 6px; max-width: 320px; }
.ld-close { padding: 0 2px; margin-top: -2px; }
.ld-sec-body { overflow-x: auto; }
.ld-detail table { width: 100%; }
.ld-kv > div { grid-template-columns: minmax(180px, 36%) minmax(0, 1fr); gap: 10px 16px; padding: 10px 0; }
.ld-kv dt { color: var(--text-2); } .ld-kv dd { overflow-wrap: anywhere; }
.ld-foot { gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.ld-foot button, .ld-actions-top button { min-height: 40px; padding: 0 18px; font-size: 14px; }
.ld-filters { gap: 12px; margin-bottom: 16px; }
.ld-search input, .ld-filter select { height: 40px; }
.ld-filter select { min-width: 220px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpis:has(> .card:only-child) { max-width: 420px; }
.kpis:has(> .card:nth-child(2):last-child) { max-width: 760px; }
.main.is-loading { position: relative; }
.main.is-loading::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--primary) 0 40%, transparent 40% 100%); background-size: 200% 100%; animation: ld-prog 1s linear infinite; z-index: 40; }
@keyframes ld-prog { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 1200px) { .ld { grid-template-columns: minmax(280px, 38%) minmax(0, 1fr); } .ld-filter select { min-width: 180px; } }
@media (max-width: 1000px) { .ld { grid-template-columns: minmax(260px, 42%) minmax(0, 1fr); } }
@media (max-width: 860px) {
  .ld { grid-template-columns: minmax(0, 1fr); }
  .ld-head { grid-template-columns: auto minmax(0, 1fr); } .ld-head-badges { grid-column: 1 / -1; justify-content: flex-start; padding-top: 0; max-width: none; }
  .ld-card { grid-template-columns: minmax(0, 1fr) auto 14px; padding: 14px 12px 14px 14px; }
  .ld-detail { padding: 16px; } .ld-title { font-size: 20px; }
  .ld-foot { justify-content: stretch; } .ld-foot button { flex: 1 1 140px; }
  .kpis:has(> .card:only-child), .kpis:has(> .card:nth-child(2):last-child) { max-width: none; }
}
/* tabelas dentro do painel de detalhes: mais compactas, acoes em uma linha */
.ld-sec-body table th, .ld-sec-body table td { padding: 8px 10px; }
.ld-sec-body td.actions { white-space: nowrap; }
.ld-sec-body td.actions button { margin: 0 2px 0 0; }
/* lista sem busca nem filtro (ex.: chamadas da revenda/portal): a faixa de filtros fica escondida de verdade (07/11/2026) */
.ld-filters[hidden] { display: none; }
