/* CRM FISHCORE */

/* Rubik (SIL OFL 1.1, ver /fonts/OFL.txt), hospedada aqui: instâncias estáticas do
   googlefonts/rubik, subconjunto latino. */
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/rubik-400.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/rubik-500.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/rubik-600.woff2') format('woff2'); }

/* Paleta oficial (manual 2026): vermelho #F21A3D, preto #212121, bege #FFFAEE, Chamas #FF6441;
   apoio #A50F23, #EDE7D8, #6E695E. Os tons marcados "derivado" saem do preto (escuro) ou do
   bege (claro) para separar fundo, painel e linha; não são cores novas da marca.
   --ok e --danger são semânticos e ficam fora da paleta. */
:root {
  --bg: #212121;
  --bg-2: #1A1A1A;    /* derivado: topo, um passo abaixo do fundo */
  --panel: #2A2927;   /* derivado */
  --panel-2: #33312D; /* derivado */
  --line: #3E3B35;    /* derivado */
  --input-bg: #262524; --input-line: #4F4B44; /* derivados */
  --filtros-bg: #1A1A1A;
  --red: #F21A3D; --red-2: #A50F23; --cream: #FFFAEE; --ink: #212121;
  /* Nenhum texto sobre #F21A3D chega a 4,5:1; #171717 dá 4,26:1 (o preto oficial, 3,83:1). */
  --on-red: #171717;
  --on-warn: #212121; /* 5,48:1 sobre Chamas */
  /* Nota 12: no escuro, todo texto é o mesmo bege; a hierarquia vem de tamanho e peso. */
  --text: #FFFAEE; --muted: #FFFAEE;
  --red-text: #FFFAEE; --danger-text: #ff5c5c;
  --ok: #2fbf71; --warn: #FF6441; --danger: #ff5c5c;
  --radius: 12px; --shadow: 0 8px 24px rgba(0,0,0,.35);
  /* Abas do fichário: em relevo (soltas) e afundada (selecionada). */
  --relevo: inset 0 1px 0 rgba(255,250,238,.07), 0 -1px 4px rgba(0,0,0,.4);
  --afundado: inset 0 3px 6px rgba(0,0,0,.45), inset 0 -1px 0 rgba(255,250,238,.18);
  /* Provisório (#12): Rubik 600 em caixa alta até a fonte de títulos da marca ser liberada.
     Trocar aqui e em --peso-display. */
  --font-display: 'Rubik', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --peso-display: 600;
  --font-body: 'Rubik', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --scroll: #57534B; --scroll-hover: #6E695E; /* derivado; apoio */
  --toque: 44px;
  /* Faz barras de rolagem, selects e calendários nativos seguirem o tema. */
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F5F0E4; --bg-2: #F5F0E4; /* derivado: entre o bege e o #EDE7D8 */
  --panel: #FFFAEE;
  --panel-2: #FFFDF7; /* derivado */
  --text: #212121; --muted: #6E695E;
  --line: #E3DBCA;    /* derivado */
  --input-bg: #FFFDF7; --input-line: #CFC5B1; /* derivados */
  --filtros-bg: #EDE8DE;
  /* Vermelho como texto no claro: #A50F23 (6,9:1); #F21A3D e --danger ficam abaixo de 4,5:1. */
  --red-text: #A50F23; --danger-text: #A50F23;
  --shadow: 0 6px 18px rgba(0,0,0,.08);
  --relevo: inset 0 1px 0 #fff, 0 -1px 3px rgba(33,33,33,.12);
  --afundado: inset 0 3px 6px rgba(0,0,0,.35), inset 0 -1px 0 rgba(255,250,238,.25);
  --scroll: #CFC5B1; --scroll-hover: #B3A890; /* derivados */
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-synthesis-weight: none; }
h1, h2, h3, h4, h5, h6, b, strong, th { font-weight: 600; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; line-height: 1.4; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
button, a, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea { font-family: inherit; font-size: 14px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Barras de rolagem no tema: padrão (Chrome 121+, Firefox) ou -webkit- (Safari). */
@supports (scrollbar-color: auto) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
}
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
  ::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
  ::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); background-clip: padding-box; }
}

