/* why: layout em «mesa de redação»: lateral fixa, coluna de trabalho no centro e, na Mesa, uma coluna do agente à direita. Cor só por token de base.css. */

/* casca */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.lado { background: var(--s0); border-right: 1px solid var(--rule); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.lado .marca { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 0 8px 2px; display: flex; align-items: center; gap: 8px; }
.lado .marca i { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); display: inline-block; position: relative; }
.lado .marca i::before, .lado .marca i::after { content: ""; position: absolute; left: 5px; right: 5px; height: 2px; background: var(--s0); border-radius: 2px; transform: rotate(-24deg); }
.lado .marca i::before { top: 7px; } .lado .marca i::after { top: 13px; }
.lado .marca .logo { height: 26px; width: auto; display: block; }
.lado .lema { color: var(--muted); font-size: 12px; margin: 0 8px 14px; }
.lado .grupo { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin: 14px 10px 4px; }
.lado a { color: var(--ink-2); text-decoration: none; padding: 7px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lado a.on, .lado a:hover { background: var(--s1); color: var(--ink); }
.lado a.on { font-weight: 600; }
.lado .conta { margin-top: auto; color: var(--muted); font-size: 13px; padding: 10px; border-top: 1px solid var(--rule); }
.lado .conta b { color: var(--ink); font-weight: 600; }
.num { background: var(--human); color: var(--human-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
main { padding: 24px 32px 48px; min-width: 0; }
.limite { max-width: 1180px; }

/* tipografia */
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 15px; margin: 0; font-weight: 650; }
h3 { font-size: 13px; margin: 0; font-weight: 600; color: var(--ink-2); }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.rotulo { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.peq { font-size: 13px; color: var(--muted); }
a.lk { color: var(--human); text-decoration: none; } a.lk:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--human); outline-offset: 2px; border-radius: 4px; }

/* blocos */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.pilha { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.secao { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.secao + .secao { margin-top: 26px; }
.cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.painel { background: var(--s0); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.painel.liso { background: transparent; border-style: dashed; }
.linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.espaco { flex: 1; }
.vazio { color: var(--muted); padding: 18px 0; }

/* estados e marcas */
.estado { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--s1); color: var(--ink-2); white-space: nowrap; }
.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado.agente { background: var(--agent-soft); color: var(--agent); }
.estado.espera { background: var(--human-soft); color: var(--human); }
.estado.ok { background: var(--ok-soft); color: var(--ok); }
.estado.aviso { background: var(--warn-soft); color: var(--warn); }
.estado.crit { background: var(--crit-soft); color: var(--crit); }
.rede { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--s0); font-size: 11px; font-weight: 700; flex: none; letter-spacing: -0.02em; }
.rede.off { background: var(--s1); color: var(--muted); }
.rede.g { width: 28px; height: 28px; font-size: 13px; border-radius: 8px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.novo { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 4px; background: var(--agent-soft); color: var(--agent); }

/* botões */
.btn { border: 1px solid var(--rule); background: var(--s0); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--muted); }
.btn.decide { background: var(--human); color: var(--human-ink); border-color: var(--human); font-weight: 600; }
.btn.decide:hover { filter: brightness(1.08); }
.btn.mini { padding: 3px 9px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule); background: var(--s0); color: var(--ink-2); border-radius: 999px; padding: 3px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.chip.on { background: var(--ink); color: var(--s0); border-color: var(--ink); }

/* «precisa de você» */
.pend { background: var(--s0); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; }
.pend .tit { font-weight: 600; color: var(--ink); text-decoration: none; }
.pend .tit:hover { color: var(--human); }
.pend .trecho { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pend .acoes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pend .porque { grid-column: 1 / -1; font-size: 13px; color: var(--agent); background: var(--agent-soft); border-radius: 8px; padding: 5px 10px; }
/* why: a rejeição aberta no cartão (CDK-09): o painel toma a largura toda e os botões do cartão saem enquanto ele está aberto */
.pend .acoes:has(.rejeicao) { grid-column: 1 / -1; justify-content: flex-start; }
.pend .acoes:has(.rejeicao) > .btn { display: none; }
.pend .rejeicao { flex: 1 1 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 10px; }
.pend .rejeicao .pedido { flex: 1 1 100%; }

.opcao { display: grid; grid-template-columns: auto 78px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.opcao .tag { text-align: center; }

/* linha do agente e diário */
.pulso { display: flex; gap: 10px; align-items: flex-start; background: var(--agent-soft); color: var(--ink); border-radius: 12px; padding: 12px 14px; }
.pulso .bola { width: 10px; height: 10px; border-radius: 50%; background: var(--agent); margin-top: 6px; flex: none; animation: pulsar 1.8s ease-in-out infinite; }
.pulso.parado .bola { animation: none; opacity: 0.5; }
@keyframes pulsar { 50% { transform: scale(1.5); opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .pulso .bola { animation: none; } }
.diario { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.diario li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.diario li:first-child { border-top: 0; }
.diario time { color: var(--muted); font-variant-numeric: tabular-nums; }
.diario .quem-voce { color: var(--human); font-weight: 600; }

/* vai ao ar hoje */
.ar { display: grid; grid-template-columns: 52px 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--rule); }
.ar:first-of-type { border-top: 0; }
.ar time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.ar a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar a:hover { color: var(--human); }

/* tabelas */
.rolagem { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td a { color: var(--ink); font-weight: 600; text-decoration: none; } td a:hover { color: var(--human); }

/* peça */
.voltar { color: var(--muted); text-decoration: none; font-size: 13px; }
.versoes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.versao { background: var(--s0); border: 1px solid var(--rule); border-radius: 12px; display: flex; flex-direction: column; min-width: 0; }
.versao.fora { background: transparent; border-style: dashed; }
.versao header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.versao .corpo { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.versao .texto { white-space: pre-wrap; font-size: 14px; color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.versao textarea { width: 100%; min-height: 150px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--human); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.versao footer { margin-top: auto; padding: 10px 14px; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mudou { font-size: 13px; color: var(--agent); background: var(--agent-soft); border-radius: 8px; padding: 5px 10px; }
.conta-car { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.conta-car.estourou { color: var(--crit); font-weight: 600; }
.cartao { aspect-ratio: 4 / 5; max-width: 190px; width: 100%; background: #12151C; color: #F2F4F8; border-radius: 8px; border: 1px solid #2B3441; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; font-weight: 650; font-size: 14px; line-height: 1.25; }
.cartao small { font-weight: 500; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #9AA5B5; }
.cartoes { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.cartoes .cartao { flex: 0 0 120px; font-size: 11px; padding: 10px; }
.ficha { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 0; }
.ficha dt { color: var(--muted); } .ficha dd { margin: 0; }
.checagens { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.checagens li { display: flex; gap: 8px; align-items: baseline; }
.checagens .m { font-weight: 700; width: 14px; flex: none; }
.checagens .passa .m { color: var(--ok); } .checagens .atencao .m { color: var(--warn); } .checagens .falha .m { color: var(--crit); }
.decisao { position: sticky; bottom: 0; background: var(--s0); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: 0 -6px 18px rgb(0 0 0 / 0.06); }
.pedido { display: flex; gap: 8px; flex: 1 1 280px; min-width: 0; }
.pedido input { flex: 1; min-width: 0; font: inherit; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); color: var(--ink); }

/* calendário */
.cal { display: grid; grid-template-columns: 96px repeat(7, minmax(118px, 1fr)); min-width: 940px; border: 1px solid var(--rule); border-radius: 12px; background: var(--s0); overflow: hidden; }
.cal > div { border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); padding: 8px; min-height: 76px; display: flex; flex-direction: column; gap: 5px; }
.cal > .dia, .cal > .canto { min-height: 0; border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal > .canto, .cal > .lin { border-left: 0; }
.cal > .dia.hoje { color: var(--human); background: var(--human-soft); }
.cal > .lin { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cal > .cel.hoje { background: color-mix(in srgb, var(--human-soft) 45%, transparent); }
.post { display: block; text-decoration: none; color: var(--ink); font-size: 12px; line-height: 1.3; border-radius: 6px; padding: 4px 6px; background: var(--s1); border-left: 3px solid var(--muted); }
.post b { font-variant-numeric: tabular-nums; }
.post.publicado { border-left-color: var(--ok); }
.post.agendado { border-left-color: var(--agent); background: var(--agent-soft); }
.post.espera { border-left-color: var(--human); background: var(--human-soft); }
.post.falhou { border-left-color: var(--crit); background: var(--crit-soft); }
.vaga { font-size: 11px; color: var(--muted); border: 1px dashed var(--rule); border-radius: 6px; padding: 3px 6px; }
/* arrastar o agendado para outra vaga (CDK-11, critérios 42 a 46) */
.post[data-arrasta] { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.post.arrastando { opacity: 0.45; }
.cal.arrastando { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.vaga.destino { min-height: 32px; line-height: 24px; text-align: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--human); border-color: var(--human); background: var(--s0); }
.vaga.destino.sobre { border-style: solid; background: var(--human); color: var(--human-ink); }
.cal.arrastando > .cel.aceita { outline: 2px dashed var(--human); outline-offset: -3px; }
.cal.arrastando > .cel.apagada { opacity: 0.35; }
.cal.arrastando > .cel.sobre { outline-style: solid; background: var(--human-soft); }
.post.fantasma { position: fixed; z-index: 35; pointer-events: none; transform: translate(-50%, -50%); opacity: 0.85; box-shadow: 0 8px 22px rgb(0 0 0 / 0.22); }
.post.fantasma .para { display: block; height: 20px; line-height: 20px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--human); }
.legenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* redes, frentes, agente */
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.conexao { display: flex; flex-direction: column; gap: 8px; }
.conexao ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.passos { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.passos li::before { content: "○ "; color: var(--muted); } .passos li.feito::before { content: "● "; color: var(--ok); }
.tg { background: var(--s1); border-radius: 12px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; max-width: 420px; border: 1px solid var(--rule); }
.tg .bts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tg .bts span { flex: 1 1 auto; text-align: center; background: var(--s0); border: 1px solid var(--rule); border-radius: 8px; padding: 4px 8px; white-space: nowrap; }
.marca-x { text-align: center; }
.sim { color: var(--ink); font-weight: 700; } .nao { color: var(--rule); }
.escada { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.escada:first-of-type { border-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; font-size: 13px; border: 0; background: var(--s0); color: var(--ink-2); padding: 4px 10px; cursor: pointer; border-left: 1px solid var(--rule); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--agent); color: var(--agent-ink); font-weight: 600; }
.seg button[disabled] { cursor: not-allowed; opacity: 0.55; }

/* figuras e gráficos */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tile .valor { font-size: 28px; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; }
.tile .delta { font-size: 12px; color: var(--muted); }
.graf { width: 100%; height: auto; display: block; }
.graf text { fill: var(--muted); font: 11px "Segoe UI", system-ui, sans-serif; }
.graf .forte { fill: var(--ink-2); }
.graf .gr { stroke: var(--grade); stroke-width: 1; } .graf .ex { stroke: var(--eixo); stroke-width: 1; }
.graf [data-dica] { cursor: default; } .graf [data-dica]:hover { filter: brightness(1.12); }
.s1 { fill: var(--serie-1); background: var(--serie-1); } .s2 { fill: var(--serie-2); background: var(--serie-2); }
.s3 { fill: var(--serie-3); background: var(--serie-3); } .s4 { fill: var(--serie-4); background: var(--serie-4); }
.dica { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 5px 9px; border-radius: 6px; max-width: 260px; }

/* aviso */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 40; max-width: min(92vw, 560px); }
.bloqueio { max-width: 520px; margin: 12vh auto; text-align: center; }

@media (max-width: 1080px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .versoes { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lado { border-right: 0; border-bottom: 1px solid var(--rule); flex-direction: row; flex-wrap: wrap; align-items: center; }
  .lado .grupo, .lado .marca .logo { height: 26px; width: auto; display: block; }
.lado .lema { display: none; } .lado .conta { margin: 0; border: 0; width: 100%; }
  main { padding: 16px; }
  .pend { grid-template-columns: minmax(0, 1fr); } .pend .acoes { justify-content: flex-start; }
}

/* why: comentários do X (CDK-20): o cartão numa coluna de leitura, a caixa com o desenho da edição da peça e o aviso que quebra linha */
.comentarios .pilha, .comentarios .faixa-aviso { max-width: 760px; }
.comentario { gap: 8px; }
.comentario .texto { white-space: pre-wrap; font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.comentario .texto.enviado { color: var(--ink-2); border-left: 3px solid var(--human); padding-left: 10px; }
.comentario p.peq { margin: 0; }
.comentario textarea { width: 100%; min-height: 80px; font: inherit; font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.comentario .nao-saiu { margin: 0; font-size: 13px; color: var(--crit); background: var(--crit-soft); border-radius: 8px; padding: 5px 10px; overflow-wrap: anywhere; }
.faixa-aviso { margin: 0 0 14px; color: var(--warn); background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; }
.secao.resolvidos { margin-top: 26px; }

/* v3: as cinco lacunas */
.opcao.varias { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; }
.opcao.varias .tese { flex: 1 1 240px; min-width: 0; }
.opcao.varias .estado { min-width: 84px; justify-content: center; }
.colar select, .colar textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 10px; }
.colar textarea { width: 100%; min-height: 120px; font-size: 14px; resize: vertical; }
.variante { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--rule); padding-top: 10px; }
.variante .texto { white-space: pre-wrap; font-size: 14px; color: var(--ink-2); margin: 0; overflow-wrap: anywhere; }
.resultado { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--rule); padding-top: 10px; }
.resultado .ficha { font-size: 13px; }
.checagens .aberto .m { color: var(--muted); }
