/* HUB · tokens e peças comuns, copiados do DocTec (frontend/src/estilos/tokens.css, base.css, componentes Cartao,
   Botao e CampoFormulario) para o HUB e o DocTec parecerem um produto só. Não invente cores: copie do DocTec. */
:root {
  /* Base */
  --ink: #0F172A; --ink-soft: #334155; --muted: #64748B;
  --line: #E2E8F0; --line-strong: #CBD5E1; --line-soft: #EEF2F6;
  /* Borda de campo (input, select, textarea, busca) ≥ 3:1 (WCAG 1.4.11). Cartões e divisórias usam --line. */
  --line-campo: #7C8BA1; --line-campo-hover: #64748B;
  /* Texto secundário pequeno sobre fundo tingido: ≥ 4,95:1 no pior fundo. */
  --muted-tinto: #5B6B82;
  --surface: #FFFFFF; --canvas: #F4F7FA; --hover: #F0F9FF;
  --primary: #00A8FF; --primary-ink: #0369A1; --accent: #3AEDBE; --deep: #0F2740;
  --grad: linear-gradient(90deg, #00A8FF 0%, #3AEDBE 100%);
  --grad-diag: linear-gradient(135deg, #00A8FF 0%, #3AEDBE 100%);
  --tint: #EAF7FF;

  /* Menu lateral */
  --navy: #0B1F33; --navy-2: #12304B; --navy-line: #1F3F5E;
  --navy-texto: #C9D8E6; --navy-suave: #A9BED2; --navy-apagado: #8FA7BD;
  --navy-ativo: linear-gradient(90deg, rgba(0, 168, 255, .22), rgba(58, 237, 190, .14));

  /* Situações (não mudar). No DocTec: ok = pronto/aprovado · alerta = gerando/aguardando · vencido = com erro ·
     irregular = atenção (grupo sem projeto) · neutro = sem informação. */
  --ok: #0F766E; --ok-bg: #ECFDF5; --ok-dot: #10B981; --ok-line: #A7F3D0;
  --alerta: #A16207; --alerta-bg: #FFF7E6; --alerta-dot: #F59E0B; --alerta-line: #FDE3A7;
  --vencido: #B53B38; --vencido-bg: #FEF2F2; --vencido-dot: #EF4444; --vencido-line: #FECACA;
  --irregular: #6D28D9; --irregular-bg: #F5F3FF; --irregular-dot: #8B5CF6; --irregular-line: #DDD6FE;
  --neutro: #475569; --neutro-bg: #F1F5F9; --neutro-dot: #94A3B8;
  --externo: #155E75; --externo-bg: #ECFEFF; --externo-linha: #0E7490;

  /* Tipografia */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --t-titulo: clamp(1.6rem, 3vw, 2rem);
  --t-bloco: 15px; --t-corpo: 14px; --t-menor: 13px; --t-nota: 12px; --t-sobre: 11px; --t-numero: 30px;

  /* Espaço, raio, sombra, foco */
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px;
  --radius-card: 14px; --radius-campo: 10px; --radius-pilula: 999px;
  --shadow-card: 0 1px 2px rgba(14, 34, 51, .06), 0 8px 24px rgba(14, 34, 51, .05);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .04), 0 16px 36px rgba(15, 23, 42, .08);
  --shadow-pop: 0 18px 48px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
  /* Foco: contorno de verdade (outline), visível em cores forçadas. --focus é só o halo (enfeite). */
  --foco-cor: #0369A1; --foco-largura: 2px; --foco-folga: 2px;
  --foco-navy-cor: #3AEDBE;
  --focus: 0 0 0 4px rgba(0, 168, 255, .16);
  --ease: cubic-bezier(.22, 1, .36, 1);

  /* Medidas da casca */
  --lateral: 252px; --lateral-rec: 72px; --topo: 60px; --conteudo-max: 1240px;

  /* Camadas: conteúdo 0 · topo 20 · véu 40 · menu-gaveta e modal 50 · toast 60 · pular 70 */
  --z-topo: 20; --z-veu: 40; --z-gaveta: 50; --z-modal: 50; --z-toast: 60; --z-pular: 70;

  /* Apelidos do HUB (usados por carlai.css e telas antigas). */
  --danger: var(--vencido); --radius-lg: 20px; --radius-md: 12px;
}

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

html { scroll-padding-top: calc(var(--topo) + 16px); }
html, body { min-height: 100%; }
body {
  font-family: var(--font); font-size: var(--t-corpo); line-height: 1.45; color: var(--ink); background: var(--canvas);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
fieldset { border: 0; min-width: 0; }
svg { flex: none; }
img, video, audio { max-width: 100%; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; overflow-wrap: anywhere; }
h2 { font-size: 16px; }
p { overflow-wrap: anywhere; }
strong { font-weight: 600; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* Foco: contorno de verdade, visível em cores forçadas. */
:focus-visible {
  outline: var(--foco-largura) solid var(--foco-cor); outline-offset: var(--foco-folga);
  box-shadow: var(--focus); border-radius: 8px;
}
main:focus { outline: none; }
[hidden] { display: none !important; }
.sr-only, .so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.pular {
  position: absolute; left: 16px; top: -48px; z-index: var(--z-pular); padding: 8px 14px; border-radius: 10px;
  background: var(--deep); color: #fff; font-weight: 600; transition: top .15s var(--ease);
}
.pular:focus { top: 12px; }

/* Marca */
.marca { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; color: var(--deep); border-radius: 8px; }
.marca b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.marca-modulo {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; margin-left: 2px;
  background: rgba(255, 255, 255, .1); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad-diag); color: #062033; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}

/* Campos */
input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--radius-campo); border: 1px solid var(--line-campo);
  background: var(--surface); min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select:hover, input:hover, textarea:hover { border-color: var(--line-campo-hover); }
select:focus-visible, input:focus-visible, textarea:focus-visible {
  border-color: var(--primary); box-shadow: var(--focus); border-radius: var(--radius-campo);
}
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary-ink); flex: none; }
input[type="checkbox"]:focus-visible { border-radius: 4px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-rotulo { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.campo-dica { font-size: var(--t-nota); color: var(--muted-tinto); }

/* Botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-campo); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--t-menor); font-weight: 600; white-space: nowrap; cursor: pointer; color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.botao:hover { background: #F8FAFC; border-color: #94A3B8; }
.botao:focus-visible { border-radius: var(--radius-campo); }
.botao:active { transform: translateY(1px); }
.botao:disabled, .botao[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.botao-primario { border: 0; background: var(--grad); color: #04263A; box-shadow: 0 6px 18px rgba(0, 168, 255, .22); }
.botao-primario:hover { background: var(--grad); filter: saturate(1.15) brightness(1.03); }
.botao-primario:focus-visible { box-shadow: var(--focus), 0 6px 18px rgba(0, 168, 255, .22); }
.botao-fantasma { border-color: transparent; background: transparent; color: var(--ink-soft); }
.botao-fantasma:hover { background: var(--neutro-bg); border-color: transparent; color: var(--ink); }
.botao-largo { width: 100%; }
.botao-pequeno { height: 30px; padding: 0 10px; font-size: 12px; }

/* Cartão */
.cartao { position: relative; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: clip; }
.cartao + .cartao { margin-top: var(--e-4); }
.cartao-cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cartao-titulo { font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.cartao-corpo { padding: 18px 20px; }
@media (max-width: 640px) { .cartao-corpo { padding: 14px 16px; } .cartao-cabeca { padding: 12px 16px; } }

/* Avisos */
.aviso { padding: 11px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid; }
.aviso-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.aviso-alerta { color: var(--alerta); background: var(--alerta-bg); border-color: var(--alerta-line); }
.aviso-erro { color: var(--vencido); background: var(--vencido-bg); border-color: var(--vencido-line); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: var(--z-toast);
  transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 10px;
  background: var(--deep); color: #E8EEF6; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.visivel { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 899px) {
  input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"]), select { height: 44px; font-size: 16px; }
  .botao { height: 40px; } .botao-pequeno { height: 34px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .lateral, .topo, .casca-veu, .pular { display: none !important; } .casca { display: block; } }
