:root {
  --bg-0: #0B0F1A;
  --bg-1: #111A2E;
  --bg-2: #0E1526;
  --bg-violet: #131022;
  --line: #1E2A45;
  --line-soft: #17203a;
  --cyan: #22D3EE;
  --cyan-dim: #1B6D85;
  --violet: #A78BFA;
  --green: #34D399;
  --red: #F87171;
  --amber: #FBBF24;
  --pink: #F472B6;
  --tx-0: #E8EEF9;
  --tx-1: #C9D6EE;
  --tx-2: #8FA3C8;
  --tx-3: #7180A1;  /* clareado de #5C6B8A: contraste ~4.5:1 sobre o fundo escuro */
  --radius: 10px;
  --radius-lg: 14px;
  --font: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'Cascadia Code', 'Consolas', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--tx-1);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(34, 211, 238, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1c2740; border-radius: 6px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: #26324f; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* ---- sidebar ---- */
.sidebar {
  width: 60px;
  background: var(--bg-2);
  border-right: 0.5px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 6px;
  flex-shrink: 0;
}
.brand {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: #0E2233;
  border: 0.5px solid var(--cyan);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan);
  font-size: 20px;
  margin-bottom: 10px;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-bottom { margin-top: auto; }
.nav-item {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--tx-3);
  font-size: 20px;
  cursor: pointer;
  transition: background .16s, color .16s;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg-1); color: var(--tx-1); }
.nav-item.active { background: #0E2233; border: 0.5px solid var(--cyan); color: var(--cyan); }

/* ---- main ---- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px;
  border-bottom: 0.5px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px;
  flex-shrink: 0;
}
.topbar-title { font-size: 16px; font-weight: 500; color: var(--tx-0); }
.topbar-sub { font-size: 13px; color: var(--tx-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { flex: 1; overflow-y: auto; padding: 22px; }

/* ---- botoes ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  background: transparent;
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--tx-1);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s;
}
.btn:hover { border-color: #2c3a5c; background: var(--bg-1); color: var(--tx-0); }
.btn i { font-size: 16px; }
.btn.cyan { border-color: var(--cyan); color: var(--cyan); }
.btn.cyan:hover { background: #0E2233; }
.btn.ghost { border-color: transparent; }
.btn.danger:hover { border-color: #7F1D1D; color: var(--red); background: #1D0F14; }

/* ---- busca ---- */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--bg-1);
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  width: 280px;
}
.search:focus-within { border-color: var(--cyan-dim); }
.search i { color: var(--tx-3); font-size: 17px; }
.search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--tx-0); font-size: 13px; font-family: var(--font);
}
.search input::placeholder { color: var(--tx-3); }

/* ---- grid biblioteca ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.card {
  background: var(--bg-1);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: border-color .16s, transform .16s;
  display: flex; flex-direction: column; gap: 12px;
}
.card:hover { border-color: var(--cyan-dim); transform: translateY(-2px); }
.card-head { display: flex; align-items: flex-start; gap: 10px; }
.card-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: #0E2233; border: 0.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan); font-size: 18px;
}
.card-icon.ai { background: var(--bg-violet); border-color: #4C3A82; color: var(--violet); }
.card-title { font-size: 15px; font-weight: 500; color: var(--tx-0); line-height: 1.3; }
.card-date { font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.card-resumo {
  font-size: 13px; line-height: 1.5; color: var(--tx-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-resumo.vazio { color: var(--tx-3); font-style: italic; }
.card-meta { display: flex; gap: 14px; font-size: 12px; color: var(--tx-2); }
.card-meta span { display: inline-flex; align-items: center; gap: 5px; }
.card-meta i { font-size: 15px; color: var(--tx-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  border: 0.5px solid transparent;
}
.chip i { font-size: 13px; }
.chip.ok { background: #0E1B22; color: var(--green); border-color: #155E4D; }
.chip.wait { background: #17203a; color: var(--tx-2); border-color: var(--line); }
.chip.ai { background: var(--bg-violet); color: var(--violet); border-color: #4C3A82; }

/* ---- detalhe ---- */
.detail { max-width: 860px; margin: 0 auto; }
.detail-tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 0.5px solid var(--line); }
.tab {
  padding: 9px 14px; font-size: 13px; color: var(--tx-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--tx-0); }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }

.turn { display: flex; gap: 12px; margin-bottom: 14px; }
.avatar {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  background: #0E2233; border: 0.5px solid var(--cyan); color: var(--cyan);
}
.turn-body { min-width: 0; flex: 1; }
.turn-head { font-size: 12px; color: var(--tx-3); margin-bottom: 4px; }
.turn-name { font-weight: 500; cursor: pointer; border-radius: 3px; }
.turn-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.turn-ts {
  font-family: var(--mono); font-size: 11px; color: var(--tx-3);
  cursor: pointer;
}
.turn-ts:hover { color: var(--cyan); }

