/* ==========================================================================
   Sindipúblicos UI — tokens
   Única fonte de cores, tipografia, espaçamento, raios, sombras e camadas.
   Nenhum componente usa valor solto: tudo referencia uma variável daqui.
   Dark mode: basta preencher o bloco [data-theme="dark"] no fim do arquivo.
   Visual próprio (cores da marca, Inter, painel administrativo claro). Em 21/10/2026 o Iran comparou na
   homologação com Lightning, Material 3 e Carbon e decidiu manter este.
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* --- Paleta base (não use direto nos componentes; use os tokens semânticos abaixo) --- */
  --navy-950: #0b1527;
  --navy-900: #0f1d33;
  --navy-800: #172a47;
  --navy-700: #22395c;
  --blue-700: #1d4ed8;
  --blue-600: #2459d6;
  --blue-500: #3b6fe0;
  --blue-50: #eef3fd;
  --gray-950: #111827;
  --gray-900: #1a2233;
  --gray-700: #3d4759;
  --gray-600: #586274;
  --gray-500: #646d7f;  /* texto auxiliar: contraste ≥ 4,5 também sobre os fundos cinza (WCAG) */
  --gray-400: #9aa2b1;
  --gray-300: #cdd2db;
  --gray-200: #e3e7ed;
  --gray-150: #eceff3;
  --gray-100: #f2f4f7;
  --gray-50: #f7f8fa;
  --white: #ffffff;

  /* --- Superfícies --- */
  --color-bg: var(--gray-50);
  --color-surface: var(--white);
  --color-surface-muted: var(--gray-100);
  --color-surface-hover: #f5f7fb;
  --color-surface-selected: var(--blue-50);
  --color-overlay: rgba(11, 21, 39, 0.45);

  /* --- Texto --- */
  --color-text: var(--gray-950);
  --color-text-secondary: var(--gray-600);
  --color-text-muted: var(--gray-500);
  --color-text-inverse: var(--white);
  --color-link: var(--blue-700);

  /* --- Bordas --- */
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  /* Contorno de botões e campos: contraste ≥ 3 com o fundo, para não sumirem (WCAG 1.4.11) */
  --color-border-control: #7d8798;
  --color-focus: var(--blue-500);

  /* --- Marca / ação principal --- */
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-primary-soft: var(--blue-50);
  --color-on-primary: var(--white);

  /* --- Sidebar --- */
  --sidebar-bg: var(--navy-900);
  --sidebar-bg-hover: var(--navy-800);
  --sidebar-bg-active: var(--navy-700);
  --sidebar-text: #c3cbd9;
  --sidebar-text-active: var(--white);
  --sidebar-text-muted: #7f8ba1;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-accent: #6e9bff;

  /* --- Semânticas: cada tom tem texto (fg), fundo suave (bg) e borda --- */
  --tone-info-fg: #1e4fbf;
  --tone-info-bg: #ebf1fe;
  --tone-info-border: #c9d8fb;
  --tone-success-fg: #1c6b3e;
  --tone-success-bg: #e8f6ee;
  --tone-success-border: #bfe5cf;
  --tone-warning-fg: #8a4b06;
  --tone-warning-bg: #fdf3e3;
  --tone-warning-border: #f6d9a8;
  --tone-danger-fg: #b0261f;
  --tone-danger-bg: #fdecea;
  --tone-danger-border: #f6c6c1;
  --tone-danger-control: #cf6158;  /* borda do botão de perigo (contraste ≥ 3) */
  --tone-purple-fg: #5b3aa8;
  --tone-purple-bg: #f2eefc;
  --tone-purple-border: #dbd0f6;
  --tone-neutral-fg: #4b5466;
  --tone-neutral-bg: #eef0f3;
  --tone-neutral-border: #d9dde4;

  /* --- Tipografia --- */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 0.75rem;     /* 12px — badges, textos auxiliares */
  --text-sm: 0.8125rem;   /* 13px — tabelas, labels */
  --text-base: 0.875rem;  /* 14px — corpo */
  --text-md: 0.9375rem;   /* 15px — títulos de card */
  --text-lg: 1.125rem;    /* 18px — subtítulos de painel */
  --text-xl: 1.375rem;    /* 22px — título da página */
  --text-2xl: 1.625rem;   /* 26px — valor de indicador */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-caps: 0.04em;

  /* --- Espaçamento (escala de 4px) --- */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* --- Raios --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  /* --- Sombras (muito suaves) --- */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.14);
  --ring-focus: 0 0 0 3px rgba(59, 111, 224, 0.35);

  /* --- Dimensões de layout --- */
  --sidebar-width: 248px;
  --sidebar-width-collapsed: 68px;
  --topbar-height: 60px;
  --detail-width: 560px;
  --control-height: 36px;
  --control-height-sm: 30px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 20px;

  /* --- Movimento --- */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --easing: cubic-bezier(0.2, 0, 0, 1);

  /* --- Camadas --- */
  --z-base: 1;
  --z-sticky: 10;
  --z-topbar: 20;
  --z-sidebar: 30;
  --z-drawer: 40;
  --z-overlay: 50;
  --z-modal: 60;
  --z-toast: 70;
  --z-tooltip: 80;

  color-scheme: light;
}

/* Dark mode: estrutura pronta, valores a definir quando for implementado.
[data-theme="dark"] {
  --color-bg: ...;
  --color-surface: ...;
  --color-text: ...;
  color-scheme: dark;
}
*/

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
  }
}
