/* Painel administrativo – identidade em preto, branco e cinza. */
:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --ink-3: #6b6b6b;
  --ink-4: #9a9a9a;
  --line: #e6e6e6;
  --line-2: #d2d2d2;
  --fill: #efefef;
  --fill-2: #e3e3e3;
  --side: #0e0e0e;
  --side-ink: #f2f2f2;
  --side-ink-2: #9c9c9c;
  --side-hover: #1c1c1c;
  --side-active: #262626;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --side-w: 248px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 20px; margin: 14px 0 4px; letter-spacing: -.01em; }
.login-box p { margin: 0 0 22px; color: var(--ink-3); }
.marca { display: inline-flex; align-items: center; justify-content: center; line-height: 1; flex: none; width: 36px; height: 36px; border-radius: 9px;
  background: var(--ink); color: #fff; font-weight: 700; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- estrutura */
.app { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; z-index: 20; }
.side-topo { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; }
.side-topo .marca { background: #fff; color: var(--ink); width: 30px; height: 30px; font-size: 13px; }
.side-topo strong { font-size: 15px; letter-spacing: -.01em; }
.side-topo div span { display: block; font-size: 11.5px; color: var(--side-ink-2); }
.nav { list-style: none; margin: 6px 0 0; padding: 0 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--side-ink-2); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--side-hover); color: var(--side-ink); }
.nav a.ativo { background: var(--side-active); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.nav .cont { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff;
  color: var(--ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-rodape { padding: 14px 16px; border-top: 1px solid #222; font-size: 12.5px; }
.side-rodape .quem { color: var(--side-ink); font-weight: 600; }
.side-rodape .papel { color: var(--side-ink-2); }
.side-rodape button { margin-top: 8px; background: none; border: 1px solid #333; color: var(--side-ink-2);
  padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.side-rodape button:hover { color: #fff; border-color: #555; }

.main { margin-left: var(--side-w); flex: 1; min-width: 0; }
.topo { position: sticky; top: 0; z-index: 10; background: rgba(245,245,245,.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: 14px; padding: 16px 32px; border-bottom: 1px solid var(--line); }
.topo h1 { font-size: 19px; margin: 0; letter-spacing: -.015em; }
.topo .sub { color: var(--ink-3); font-size: 12.5px; }
.topo .esp { flex: 1; }
.atualizado { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.atualizado .ponto { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.atualizado.vivo .ponto { background: var(--ink); animation: pulso 2s infinite; }
@keyframes pulso { 50% { opacity: .3; } }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.conteudo { padding: 24px 32px 48px; max-width: 1400px; }

/* ---------------------------------------------------------------- blocos */
.grade { display: grid; gap: 16px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); min-width: 0; }
.card .rot { color: var(--ink-3); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.card .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .det { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.card.destaque { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.destaque .rot, .card.destaque .det { color: #bdbdbd; }
a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--line-2); }
.painel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; min-width: 0; }
.painel-cab { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; }
.painel-cab h2 { font-size: 14.5px; margin: 0; letter-spacing: -.005em; }
.painel-cab .esp { flex: 1; }
.painel-cab select { width: auto; }
.painel-corpo { padding: 16px 18px; }
.duas { display: grid; gap: 20px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.tres { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meia { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------------------------------------------------------- controles */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 550;
  font-size: 13px; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink-4); }
.btn.pri { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.pri:hover { background: #2a2a2a; }
.btn.perigo { border-color: var(--ink); color: var(--ink); }
.btn.perigo:hover { background: var(--ink); color: #fff; }
.btn.min { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.txt { border-color: transparent; background: none; padding: 0 6px; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.campo label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.campo .ajuda { font-size: 12px; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
select, textarea { height: 36px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  padding: 0 11px; width: 100%; outline: none; }
textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filtros input[type=search] { max-width: 320px; }
.filtros select, .filtros input[type=date] { width: auto; }
.linha-campos { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.chave { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.chave input { display: none; }
.chave .trilho { width: 38px; height: 22px; border-radius: 11px; background: var(--fill-2); position: relative; transition: background .15s; flex: none; }
.chave .trilho::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.chave input:checked + .trilho { background: var(--ink); }
.chave input:checked + .trilho::after { left: 19px; }

/* abas */
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.abas a { padding: 9px 14px; text-decoration: none; color: var(--ink-3); font-weight: 550; border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap; display: flex; gap: 7px; align-items: center; }
.abas a:hover { color: var(--ink); }
.abas a.ativo { color: var(--ink); border-bottom-color: var(--ink); }
.abas .n { background: var(--fill); color: var(--ink-2); border-radius: 9px; padding: 0 7px; font-size: 11.5px; font-weight: 650; }
.abas a.ativo .n { background: var(--ink); color: #fff; }

/* tabelas */
.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface-2); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.clicavel { cursor: pointer; }
tr.clicavel:hover td { background: var(--surface-2); }
.vazio { padding: 36px 16px; text-align: center; color: var(--ink-3); }
.paginacao { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3); }

/* selos de situação: forma + texto, nunca só cor */
.selo { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px;
  font-weight: 650; white-space: nowrap; border: 1px solid transparent; letter-spacing: .01em; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo.ok { background: var(--ink); color: #fff; }
.selo.aberto { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.selo.atencao { background: var(--fill-2); color: var(--ink); }
.selo.atencao::before { border-radius: 1px; transform: rotate(45deg); }
.selo.neg { background: var(--surface); color: var(--ink-2); border: 1px dashed var(--ink-3); }
.selo.neg::before { content: "×"; width: auto; height: auto; background: none; font-size: 12px; line-height: 1; }
.selo.neutro { background: var(--fill); color: var(--ink-3); }

/* listas de definição */
.defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.defs dt { color: var(--ink-3); font-size: 12.5px; }
.defs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* linha do tempo */
.tempo { list-style: none; margin: 0; padding: 0; }
.tempo li { position: relative; padding: 0 0 14px 20px; }
.tempo li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.tempo li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.tempo li:last-child::after { display: none; }
.tempo .q { font-size: 12px; color: var(--ink-3); }

/* atividades */
.ativ { list-style: none; margin: 0; padding: 0; }
.ativ li { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.ativ li:last-child { border-bottom: 0; }
.ativ .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--fill); display: grid; place-items: center; flex: none; }
.ativ .ic svg { width: 15px; height: 15px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ativ a { text-decoration: none; }
.ativ a:hover { text-decoration: underline; }
.ativ .q { font-size: 12px; color: var(--ink-3); }

/* gráficos */
.grafico { position: relative; }
.grafico svg { display: block; width: 100%; height: 220px; overflow: visible; }
.grafico .eixo { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.grafico .grade-l { stroke: var(--line); stroke-width: 1; }
.grafico .base { stroke: var(--ink-4); stroke-width: 1; }
.grafico .barra { fill: var(--ink); }
.grafico .barra.zero { fill: var(--fill-2); }
.grafico .alvo { fill: transparent; cursor: crosshair; }
.grafico .alvo:hover + .barra, .grafico .barra.hover { fill: #555; }
.dica { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 6px; padding: 6px 9px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 5; }
.dica b { display: block; font-size: 13px; }
.grafico-total { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* suporte */
.suporte { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 170px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sup-lista { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.sup-lista .abas { margin: 0; padding: 0 6px; }
.sup-lista .abas a { padding: 9px 8px; font-size: 13px; }
.sup-lista .busca { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sup-itens { overflow-y: auto; flex: 1; }
.sup-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; }
.sup-item:hover { background: var(--surface-2); }
.sup-item.ativo { background: var(--fill); }
.sup-item .l1 { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.sup-item .l1 .q { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.sup-item .l2 { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sup-conv { display: flex; flex-direction: column; min-height: 0; }
.sup-cab { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.menu-voltar { display: none !important; }
.sup-msgs { flex: 1; overflow-y: auto; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.bolha { max-width: 72%; padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bolha .q { display: block; font-size: 11px; margin-top: 4px; opacity: .7; }
.bolha.usuario { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-top-left-radius: 4px; }
.bolha.equipe { background: var(--ink); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.bolha.bot { background: var(--fill); align-self: flex-end; border-top-right-radius: 4px; color: var(--ink-2); }
.bolha.sistema { align-self: center; background: none; color: var(--ink-3); font-size: 12px; padding: 2px; }
.sup-resp { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.sup-resp textarea { min-height: 70px; }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; background: var(--fill);
  border: 1px solid var(--line-2); font-size: 13px; margin-bottom: 14px; }
.aviso::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }

/* documento */
.previa { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.previa-img { max-width: 100%; max-height: 520px; display: block; margin: 0 auto; border-radius: 6px; }
.dados-doc td:first-child { color: var(--ink-3); width: 38%; font-size: 12.5px; }

/* modal e gaveta */
.fundo { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px);
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.largo { max-width: 760px; }
.modal-cab { padding: 18px 22px 0; display: flex; align-items: flex-start; gap: 10px; }
.modal-cab h3 { margin: 0; font-size: 16.5px; letter-spacing: -.01em; flex: 1; }
.modal-cab .x { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 2px 4px; }
.modal-corpo { padding: 14px 22px 4px; }
.modal-corpo > p:first-child { margin-top: 0; }
.modal-rod { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.critico { border: 1px solid var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.erro-form { color: var(--ink); font-weight: 600; font-size: 13px; margin-bottom: 10px; display: flex; gap: 6px; }
.erro-form::before { content: "×"; font-weight: 700; }

/* avisos rápidos */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  max-width: 360px; font-size: 13px; }
.toast.erro { background: #fff; color: var(--ink); border: 1px solid var(--ink); }

.carregando { padding: 40px; text-align: center; color: var(--ink-3); }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); text-decoration: none; font-size: 13px; margin-bottom: 12px; }
.voltar:hover { color: var(--ink); }
.titulo-det { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.titulo-det h2 { margin: 0; font-size: 21px; letter-spacing: -.015em; }

/* ---------------------------------------------------------------- telas menores */
@media (max-width: 1100px) {
  .duas, .tres { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  .side.aberto { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topo { padding: 12px 16px; }
  .conteudo { padding: 16px 16px 40px; }
  .meia { grid-template-columns: minmax(0, 1fr); }
  .suporte { grid-template-columns: minmax(0, 1fr); }
  .suporte.com-conversa .sup-lista { display: none; }
  .menu-voltar { display: inline-flex !important; }
  .suporte:not(.com-conversa) .sup-conv { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card .val { font-size: 21px; }
  .bolha { max-width: 88%; }
}