/* popover de renomear falante (clique no nome de quem falou) */
.pop-falante {
  position: fixed; z-index: 60; width: 260px;
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: 10px; padding: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
}
.pop-falante .pop-titulo { font-size: 12px; font-weight: 600; color: var(--tx-2); margin-bottom: 8px; }
.pop-falante .pop-input {
  width: 100%; box-sizing: border-box; font-size: 14px;
  padding: 8px 10px; border-radius: 7px;
  border: 0.5px solid var(--line); background: var(--bg-1); color: var(--tx-1);
}
.pop-falante .pop-input:focus { outline: none; border-color: var(--cyan); }
.pop-falante .pop-dica { font-size: 11px; color: var(--tx-3); margin: 6px 2px 10px; }
.pop-falante .pop-acoes { display: flex; gap: 8px; justify-content: flex-end; }
.bubble {
  background: var(--bg-1);
  border: 0.5px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  padding: 9px 13px;
  font-size: 14px; line-height: 1.6; color: var(--tx-1);
}

/* insights */
.ins-block { margin-bottom: 20px; }
.ins-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tx-3); margin-bottom: 8px;
  display: flex; align-items: center; gap: 7px;
}
.ins-h i { font-size: 15px; }
.ins-card {
  background: var(--bg-1); border: 0.5px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  font-size: 14px; line-height: 1.6; color: var(--tx-1);
}
.ins-card.ai { border-color: #4C3A82; background: var(--bg-violet); }
.ins-card.ok { border-color: #155E4D; background: #0E1B22; }
.ins-action { display: flex; flex-direction: column; gap: 3px; }
.ins-action .who { font-size: 12px; color: var(--tx-2); }
.ins-action .who b { color: var(--violet); font-weight: 500; }
.talk-row { margin-bottom: 10px; }
.talk-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--tx-2); margin-bottom: 4px; }
.talk-bar { height: 6px; background: var(--bg-1); border-radius: 3px; overflow: hidden; }
.talk-fill { height: 6px; border-radius: 3px; }

/* audio bar */
.audiobar {
  position: sticky; bottom: 0;
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: var(--radius); padding: 8px 12px; margin-top: 16px;
  display: flex; align-items: center; gap: 12px;
}
.audiobar audio { width: 100%; height: 34px; }

/* estados */
.empty, .loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; text-align: center; color: var(--tx-2); gap: 12px;
}
.empty i, .loading i { font-size: 42px; color: var(--tx-3); }
.empty h3 { color: var(--tx-0); font-weight: 500; font-size: 17px; }
.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120%);
  background: var(--bg-1); border: 0.5px solid var(--cyan-dim);
  color: var(--tx-0); padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; transition: transform .25s; z-index: 50;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--tx-2); cursor: pointer; font-size: 13px; margin-bottom: 16px;
}
.back:hover { color: var(--cyan); }

/* ---- sessao (usuario logado + sair, na barra superior) ---- */
/* Fica ao lado de .topbar-actions, separado por um filete: e' identidade,
   nao acao da tela atual. */