/* Campos fora de .campo (tabelas, listas) com o mesmo visual dos formulários. */
input:where(:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range])), select, textarea {
  background: var(--input-bg); border: 1.5px solid var(--input-line); border-radius: 8px; color: var(--text); outline: none; padding: 0 10px; height: 38px; max-width: 100%;
}
textarea { padding: 8px 10px; height: auto; }
input:where(:not([type=checkbox]):not([type=radio])):focus, select:focus, textarea:focus { border-color: var(--red); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 8px;
}
select:disabled { opacity: .6; cursor: not-allowed; }
input[type=checkbox], input[type=radio] { accent-color: var(--red); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }

/* Topo */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 22px; flex-wrap: nowrap; min-height: 60px; }
.topbar > * { flex-shrink: 0; }
.topbar > .spacer { flex-shrink: 1; min-width: 0; }
/* Logo da marca: bege no escuro, preto no claro (PNG com 2× a altura do grande). */
.logo-marca { display: inline-flex; align-items: center; line-height: 0; user-select: none; }
.logo-marca img { display: block; height: 20px; width: auto; }
.logo-marca .claro, [data-theme="light"] .logo-marca .escuro { display: none; }
[data-theme="light"] .logo-marca .claro { display: block; }
.logo-marca.grande img { height: 36px; }

/* Ícones da marca (notas 14, 16, 17, 18): a silhueta é máscara e a cor vem do texto. */
[data-tela="oportunidades"] { --icone: url("/img/icone-abissal.png"); }
[data-tela="interacoes"] { --icone: url("/img/icone-estrela.svg"); }
[data-tela="pessoas"] { --icone: url("/img/icone-olho.svg"); }
[data-tela="empresas"] { --icone: url("/img/icone-periscopio.svg"); }
.tab-icone,
section[data-tela="oportunidades"] .cabecalho h1::before, section[data-tela="interacoes"] .cabecalho h1::before,
section[data-tela="pessoas"] .cabecalho h1::before, section[data-tela="empresas"] .cabecalho h1::before {
  content: ""; flex: none; display: inline-block; width: 28px; height: 20px; background: currentColor;
  -webkit-mask: var(--icone) center / contain no-repeat; mask: var(--icone) center / contain no-repeat;
}
section[data-tela] .cabecalho h1 { display: inline-flex; align-items: center; gap: 10px; }
section[data-tela] .cabecalho h1::before { width: 34px; height: 24px; }

