/*
 * Sistema de temas — Expediente Contábil
 * Valores gerados a partir de design/design-system/project/tokens.css.
 * Para alterar cores, edite o design system e regenere; não edite aqui à mão.
 * Dois tokens têm significado FIXO em todos os temas:
 *   --seal    → selo de "fonte verificada" / autoridade
 *   --urgent  → prazo crítico (<7 dias). Nunca vermelho puro.
 * Troca de tema via data-theme no <html> (localStorage, public/js/app.js).
 * Sem tema salvo, segue prefers-color-scheme (claro → dns, escuro → dns-noite).
 */

:root, [data-theme="dns"] {
  color-scheme: light;
  --paper: #eef0f2;
  --surface: #ffffff;
  --surface-sunken: #e2e6e9;
  --ink: #0c2231;
  --ink-muted: #535a60;
  --brand: #002e45;
  --brand-strong: #001d2c;
  --on-brand: #f3f6f8;
  --seal: #735a1f;
  --seal-tint: #f1e9d6;
  --urgent: #6e1f2a;
  --urgent-tint: #f3e1e3;
  --line: rgba(0,46,69,0.14);
  --whatsapp: #1a7f4b;
  --on-whatsapp: #ffffff;
  --shadow-card: 0 1px 2px rgba(0,30,45,0.06), 0 4px 14px rgba(0,30,45,0.05);
  --shadow-popover: 0 4px 8px rgba(0,30,45,0.06), 0 12px 28px rgba(0,30,45,0.12);
  --grid-line: transparent;
  --logo-navy: #002e45;
  --logo-gray: #666666;
}
[data-theme="dns-noite"] {
  color-scheme: dark;
  --paper: #071a25;
  --surface: #0d2533;
  --surface-sunken: #041219;
  --ink: #e6ecef;
  --ink-muted: #a3aeb5;
  --brand: #8cc0da;
  --brand-strong: #b4d8ea;
  --on-brand: #04141d;
  --seal: #d3b673;
  --seal-tint: rgba(211,182,115,0.16);
  --urgent: #e28a97;
  --urgent-tint: rgba(226,138,151,0.16);
  --line: rgba(230,236,239,0.14);
  --whatsapp: #4cb583;
  --on-whatsapp: #08261a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
  --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
  --grid-line: transparent;
  --logo-navy: #8cc0da;
  --logo-gray: #9aa3a9;
}
[data-theme="carimbo-azul"] {
  color-scheme: light;
  --paper: #eaedf0;
  --surface: #ffffff;
  --surface-sunken: #e1e5ea;
  --ink: #141c2b;
  --ink-muted: #4a5568;
  --brand: #1e4e8c;
  --brand-strong: #163a68;
  --on-brand: #f5f7fa;
  --seal: #735a1f;
  --seal-tint: #f1e9d6;
  --urgent: #6e1f2a;
  --urgent-tint: #f3e1e3;
  --line: rgba(20,28,43,0.14);
  --whatsapp: #1a7f4b;
  --on-whatsapp: #ffffff;
  --shadow-card: 0 1px 2px rgba(15,20,32,0.06), 0 4px 14px rgba(15,20,32,0.05);
  --shadow-popover: 0 4px 8px rgba(15,20,32,0.06), 0 12px 28px rgba(15,20,32,0.12);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="noturno"] {
  color-scheme: dark;
  --paper: #14130f;
  --surface: #1d1b16;
  --surface-sunken: #0e0d0a;
  --ink: #ece6d8;
  --ink-muted: #b3ab98;
  --brand: #8fc5b2;
  --brand-strong: #b0dccd;
  --on-brand: #0e0d0a;
  --seal: #d3b673;
  --seal-tint: rgba(211,182,115,0.16);
  --urgent: #e28a97;
  --urgent-tint: rgba(226,138,151,0.16);
  --line: rgba(236,230,216,0.16);
  --whatsapp: #4cb583;
  --on-whatsapp: #08261a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
  --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="verde-safra"] {
  color-scheme: light;
  --paper: #eef0e5;
  --surface: #fbfbf6;
  --surface-sunken: #e3e7d6;
  --ink: #1b2417;
  --ink-muted: #48533f;
  --brand: #4b6b2f;
  --brand-strong: #374f21;
  --on-brand: #f6f8ef;
  --seal: #735a1f;
  --seal-tint: #efe6d0;
  --urgent: #6e1f2a;
  --urgent-tint: #efe0e1;
  --line: rgba(27,36,23,0.14);
  --whatsapp: #1a7f4b;
  --on-whatsapp: #ffffff;
  --shadow-card: 0 1px 2px rgba(15,20,32,0.06), 0 4px 14px rgba(15,20,32,0.05);
  --shadow-popover: 0 4px 8px rgba(15,20,32,0.06), 0 12px 28px rgba(15,20,32,0.12);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="verde-safra-noite"] {
  color-scheme: dark;
  --paper: #141a10;
  --surface: #1c2416;
  --surface-sunken: #0e120a;
  --ink: #e8ecdf;
  --ink-muted: #a8b39a;
  --brand: #8fbb5e;
  --brand-strong: #a7cd7a;
  --on-brand: #10160a;
  --seal: #d9b96a;
  --seal-tint: rgba(217,185,106,0.16);
  --urgent: #e28a97;
  --urgent-tint: rgba(226,138,151,0.16);
  --line: rgba(232,236,223,0.16);
  --whatsapp: #4cb583;
  --on-whatsapp: #08261a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
  --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="papel-moeda"] {
  color-scheme: light;
  --paper: #edeff4;
  --surface: #fafbfd;
  --surface-sunken: #dfe3ee;
  --ink: #171b2e;
  --ink-muted: #454b63;
  --brand: #2e3a6e;
  --brand-strong: #212a52;
  --on-brand: #f3f4fa;
  --seal: #3f6e5c;
  --seal-tint: #dee9e4;
  --urgent: #6e1f2a;
  --urgent-tint: #e9dfe1;
  --line: rgba(23,27,46,0.14);
  --whatsapp: #1a7f4b;
  --on-whatsapp: #ffffff;
  --shadow-card: 0 1px 2px rgba(15,20,32,0.06), 0 4px 14px rgba(15,20,32,0.05);
  --shadow-popover: 0 4px 8px rgba(15,20,32,0.06), 0 12px 28px rgba(15,20,32,0.12);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="papel-moeda-noite"] {
  color-scheme: dark;
  --paper: #10121f;
  --surface: #171a2c;
  --surface-sunken: #0a0c16;
  --ink: #e6e7f2;
  --ink-muted: #a3a7c2;
  --brand: #8b9ce8;
  --brand-strong: #a9b8f2;
  --on-brand: #0d0f1c;
  --seal: #6fccb0;
  --seal-tint: rgba(111,204,176,0.16);
  --urgent: #e28a97;
  --urgent-tint: rgba(226,138,151,0.16);
  --line: rgba(230,231,242,0.16);
  --whatsapp: #4cb583;
  --on-whatsapp: #08261a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
  --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
  --grid-line: transparent;
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="traco-auditor"] {
  color-scheme: light;
  --paper: #f5f4f0;
  --surface: #ffffff;
  --surface-sunken: #eceae4;
  --ink: #202020;
  --ink-muted: #5a5a5a;
  --brand: #202020;
  --brand-strong: #000000;
  --on-brand: #ffffff;
  --seal: #6e1f2a;
  --seal-tint: #efe1e2;
  --urgent: #6e1f2a;
  --urgent-tint: #efe1e2;
  --line: rgba(0,0,0,0.16);
  --whatsapp: #1a7f4b;
  --on-whatsapp: #ffffff;
  --shadow-card: 0 1px 2px rgba(15,20,32,0.06), 0 4px 14px rgba(15,20,32,0.05);
  --shadow-popover: 0 4px 8px rgba(15,20,32,0.06), 0 12px 28px rgba(15,20,32,0.12);
  --grid-line: rgba(0, 0, 0, 0.055);
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}
[data-theme="traco-auditor-noite"] {
  color-scheme: dark;
  --paper: #161616;
  --surface: #1c1c1c;
  --surface-sunken: #0f0f0f;
  --ink: #f0f0f0;
  --ink-muted: #a3a3a3;
  --brand: #f0f0f0;
  --brand-strong: #ffffff;
  --on-brand: #161616;
  --seal: #e28a97;
  --seal-tint: rgba(226,138,151,0.16);
  --urgent: #e28a97;
  --urgent-tint: rgba(226,138,151,0.16);
  --line: rgba(240,240,240,0.16);
  --whatsapp: #4cb583;
  --on-whatsapp: #08261a;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
  --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
  --grid-line: rgba(255, 255, 255, 0.055);
  --logo-navy: var(--brand);
  --logo-gray: var(--ink-muted);
}