.sessao {
  display: flex; align-items: center; gap: 6px;
  padding-left: 12px; margin-left: 12px;
  border-left: 0.5px solid var(--line);
  flex-shrink: 0;
}
.sessao-eu {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--tx-2);
  max-width: 220px;
}
.sessao-eu i { font-size: 19px; color: var(--tx-3); }
.sessao-nome {
  color: var(--tx-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sessao-papel {
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-violet); color: var(--violet);
  border: 0.5px solid #4C3A82;
  flex-shrink: 0;
}
.sessao-sair { color: var(--tx-3); }
.sessao-sair:hover { border-color: #7F1D1D; color: var(--red); background: #1D0F14; }
.sessao-sair:disabled { opacity: .5; cursor: default; }

@media (max-width: 720px) {
  .sessao-nome, .sessao-papel { display: none; }
}

/* ---- detalhe paginado (Fase 5) ---- */
/* content-visibility deixa o navegador pular o layout dos turnos fora da tela:
   e o que permite rolar uma reuniao de 1817 trechos sem long task. O tamanho
   intrinseco reservado (~72px) evita que a barra de rolagem "pule". */
.turn { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.lista-turnos { display: block; }
.sentinela { height: 1px; }

/* ---- modal (focus trap, confirmacao destrutiva) ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 11, 20, 0.66);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 460px;
  background: var(--bg-1);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.modal-titulo { font-size: 16px; font-weight: 500; color: var(--tx-0); margin-bottom: 10px; }
.modal-corpo { font-size: 14px; line-height: 1.6; color: var(--tx-1); }
.modal-eco {
  font-family: var(--mono); font-size: 13px; color: var(--cyan);
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: var(--radius); padding: 7px 10px; margin: 10px 0 8px;
  user-select: all;
}
.modal-input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: var(--radius); color: var(--tx-0);
  font-size: 13px; font-family: var(--font); outline: none;
}
.modal-input:focus { border-color: var(--cyan-dim); }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { border-color: #7F1D1D; color: var(--red); }
.btn.danger:hover:not(:disabled) { background: #1D0F14; }

/* ---- tela de configuracoes (Fase 5) ---- */
.cfg { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.cfg-sec {
  background: var(--bg-1); border: 0.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
}
.cfg-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tx-3); margin-bottom: 14px;
  display: flex; align-items: center; gap: 7px;
}
.cfg-h i { font-size: 15px; }
.cfg-linha {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-top: 0.5px solid var(--line-soft);
  font-size: 14px; color: var(--tx-1);
}
.cfg-linha:first-of-type { border-top: none; }
.cfg-rot { color: var(--tx-3); }
.cfg-form { display: flex; flex-direction: column; gap: 12px; }
.cfg-form label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; color: var(--tx-2);
}
.cfg-form input {
  height: 38px; padding: 0 12px;
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: var(--radius); color: var(--tx-0);
  font-size: 13px; font-family: var(--font); outline: none;
}
.cfg-form input:focus { border-color: var(--cyan-dim); }
.cfg-form button { align-self: flex-start; margin-top: 4px; }
.cfg-erro { color: var(--red); font-size: 13px; min-height: 1px; }
.cfg-erro:empty { display: none; }
.cfg-nota { font-size: 14px; line-height: 1.6; color: var(--tx-2); }

/* ---- painel de usuarios (admin, dentro de Configuracoes) ---- */
.usr-topo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.usr-lista { display: flex; flex-direction: column; gap: 8px; }
.usr-linha {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 0.5px solid var(--line); border-radius: 10px;
  background: var(--bg-1);
}
.usr-info { min-width: 0; }
.usr-nome { font-size: 14px; font-weight: 500; color: var(--tx-0); }
.usr-eu { font-size: 12px; font-weight: 400; color: var(--tx-3); }
.usr-sub {
  font-size: 12px; color: var(--tx-3); margin-top: 3px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.usr-sub .chip { padding: 1px 7px; }
.usr-acoes { display: flex; gap: 4px; flex-shrink: 0; }
.usr-acoes .btn { padding: 6px 8px; }

/* ---- painel de licenca (dentro de Configuracoes) ---- */
.chip.danger { background: #2a1214; color: var(--red); border-color: #6b2029; }
.lic-linha {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; font-size: 14px; color: var(--tx-1);
}
.lic-fp {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-1); border: 0.5px solid var(--line);
  border-radius: 8px; padding: 6px 8px;
}
.lic-fp code {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; color: var(--tx-2);
}
.lic-token {
  width: 100%; box-sizing: border-box; resize: vertical;
  font-family: var(--mono); font-size: 12px; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px;
  border: 0.5px solid var(--line); background: var(--bg-1); color: var(--tx-1);
}
.lic-token:focus { outline: none; border-color: var(--cyan); }
.lic-acoes { display: flex; gap: 8px; margin-top: 10px; }
.lic-online { display: flex; gap: 8px; align-items: center; }
.lic-online .pop-input { flex: 1; min-width: 0; }
.lic-manual { margin-top: 12px; }
.lic-manual > summary {
  cursor: pointer; font-size: 13px; color: var(--tx-2);
  padding: 4px 0; user-select: none;
}
.lic-manual > summary:hover { color: var(--cyan); }

/* ---- bandeja de jobs (Fase 5) ---- */
.bandeja { position: relative; flex-shrink: 0; }
.bandeja-botao {
  position: relative; width: 38px; height: 38px;
  border-radius: 11px; background: transparent;
  border: 0.5px solid var(--line); color: var(--tx-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 19px;
  transition: border-color .16s, color .16s;
}
.bandeja-botao:hover { border-color: #2c3a5c; color: var(--tx-0); }
.bandeja-botao.ativo { border-color: var(--cyan); color: var(--cyan); }
.bandeja-botao.ativo i { animation: spin 1.4s linear infinite; }
.bandeja-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--cyan); color: #06131b;
  font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center;
}
.bandeja-painel {
  position: absolute; top: 46px; right: 0; z-index: 60;
  width: 320px; max-height: 60vh; overflow-y: auto;
  background: var(--bg-1); border: 0.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.bandeja-vazio { padding: 18px; text-align: center; color: var(--tx-3); font-size: 13px; }
.bandeja-item {
  padding: 10px; border-radius: var(--radius);
  border: 0.5px solid var(--line-soft); margin-bottom: 6px;
}
.bandeja-item:last-child { margin-bottom: 0; }
.bandeja-rot { font-size: 13px; color: var(--tx-1); margin-bottom: 6px; }
.bandeja-barra { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; }
.bandeja-fill { height: 6px; background: var(--cyan); border-radius: 3px; transition: width .3s; }
.bandeja-etapa { font-size: 11px; color: var(--tx-3); margin-top: 5px; }
.bandeja-ok { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 5px; }
.bandeja-erro { font-size: 12px; color: var(--red); }
.bandeja-cancel { font-size: 12px; color: var(--tx-3); }

/* ---- edicao de trecho (Fase 5) ---- */
.badge-editado {
  margin-left: 8px; font-size: 10px; letter-spacing: .03em;
  color: var(--amber); border: 0.5px solid #6b5518;
  background: #211a08; padding: 1px 6px; border-radius: 999px;
}
.bubble[contenteditable="true"], .bubble.editando {
  outline: none; border-color: var(--cyan-dim);
  box-shadow: 0 0 0 1px var(--cyan-dim);
  cursor: text;
}
.bubble { cursor: default; }

/* ---- tela falantes (Fase 5) ---- */
.cfg-check { flex-direction: row !important; align-items: flex-start; gap: 9px; cursor: pointer; }
.cfg-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--cyan); flex-shrink: 0; }
.cfg-check span { color: var(--tx-2); line-height: 1.5; }
.cfg-form input[type="file"] { padding: 7px 10px; height: auto; }
.voz-linha {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 0.5px solid var(--line-soft);
}
.voz-linha:first-child { border-top: none; }
.voz-eu { display: flex; align-items: center; gap: 11px; min-width: 0; }
.voz-av {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  background: #0E2233; border: 0.5px solid var(--cyan); color: var(--cyan);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.voz-nome { font-size: 14px; color: var(--tx-0); }
.voz-sub { font-size: 12px; color: var(--tx-3); }

/* ---- tela ao vivo (Fase 5) ---- */
.aovivo { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.av-topo { display: flex; align-items: baseline; gap: 14px; }
.av-cron { font-family: var(--mono); font-size: 34px; color: var(--tx-0); font-variant-numeric: tabular-nums; }
.av-estado { font-size: 13px; color: var(--tx-3); }
.av-nivel { height: 6px; background: var(--bg-1); border-radius: 3px; overflow: hidden; }
.av-nivel-fill { height: 6px; width: 0; background: var(--cyan); border-radius: 3px; transition: width .1s linear; }
.av-botao { align-self: flex-start; height: 42px; padding: 0 20px; }
.av-transcricao {
  min-height: 220px; max-height: 52vh; overflow-y: auto;
  background: var(--bg-1); border: 0.5px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.av-turno {
  font-size: 14px; line-height: 1.6; color: var(--tx-1);
  background: var(--bg-2); border: 0.5px solid var(--line-soft);
  border-radius: 4px 12px 12px 12px; padding: 9px 13px;
}
.av-parcial {
  font-size: 14px; line-height: 1.6; color: var(--tx-2); font-style: italic;
  padding: 9px 13px; border-left: 2px solid var(--cyan-dim);
}

/* ---- acessibilidade + responsividade (Fase 5) ---- */

/* Skip-link: escondido ate receber foco pelo teclado. */
.pular-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  background: var(--cyan); color: #06131b; font-size: 13px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius);
  transform: translateY(-150%); transition: transform .16s;
}
.pular-link:focus { transform: translateY(0); }

/* Foco visivel e consistente para quem navega por teclado (nao rouba o clique
   do mouse, gracas a :focus-visible). */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}
.nav-item:focus-visible { outline-offset: -2px; }
#view:focus { outline: none; }   /* alvo do skip-link: nao precisa de moldura */

/* Respeita quem pediu menos animacao no sistema. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- responsivo --- */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .search { width: 220px; }
}
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding: 10px 16px; gap: 8px; }
  .topbar-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .content { padding: 16px; }
  .detail, .cfg, .aovivo { max-width: 100%; }
  .search { width: 100%; }
}
@media (max-width: 640px) {
  .sidebar { width: 52px; padding: 10px 0; }
  .brand { width: 34px; height: 34px; font-size: 18px; }
  .nav-item { width: 36px; height: 36px; font-size: 18px; }
  .grid { grid-template-columns: 1fr; }
  .topbar-title { font-size: 15px; }
  .av-cron { font-size: 28px; }
  .bandeja-painel { width: min(320px, calc(100vw - 24px)); }
  .modal { max-width: 100%; }
  /* Botoes de export/acao no detalhe: quebram sem cortar a tela. */
  .btn { height: 32px; padding: 0 11px; }
}