/* Menu em fichário (notas 2, 20, 24): divisórias coladas na linha de baixo do topo. */
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; align-self: flex-end; margin-bottom: -11px; }
.tab {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-width: 76px; padding: 7px 10px 6px; border: 1px solid var(--line); border-bottom: none; border-radius: 8px 8px 0 0;
  background: var(--panel); color: var(--text); box-shadow: var(--relevo);
  font-family: var(--font-body); font-weight: 400; font-size: 11px; line-height: 1.2; letter-spacing: .6px; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
}
.tab.ativa { background: var(--red); border-color: var(--red); color: var(--on-red); box-shadow: var(--afundado); transform: translateY(1px); }
@media (hover: hover) {
  .tab:not(.ativa):hover { background: var(--panel-2); }
}
.abas-admin { display: none; }
.spacer { flex: 1; }
/* Nota 7: pílula menor. */
.status-pill { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: inline-block; flex-shrink: 0; }
.status-pill.ok i { background: var(--ok); }
.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { display: block; flex: none; }
/* Notas 6 e 9: foto e nome; o papel vai para o title; Sair só com ícone. */
.usuario { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.usuario img { width: 30px; height: 30px; border-radius: 50%; }
.usuario .nome { white-space: nowrap; font-weight: 500; }

/* Nota 19: engrenagem com as telas de admin, ao lado do Sair. */
.config-menu { position: relative; }
.btn-config.ativa { background: var(--red); border-color: var(--red); color: var(--on-red); }
.config-lista { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 200px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.config-lista a { display: flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 6px; text-decoration: none; font-family: var(--font-display); font-weight: var(--peso-display); font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--text); }
.config-lista a:hover { background: var(--panel-2); }
.config-lista a.ativa { background: var(--red); color: var(--on-red); }

/* Menu compacto: o app.js liga .compacta quando as abas não cabem numa linha. */
.menu-btn { display: none; align-items: center; gap: 10px; min-height: 40px; min-width: 0; padding: 0 12px; background: var(--red); color: var(--on-red); border: none; border-radius: 8px; font-family: var(--font-display); font-weight: var(--peso-display); font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.menu-btn .rotulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn .seta { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s; flex-shrink: 0; }
.menu-btn[aria-expanded="true"] .seta { transform: translateY(2px) rotate(-135deg); }
.topbar.compacta { gap: 10px; }
.topbar.compacta .menu-btn { display: inline-flex; flex-shrink: 1; }
.topbar.compacta .usuario { display: none; }
.topbar.compacta .menu-rodape { display: flex; }
.topbar.compacta .tabs {
  display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; margin: 0;
  background: var(--bg-2); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 12px 12px;
  max-height: calc(100dvh - 70px); overflow-y: auto;
}
.topbar.compacta.menu-aberto .tabs { display: flex; }
.topbar.compacta .tab {
  flex-direction: row; justify-content: flex-start; gap: 12px; min-width: 0; min-height: var(--toque); padding: 0 14px;
  border: none; border-radius: 8px; background: transparent; box-shadow: none; transform: none;
  font-family: var(--font-display); font-weight: var(--peso-display); font-size: 15px; letter-spacing: 1px;
}
.topbar.compacta .tab.ativa { background: var(--red); color: var(--on-red); }
.topbar.compacta .tab-icone { width: 26px; height: 18px; }
.topbar.compacta .abas-admin { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.abas-titulo { display: flex; align-items: center; gap: 8px; padding: 4px 14px; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.menu-fundo { position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,.35); }
.menu-rodape { display: none; align-items: center; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.menu-rodape img { width: 32px; height: 32px; border-radius: 50%; }
.menu-rodape .nome { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }

/* Telas */
main { padding: 18px 22px 48px; max-width: 1600px; margin: 0 auto; }
.tela-central { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.tela-central .caixa { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-width: 520px; box-shadow: var(--shadow); }
.cabecalho { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.cabecalho h1 { font-family: var(--font-display); font-weight: var(--peso-display); font-size: 28px; letter-spacing: .5px; text-transform: uppercase; margin: 0; }
.cabecalho .sub { font-size: 12px; color: var(--muted); }

/* Botões */
.btn { white-space: nowrap; border: none; border-radius: 8px; padding: 9px 14px; font-weight: var(--peso-display); font-size: 13px; letter-spacing: .6px; text-transform: uppercase; font-family: var(--font-display); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-primario { background: var(--red); color: var(--on-red); }
.btn-primario:hover { filter: brightness(1.08); }
.cabecalho > .btn.btn-nova { width: 200px; max-width: 100%; height: 22px; padding: 0 10px; margin-left: auto; justify-content: center; font-size: 11px; letter-spacing: .3px; border-radius: 5px; line-height: 1.2; }
.btn-contorno { background: transparent; border: 1.5px solid var(--line); color: var(--text); font-family: var(--font-body); font-weight: 600; text-transform: none; letter-spacing: 0; }
.btn-contorno:hover { border-color: var(--muted); }
.btn-perigo { background: transparent; border: 1.5px solid var(--danger-text); color: var(--danger-text); }
.btn-pq { padding: 5px 9px; font-size: 11px; }
.btn-google { background: #fff; color: #212121; border: 1px solid #ddd; font-family: var(--font-body); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 15px; padding: 11px 18px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #0C0C0C; color: var(--cream); border: 1px solid #2E2C28; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); } /* derivados do preto, nos dois temas */
.kpi .lbl { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.kpi .val { font-family: var(--font-display); font-size: 14.4px; font-weight: var(--peso-display); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }

/* Filtros e campos */
.filtros { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; background: var(--filtros-bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.filtros .campo { min-width: 140px; flex: 1; position: relative; }
.filtros .campo.busca { flex: 2; min-width: 240px; }
.filtros .campo.campo-check { flex: 0 0 auto; min-width: 0; }
.filtros .campo:not(.filtro-multiplo) { border: 1px solid var(--input-line); border-radius: 24px; background: var(--input-bg); padding: 5px 12px; gap: 0; }
.filtros .campo > label { font-size: 11px; letter-spacing: 0; text-transform: none; }
.filtros .campo input:not([type=checkbox]), .filtros .campo select { border: 0; border-radius: 0; padding: 0; height: 22px; min-width: 0; background-color: transparent; color: var(--text); font-size: 11px; }
.filtros .campo select { padding-right: 32px; }
.filtros .campo.busca { padding-left: 34px; }
.filtros .campo.busca::before { content: ""; position: absolute; left: 12px; top: 14px; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.filtros .campo.busca::after { content: ""; position: absolute; left: 23px; top: 25px; width: 6px; height: 2px; background: currentColor; transform: rotate(45deg); }
.filtros .campo:not(.filtro-multiplo):focus-within { outline: 2px solid var(--red); outline-offset: 2px; }
.filtros .campo > input:focus-visible, .filtros .campo > select:focus-visible { outline: none; }
.filtro-pilula:focus-visible, .filtro-pilula[aria-expanded="true"] { outline: 2px solid var(--red); outline-offset: 2px; }
.filtro-pilula { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 42px; border: 1px solid var(--input-line); border-radius: 24px; padding: 6px 12px; background: var(--input-bg); color: var(--text); font-size: 11px; text-align: left; }
.filtro-rotulo { font-weight: 500; flex: none; }
.filtro-pilula [data-valor] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filtro-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: 100%; min-width: 0; max-height: min(360px, 60dvh); overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.filtro-menu label { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px; font-size: 11px; cursor: pointer; }
.filtro-menu label span:last-child { min-width: 0; overflow-wrap: anywhere; }
.filtro-menu label input[type=checkbox] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.filtro-menu label:hover { background: var(--panel-2); }
.filtro-menu label:focus-within { outline: 2px solid var(--red); outline-offset: -2px; border-radius: 5px; }
.filtro-menu label input:focus-visible { outline: none; }
.filtro-menu [data-limpar] { width: 100%; margin-top: 6px; }
.monograma-fc { display: inline-block; width: 18px; height: 18px; vertical-align: middle; background: currentColor; -webkit-mask: url("/img/monograma-fc.png") center / contain no-repeat; mask: url("/img/monograma-fc.png") center / contain no-repeat; }
.tabela th .monograma-fc { width: 13px; height: 13px; }
.detalhe dt .monograma-fc { width: 20px; height: 20px; }
.iniciais { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; width: 24px; height: 24px; flex: none; background: var(--panel-2); font-size: 11px; }
.filtro-interruptor { display: flex; align-items: center; gap: 6px; min-height: 42px; font-size: 11px; cursor: pointer; }
.filtro-interruptor input { appearance: none; position: relative; width: 30px; height: 18px; flex: none; border: 1px solid var(--input-line); border-radius: 20px; background: var(--panel-2); margin: 0; cursor: pointer; }
.filtro-interruptor input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text); }
.filtro-interruptor input:checked { background: var(--red); border-color: var(--red); }
.filtro-interruptor input:checked::before { left: 14px; background: var(--on-red); }
.campo { display: flex; flex-direction: column; gap: 4px; }
.campo > label, .campo > .rotulo { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.campo .obrig::after { content: ' *'; color: var(--red); }
.campo input, .campo select, .campo textarea { width: 100%; }
.campo textarea { min-height: 80px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--red); }
.campo input[readonly] { opacity: .7; }
.campo .ajuda { font-size: 11px; color: var(--muted); }
.campo.erro input, .campo.erro select, .campo.erro textarea { border-color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0; }
.campo input[type=checkbox], .campo input[type=radio], .checks input[type=checkbox] { width: auto; height: auto; padding: 0; accent-color: var(--red); }
label.checks { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; }
.checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grade .inteiro { grid-column: 1 / -1; }
.form-modulo { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.form-modulo legend { padding: 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.modulo-numero { color: var(--danger-text); margin-right: 6px; font-variant-numeric: tabular-nums; }
.secao { grid-column: 1 / -1; font-family: var(--font-display); font-weight: var(--peso-display); text-transform: uppercase; letter-spacing: 1px; font-size: 13px; color: var(--red-text); border-bottom: 1px solid var(--red); padding-bottom: 4px; margin-top: 6px; }
@media (max-width: 720px) { .grade { grid-template-columns: 1fr; } }

/* Tabelas */
.tabela-wrap { overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { text-align: left; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); white-space: nowrap; }
.tabela td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: var(--panel-2); }
.tabela tr.arquivado td { opacity: .5; }
.tabela .cod { font-family: var(--font-display); letter-spacing: .5px; white-space: nowrap; }
.vazio { padding: 28px; text-align: center; color: var(--muted); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip.claro { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.chip.alerta { background: var(--warn); color: var(--on-warn); }
/* Texto escuro: o branco dá só 3,0:1 sobre --danger e 2,3:1 sobre --ok. */
.chip.perigo { background: var(--danger); color: var(--ink); }
.chip.ok { background: var(--ok); color: var(--ink); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip .icon-btn { min-width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%; color: inherit; font-size: 15px; line-height: 1; margin-right: -5px; }
.chip .icon-btn:hover { background: var(--line); }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; overscroll-behavior-x: contain; scroll-padding: 0 2px; }
.coluna { flex: 0 0 300px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 260px); max-height: calc(100dvh - 260px); min-height: 220px; }
.coluna-topo { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 12px; font-family: var(--font-display); font-size: 11px; text-transform: uppercase; letter-spacing: .2px; font-weight: var(--peso-display); border-bottom: 1px solid var(--line); }
.coluna-titulo { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coluna-topo .chip, .coluna-topo .qtd { flex: none; }
.coluna-topo .qtd { color: var(--text); font-family: var(--font-body); font-weight: 500; font-size: 11px; font-variant-numeric: tabular-nums; opacity: .8; }
.coluna-corpo { padding: 10px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 80px; }
.coluna-corpo.alvo { outline: 2px dashed var(--red); outline-offset: -6px; }
.coluna-pe { padding: 8px 10px; border-top: 1px solid var(--line); }
.coluna-pe button { width: 100%; min-height: 36px; background: transparent; border: 1px dashed var(--line); color: var(--muted); border-radius: 8px; padding: 6px; }
.coluna-pe button:hover { color: var(--text); border-color: var(--muted); }
.cartao { position: relative; background: var(--cream); color: var(--ink); border: 1px solid #EDE7D8; border-radius: 10px; padding: 10px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; flex: none; min-width: 0; }
.cartao.arrastando { opacity: .5; }
.cartao h4 { margin: 0; }
.cartao-abrir { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; margin: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font-family: var(--font-display); font-weight: var(--peso-display); font-size: 11px; letter-spacing: .4px; text-transform: uppercase; line-height: 1.4; overflow-wrap: anywhere; }
.cartao-abrir::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 10px; }
.cartao-abrir:focus-visible { outline: none; }
.cartao-abrir:focus-visible::after { outline: 3px solid var(--red); outline-offset: 2px; }
.cartao .acoes .btn-icone { z-index: 2; }
.cartao-capa { height: 96px; border-radius: 6px; overflow: hidden; background: #000; position: relative; flex: none; }
/* Capa padrão: Abissal propositalmente discreto, conforme a decisão visual da #5. */
.cartao-capa::before { content: ""; position: absolute; inset: 12px; background: #212121; -webkit-mask: url("/img/icone-abissal.png") center / contain no-repeat; mask: url("/img/icone-abissal.png") center / contain no-repeat; }
.cartao-capa img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.capa-previa { position: relative; height: 180px; border-radius: 10px; overflow: hidden; background: #000; }
.capa-previa::before { content: ""; position: absolute; inset: 24px; background: #212121; -webkit-mask: url("/img/icone-abissal.png") center / contain no-repeat; mask: url("/img/icone-abissal.png") center / contain no-repeat; }
.capa-previa img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.cartao-vertical { display: flex; align-items: center; gap: 6px; font-size: 11px; overflow-wrap: anywhere; }
.vertical-icone { width: 22px; height: 22px; flex: none; background: var(--red); -webkit-mask: var(--vertical) center / contain no-repeat; mask: var(--vertical) center / contain no-repeat; }
.responsaveis-avatares { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; vertical-align: middle; }
.responsavel-avatar { display: inline-flex; position: relative; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; overflow: hidden; border-radius: 50%; background: var(--red); color: #171717; font-size: 11px; font-weight: 600; line-height: 1; vertical-align: middle; }
.responsavel-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vertical-ad { --vertical: url("/img/vertical-ad.png"); }
.vertical-dc { --vertical: url("/img/vertical-dc.png"); }
.vertical-en { --vertical: url("/img/vertical-en.png"); }
.vertical-gm { --vertical: url("/img/vertical-gm.png"); }
.vertical-pe { --vertical: url("/img/vertical-pe.png"); }
.cartao .info { font-size: 11px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.cartao .info b { font-weight: 600; }
.cartao .chip.alerta { background: var(--warn); color: var(--on-warn); }
.cartao .acoes { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.btn-icone { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; min-width: 30px; height: 30px; min-height: 30px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: inherit; text-decoration: none; }
.btn-icone:hover { background: rgba(110,105,94,.16); }
.btn-icone.btn-primario { background: var(--red); color: var(--on-red); }
.btn-icone.btn-perigo { color: var(--danger-text); }
.btn-icone:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.btn-go { position: relative; z-index: 2; margin-left: auto; min-width: 44px; min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--red); color: var(--on-red); font: var(--peso-display) 11px/1 var(--font-display); letter-spacing: 1px; text-transform: uppercase; cursor: pointer; }
.btn-go:hover { background: var(--red-2); color: var(--cream); }
.btn-go:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cartao [data-tooltip].btn-go::after { left: auto; right: 0; }
.icone-acao { display: block; width: 22px; height: 22px; fill: currentColor; flex: none; }
.icone-acao.estrela { background: currentColor; -webkit-mask: url("/img/icone-estrela.svg") center / contain no-repeat; mask: url("/img/icone-estrela.svg") center / contain no-repeat; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); z-index: 2; width: max-content; max-width: 180px; padding: 5px 8px; border-radius: 5px; background: var(--ink); color: var(--cream); font: 11px/1.4 var(--font-body); text-transform: none; pointer-events: none; opacity: 0; visibility: hidden; }
[data-tooltip]:not([data-tooltip-oculto]):hover::after, [data-tooltip]:not([data-tooltip-oculto]):focus-visible::after { pointer-events: auto; opacity: 1; visibility: visible; }
.cartao [data-tooltip]::after { left: 0; transform: none; }
.modal-pe > [data-tooltip]:last-child::after { left: auto; right: 0; transform: none; }
.modal-pe .esquerda > [data-tooltip]:first-child::after { left: 0; transform: none; }
.cartao.encerrada { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.data-entrada { display: inline-flex; align-items: center; gap: 6px; }
.data-entrada .icone-acao { width: 16px; height: 16px; }
.modal-topo > div { min-width: 0; overflow-wrap: anywhere; }
.modal-topo .fechar { flex: none; }
.parada { background: var(--warn); color: var(--on-warn); border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 600; }

/* Modais */
.modal-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; z-index: 100; overflow-y: auto; }
.modal { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 14px; width: min(860px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.modal.estreito { width: min(480px, 100%); }
.modal.largo { width: min(1100px, 100%); }
.modal-topo { display: flex; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-topo h3 { margin: 0; font-family: var(--font-display); font-weight: var(--peso-display); text-transform: uppercase; letter-spacing: .6px; font-size: 21px; }
.modal-topo .fechar { margin-left: auto; background: transparent; border: none; color: var(--text); font-size: 22px; line-height: 1; width: 24px; height: 24px; padding: 0; border-radius: 5px; flex-shrink: 0; }
.modal-topo .fechar:hover { background: var(--panel-2); }
.modal-topo.com-capa { position: relative; height: 180px; min-height: 180px; box-sizing: border-box; overflow: hidden; align-items: flex-end; border-radius: 14px 14px 0 0; background: #000; }
.modal-topo.com-capa::before { content: ""; position: absolute; inset: 24px; background: #212121; -webkit-mask: url("/img/icone-abissal.png") center / contain no-repeat; mask: url("/img/icone-abissal.png") center / contain no-repeat; }
.modal-capa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal-topo.com-capa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent, var(--bg) 85%); }
.modal-topo.com-capa > div { position: relative; z-index: 1; width: 100%; }
.modal-topo.com-capa h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; line-height: 1.2; }
.modal-topo.com-capa .fechar { position: absolute; top: 12px; right: 12px; z-index: 2; margin: 0; background: var(--bg); }
.modal-corpo { padding: 16px 18px; }
.modal-pe { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; position: sticky; bottom: 0; background: var(--bg); border-radius: 0 0 14px 14px; }
.modal-pe .esquerda { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.modal-pe .esquerda:empty { display: none; }
.modal .btn, .modal .icon-btn, .btn-google { height: 24px; min-height: 24px; padding: 0 10px; border-radius: 5px; font-size: 11px; line-height: 1.2; justify-content: center; }
.modal .btn-icone, .modal .icon-btn { width: 24px; min-width: 24px; padding: 0; }
.modal .btn-icone .icone-acao { width: 18px; height: 18px; }
.btn-icone.capa-escolher, .btn-icone.capa-modelo { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; min-width: 26px; height: 26px; min-height: 26px; padding: 4px; background: var(--cream); color: var(--ink); border-radius: 50%; }
.btn-icone.capa-modelo { right: 44px; }

/* Detalhes */
.detalhe dl { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; }
.detalhe dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.detalhe dd { margin: 0; overflow-wrap: anywhere; }
.relacionados { margin-top: 18px; }
.relacionados h4 { font-family: var(--font-display); font-weight: var(--peso-display); text-transform: uppercase; letter-spacing: .8px; margin: 14px 0 6px; }
.meta { font-size: 11px; color: var(--muted); margin-top: 12px; }

/* Toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--ink); color: var(--cream); padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; font-size: 13px; }
.toast.erro { background: var(--danger); color: var(--ink); border-color: var(--danger); }
.toast.ok { background: var(--ok); color: var(--ink); border-color: var(--ok); }

/* Importação e relatórios */
.painel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.painel h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: var(--peso-display); text-transform: uppercase; letter-spacing: .6px; }
.progresso { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progresso > div { height: 100%; background: var(--red); width: 0; transition: width .2s; }
.sev-alta { color: var(--danger-text); font-weight: 600; }
.sev-media { background: var(--warn); color: var(--on-warn); font-weight: 600; border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.sev-info { color: var(--muted); }
/* Indicadores continuam escuros também no tema claro. */
.kpi .muted, .kpi .sev-alta, .kpi .sev-info { color: inherit; }
pre.json { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 300px; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.lista-edit { display: flex; flex-direction: column; gap: 6px; }
.lista-edit .item { display: flex; gap: 6px; align-items: center; }
.lista-edit .item input { flex: 1; }
.colunas-config { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }

/* ---------- Toque (celular e tablet) ---------- */
@media (pointer: coarse) {
  .btn { min-height: var(--toque); }
  .btn-pq { min-height: 36px; }
  .icon-btn { min-width: 40px; height: 40px; }
  .topbar .icon-btn { min-width: var(--toque); height: var(--toque); }
  .menu-btn { min-height: var(--toque); }
  .config-lista a { min-height: var(--toque); }
  .chip .icon-btn { min-width: 30px; height: 30px; }
  .tab { min-height: var(--toque); }
  .cartao { cursor: default; }
  .cartao .acoes { gap: 8px; }
  .btn-icone { width: var(--toque); min-width: var(--toque); height: var(--toque); min-height: var(--toque); }
  .btn-go { min-height: var(--toque); }
  .coluna-pe button { min-height: var(--toque); }
  .modal-topo .fechar { width: var(--toque); height: var(--toque); }
  .modal .btn, .modal .icon-btn, .btn-google { height: var(--toque); min-height: var(--toque); }
  .modal .btn-icone, .modal .icon-btn { width: var(--toque); min-width: var(--toque); }
  .modal .checks label { min-height: var(--toque); }
  .btn-icone.capa-escolher, .btn-icone.capa-modelo { width: var(--toque); min-width: var(--toque); height: var(--toque); min-height: var(--toque); }
  .btn-icone.capa-modelo { right: 60px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select { height: var(--toque); }
  .campo input[type=checkbox], .checks input[type=checkbox], label.checks input { width: 20px; height: 20px; }
  .checks label, label.checks { min-height: 36px; }
  .filtro-pilula, .filtro-interruptor, .filtro-menu label, .filtro-menu [data-limpar] { min-height: var(--toque); }
  .filtros .campo:not(.filtro-multiplo) { min-height: var(--toque); }
  .filtros .campo input:not([type=checkbox]), .filtros .campo select { height: var(--toque); }
  .filtro-menu label input[type=checkbox] { width: 20px; height: 20px; }
}

/* ---------- Notebooks ---------- */
@media (min-width: 1280px) {
  .filtros .campo > label, .filtro-pilula, .filtro-menu label, .filtro-interruptor { font-size: 13px; }
  .filtros .campo input:not([type=checkbox]), .filtros .campo select { font-size: 14px; height: 26px; }
  .filtro-menu label { min-height: 40px; }
  .kpi .lbl, .coluna-topo, .coluna-topo .qtd { font-size: 13px; }
  .kpi .val { font-size: 20px; }
  .cartao-abrir, .cartao-vertical, .cartao .info, .cartao .chip, .coluna-pe button { font-size: 13px; }
  .coluna { flex-basis: 330px; }
  .cartao-capa { height: 112px; }
  .cabecalho > .btn.btn-nova { width: 230px; height: 32px; font-size: 13px; }
  .tab { font-size: 13px; }
}

@media (min-width: 1280px) and (pointer: coarse) {
  .filtros .campo input:not([type=checkbox]), .filtros .campo select, .cabecalho > .btn.btn-nova { height: var(--toque); }
  .filtro-menu label { min-height: var(--toque); }
}

@media (max-width: 1440px) {
  .topbar { gap: 10px; }
  .tabs { gap: 2px; }
  .tab { min-width: 70px; padding: 7px 8px 6px; }
  .status-pill { padding: 0; width: 26px; height: 26px; justify-content: center; position: relative; }
  .status-pill > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Telas médias ---------- */
@media (max-width: 960px) {
  .topbar { padding: 8px 16px; }
  main { padding: 16px 16px 40px; }
  .detalhe dl { grid-template-columns: 140px 1fr; }
}

/* ---------- Celular ---------- */
@media (max-width: 720px) {
  /* 16px evita o zoom automático do iOS ao focar um campo. */
  input, select, textarea, .cartao select { font-size: 16px; }

  .topbar { padding: 8px 12px; gap: 8px; min-height: 56px; }
  .topbar.compacta { gap: 8px; }
  .logo-marca img { height: 16px; }
  .usuario > .nome { display: none; }
  .usuario img { width: 32px; height: 32px; }
  .topbar.compacta .menu-btn { flex: 1 1 auto; justify-content: space-between; max-width: 260px; letter-spacing: .4px; padding: 0 10px; gap: 6px; }

  main { padding: 12px 12px 32px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .cabecalho { gap: 10px; }
  .cabecalho h1 { font-size: 22px; }
  section[data-tela] .cabecalho h1::before { width: 28px; height: 20px; }
  .cabecalho > .btn { width: 100%; justify-content: center; }
  .cabecalho > .grow { display: none; }

  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }

  .filtros { padding: 10px; gap: 8px; }
  .filtros .campo { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filtros .campo.busca, .filtros .campo.campo-check { flex-basis: 100%; }
  .filtros .campo-check > label:first-child { display: none; }
  .filtros .campo input:not([type=checkbox]), .filtros .campo select { font-size: 16px; }
  .filtro-menu { max-width: calc(100vw - 48px); }

  .kanban { scroll-snap-type: x mandatory; gap: 10px; margin: 0 -12px; padding: 0 12px 12px; scroll-padding: 0 12px; }
  .coluna { flex-basis: min(320px, calc(100vw - 48px)); scroll-snap-align: start; max-height: calc(100dvh - 150px); }

  .tabela th, .tabela td { padding: 8px 10px; }

  .modal-fundo { padding: 0; display: block; }
  .modal, .modal.estreito, .modal.largo { width: 100%; min-height: 100%; min-height: 100dvh; border-radius: 0; border: none; display: flex; flex-direction: column; }
  .modal-topo { padding: 12px 14px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
  .modal-topo h3 { font-size: 19px; }
  .modal-topo.com-capa { position: sticky; border-radius: 0; flex-shrink: 0; }
  .modal-corpo { padding: 14px; flex: 1; }
  .modal-pe { padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-pe > .btn, .modal-pe .esquerda > .btn { flex: 1 1 auto; justify-content: center; }
  .modal-pe .esquerda { margin-right: 0; width: 100%; }
  .detalhe dl { grid-template-columns: 1fr; gap: 2px; }
  .detalhe dd { margin-bottom: 8px; }

  .painel { padding: 12px; }
  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
  .tela-central .caixa { padding: 20px; }
  .logo-marca.grande img { height: 30px; }
}

@media (max-width: 400px) {
  .logo-marca img { height: 14px; }
  .topbar.compacta .menu-btn { font-size: 13px; letter-spacing: .2px; padding: 0 8px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