:root {
  --font-display: "Source Serif", Georgia, "Times New Roman", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --radius-sm: 3px;
  --radius-md: 6px;
  --content-width: 76rem;
  --measure: 68ch;
  --space-line-height: 1.55;
  --transition-fast: 140ms ease;

  /* Acento das seis frentes: só navegação, iguais em todos os temas. */
  --cat-obrigacoes: #5B5FBF;
  --cat-trabalhista: #3F8C6E;
  --cat-fiscal: #A64B87;
  --cat-profissao: #3F7A8C;
  --cat-societario: #7A6B3F;
  --cat-gestao: #5E7A3F;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #071a25;
    --surface: #0d2533;
    --surface-sunken: #041219;
    --ink: #e6ecef;
    --ink-muted: #a3aeb5;
    --brand: #8cc0da;
    --brand-strong: #b4d8ea;
    --on-brand: #04141d;
    --seal: #d3b673;
    --seal-tint: rgba(211,182,115,0.16);
    --urgent: #e28a97;
    --urgent-tint: rgba(226,138,151,0.16);
    --line: rgba(230,236,239,0.14);
    --whatsapp: #4cb583;
    --on-whatsapp: #08261a;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 4px 14px rgba(0,0,0,0.4);
    --shadow-popover: 0 4px 8px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.55);
    --grid-line: transparent;
    --logo-navy: #8cc0da;
    --logo-gray: #9aa3a9;
  }
}
