/* ============================================================
   HORUS — GLOBAL.CSS
   Folha de estilo única carregada em TODAS as páginas.
   Centraliza: fontes, design tokens (:root), reset e scrollbar.
   Páginas com paleta própria (engenharia, gerenciamento, login)
   apenas sobrescrevem as variáveis que precisam abaixo do global.
   Temas claro/rosa continuam em light-mode.css (body.light / body.rosa).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ---------- Design tokens (tema escuro padrão) ---------- */
:root {
  /* superfícies */
  --bg:        #0e1117;
  --surface:   #161b27;
  --surface2:  #1e2535;
  --border:    #2a3348;

  /* acentos */
  --accent:      #3d8ef0;
  --accent-soft: rgba(61, 142, 240, .12);
  --accent2:     #22d3a5;

  /* feedback */
  --warn:    #f0923d;
  --danger:  #f05252;
  --success: #22d3a5;

  /* texto */
  --text:       #e2e8f0;
  --muted:      #64748b;
  --text-muted: #64748b;

  /* tints de status (badge/botão tintado) — modo claro sobrescreve em light-mode.css */
  --accent-bd:     #1f3b61;
  --ok-soft:       #142e33;  --ok-soft-bd:     #17504b;
  --warn-soft:     #3a362b;  --warn-soft-bd:   #605332;
  --danger-soft:   #341e27;  --danger-soft-bd: #61272a;
  --amber:         #f0c04d;

  /* ---------- Matizes dos cartões (Home: guide-card e hcard) ----------
     Antes cada cartão trazia o hex fixo no style inline do HTML, calibrado
     só para fundo escuro — nos temas claros o ícone ficava quase invisível
     (todas as 19 cores reprovavam o mínimo de 4.5:1 do WCAG AA). Agora são
     tokens: os temas claros sobrescrevem com versões escurecidas do MESMO
     matiz (ver themes.css / light-mode.css), preservando a identidade.
     Os valores abaixo são os originais da marca; só violet e indigo foram
     clareados ~5% porque eram escuros demais para fundo escuro. */
  --hue-blue:      #3d8ef0;
  --hue-sky:       #38bdf8;
  --hue-cyan:      #06b6d4;
  --hue-ice:       #67e8f9;
  --hue-teal:      #14b8a6;
  --hue-mint:      #22d3a5;
  --hue-emerald:   #10b981;
  --hue-green:     #4ade80;
  --hue-amber:     #fbbf24;
  --hue-gold:      #f59e0b;
  --hue-orange:    #f0923d;
  --hue-tangerine: #fb923c;
  --hue-pink:      #f472b6;
  --hue-magenta:   #ec4899;
  --hue-fuchsia:   #e879f9;
  --hue-violet:    #966cf7;
  --hue-indigo:    #7678f3;
  --hue-red:       #f87171;
  --hue-slate:     #94a3b8;

  /* Base do quadradinho atrás do ícone do cartão. Em tema escuro é um preto
     azulado FIXO (não a surface do tema): assim o chip fica sempre mais
     escuro que o ícone, e o contraste não depende de quão clara é a surface
     — era o que quebrava em temas como Nord e Dracula. */
  --chip-base: #0b0e14;
  --chip-tint: 14%;

  /* tipografia */
  --sans: 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

/* Assinatura tipográfica oficial da marca, igual à usada na sidebar. */
.horus-word {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  letter-spacing: .12em;
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

/* ============================================================
   CAMADA DE COMPONENTES — visual inspirado no Reddit
   Mantém a identidade azul do Horus; padroniza FORMA e interação.
   Os seletores começam com `body ` de propósito: sobem a
   especificidade só o suficiente para padronizar formato/foco
   sobre as regras de cada página, sem mexer em cores/layout delas.
   ============================================================ */

/* ---------- Botões de ação: formato pill + micro-interação ---------- */
body .btn,
body .btn-primary,
body .btn-acao,
body .btn-sm,
body .btn-pequeno,
body .btn-cancel,
body .btn-save,
body .btn-salvar-proj,
body .btn-success,
body .btn-upload,
body .btn-excel,
body .btn-doc,
body .btn-pdf,
body .btn-conheca {
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease,
              background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* Hover/active discretos e consistentes (preservam a cor de cada botão) */
body .btn:hover,
body .btn-primary:hover,
body .btn-acao:hover,
body .btn-sm:hover,
body .btn-pequeno:hover,
body .btn-save:hover,
body .btn-salvar-proj:hover,
body .btn-success:hover,
body .btn-upload:hover,
body .btn-excel:hover,
body .btn-doc:hover,
body .btn-pdf:hover {
  filter: brightness(1.07);
}
body .btn:active,
body .btn-primary:active,
body .btn-acao:active,
body .btn-sm:active,
body .btn-pequeno:active,
body .btn-cancel:active,
body .btn-save:active,
body .btn-success:active {
  transform: translateY(1px);
}
body .btn:disabled,
body .btn-primary:disabled,
body .btn-acao:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* Botões redondos de ícone — círculo perfeito, estilo Reddit */
body .btn-icon,
body .btn-icon-danger,
body .btn-close {
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, filter .15s ease;
}

/* ---------- Inputs: anel de foco no acento (sem mudar layout) ---------- */
body input:focus,
body select:focus,
body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

/* ============================================================
   UTILITÁRIOS FLAT REAPROVEITÁVEIS
   Padrão visual do app (superfícies sólidas, sem neon/glass).
   Use estas classes em telas novas em vez de recriar estilos.
   Baixa especificidade de propósito: páginas podem sobrescrever.
   ============================================================ */

/* Cartão flat padrão */
.card-flat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.card-flat:hover { border-color: #2e456a; }

/* Chip / badge sólido (sem borda neon) — defina a cor do texto inline
   ou por modificador; o fundo padrão é uma superfície escura. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 9px;
  background: var(--surface2);
  color: var(--text);
  white-space: nowrap;
}

/* Baseline de controles nativos — afeta apenas os que a página não estiliza */
select,
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea {
  font-family: var(--sans);
}

/* ============================================================
   "COMO USAR" — botão no título + modal tutorial (centralizado)
   Componente: components/como_usar.html
   ============================================================ */
.howto-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  vertical-align: middle;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.howto-btn:hover { background: var(--surface); border-color: var(--accent); color: #a8d8ff; }
.howto-btn i { font-size: 12px; }

.howto-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(4, 8, 16, .82);
  overflow-y: auto;
  padding: 48px 20px;
}
.howto-overlay.open { display: flex; }

.howto-modal {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .5);
  animation: howto-in .2s ease;
}
@keyframes howto-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.howto-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: color .15s, background .15s;
}
.howto-close:hover { color: var(--text); background: var(--border); }

.howto-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 26px;
  border-bottom: 1px solid var(--border);
}
.howto-ico {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #15233a;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.howto-head h2 { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.howto-head p  { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }

.howto-body { padding: 22px 26px 26px; }
.howto-intro { font-size: 13.5px; color: var(--text); line-height: 1.6; margin-bottom: 18px; }

.howto-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  counter-reset: hs;
}
.howto-steps li {
  position: relative;
  padding: 12px 14px 12px 48px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.howto-steps li::before {
  counter-increment: hs;
  content: counter(hs);
  position: absolute;
  left: 12px;
  top: 11px;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #08111f;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.howto-steps li b, .howto-steps li strong { color: var(--text); font-weight: 600; }

.howto-tip {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #15233a;
  color: #a8c7e8;
  font-size: 12.5px;
  line-height: 1.55;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.howto-tip i { color: var(--accent); margin-top: 2px; }

/* ============================================================
   LIXEIRA — lista de itens removidos (7 dias) com restaurar.
   Usada na tela "Gerenciar Documentos" e em "Compartilhamento".
   ============================================================ */
.lixeira-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.lixeira-selall {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.lixeira-selall input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.lixeira-count { font-size: 12px; color: var(--muted); margin-left: auto; }

.lixeira-list { display: flex; flex-direction: column; gap: 8px; }

.lixeira-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.lixeira-item:hover { border-color: #2e456a; }
.lixeira-item.sel { border-color: var(--accent); background: #15233a; }
.lixeira-item input.lixeira-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); flex-shrink: 0; }

.lixeira-ico {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 15px;
  background: rgba(61,142,240,.12); color: var(--accent);
}
.lixeira-ico.t-projeto  { background: rgba(240,146,61,.14); color: var(--warn); }
.lixeira-ico.t-documento{ background: rgba(61,142,240,.14); color: var(--accent); }
.lixeira-ico.t-pasta3d  { background: rgba(34,211,165,.14); color: var(--accent2); }

.lixeira-body { flex: 1; min-width: 0; }
.lixeira-label {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lixeira-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.lixeira-tipo {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}
.lixeira-prazo {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}
.lixeira-prazo.urgente { color: var(--danger); border-color: #81353b; }

.btn-restore {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600;
  font-family: var(--sans); cursor: pointer; transition: background .15s, color .15s;
}
.btn-restore:hover { background: var(--accent); color: #fff; }
.btn-restore:disabled { opacity: .4; cursor: not-allowed; }

.lixeira-empty {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--muted);
  padding: 16px; border: 1px dashed var(--border); border-radius: 10px;
  justify-content: center;
}
.lixeira-empty i { font-size: 18px; opacity: .6; }

/* ── Resultado do retorno do cliente ──────────────────────────────────────────
   Chip do veredito do cliente sobre a revisão devolvida. Cada variante define só
   o seu matiz em --res-c; o chip é montado por color-mix sobre os tokens do
   tema, então serve tanto no escuro quanto no claro sem hex fixo. */
.res-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 10px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--res-c) 10%, transparent);
  color: color-mix(in srgb, var(--res-c) 40%, var(--text));
  border: 1px solid color-mix(in srgb, var(--res-c) 50%, transparent);
}
.res-aprovado                 { --res-c: var(--accent2); }
.res-aprovado_com_comentarios { --res-c: var(--warn); }
.res-reprovado                { --res-c: var(--danger); }
