/* =============================================================================
   ORAEX — Fundação de design (Fase 0)
   =============================================================================
   Tokens da identidade visual oficial ORAEX ("Built to Decide") e tipografia
   institucional. Este arquivo NÃO estiliza componentes — ele apenas declara as
   fontes, as variáveis e a base tipográfica.

   Ordem de carregamento (DashboardAsset.php):
       AdminLTE  →  oraex-tokens.css  →  oraex.css  →  oraex-components.css

   Fontes: Carlito e Michroma, hospedadas localmente. O projeto é zero-trust —
   nenhum CSS/JS/fonte vem de CDN externo. Não substituir por Google Fonts.

   Carlito é métrica-compatível com Calibri (a fonte da marca, licenciada pela
   Microsoft e não distribuível como webfont), sob licença SIL OFL.

   Especificação: documentation/ESPECIFICACAO_REDESIGN_INTERFACE.md §4
   ============================================================================= */

/* ============================================================================
   1. FONTES — self-hosted
   ============================================================================ */

/* --- Carlito 400 ------------------------------------------------------- */
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/carlito-400-latin.woff2') format('woff2');
    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: 'Carlito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/carlito-400-latin-ext.woff2') format('woff2');
    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;
}

/* --- Carlito 700 ------------------------------------------------------- */
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/carlito-700-latin.woff2') format('woff2');
    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: 'Carlito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/carlito-700-latin-ext.woff2') format('woff2');
    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;
}

/* --- Carlito 400 itálico ----------------------------------------------- */
@font-face {
    font-family: 'Carlito';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/carlito-400i-latin.woff2') format('woff2');
    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: 'Carlito';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/carlito-400i-latin-ext.woff2') format('woff2');
    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;
}

/* --- Carlito 700 itálico ----------------------------------------------- */
@font-face {
    font-family: 'Carlito';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/carlito-700i-latin.woff2') format('woff2');
    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: 'Carlito';
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/carlito-700i-latin-ext.woff2') format('woff2');
    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;
}

/* --- Michroma 400 (display) -------------------------------------------- */
@font-face {
    font-family: 'Michroma';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/michroma-400-latin.woff2') format('woff2');
    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: 'Michroma';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/michroma-400-latin-ext.woff2') format('woff2');
    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;
}

/* ============================================================================
   2. TOKENS
   ============================================================================
   Paleta institucional. Regra normativa: cor só é aplicada quando carrega
   significado semântico (verde = ok, vermelho = crítico, azul = interativo).
   Fora disso a interface vive em navy / slate / branco. É proibido usar
   azul+verde+laranja+vermelho lado a lado apenas para diferenciar categorias.
   ============================================================================ */

:root {
    /* --- Marca --- */
    --navy-900: #092E52;   /* topbar, sidebar, fundo escuro dominante */
    --navy-800: #0D3B6D;   /* hover em áreas escuras */
    --navy-700: #164476;   /* primária: títulos, botão primário, barras de gráfico */
    --blue-500: #1E74C8;   /* links, elementos interativos, status "em progresso" */
    --blue-400: #4A90D9;   /* acentos secundários em gráficos */

    /* --link não consta na tabela da diretriz; existe por contraste.
       --blue-500 rende 4,75:1 sobre branco (passa em AA) mas 4,30:1 sobre
       --surface (reprova) — e link em tabela cai justamente sobre o cinza.
       #14639F passa nos dois (5,9:1 no branco, 5,3:1 no cinza) e continua
       lendo como azul de link. Usar em <a>; --blue-500 segue valendo para
       ícone, borda e status. */
    --link: #14639F;
    --link-hover: var(--navy-800);

    /* --- Neutros --- */
    --slate-800: #1E293B;  /* texto principal */
    --slate-600: #64748B;  /* texto secundário, legendas, labels */
    /* --slate-700 não está na tabela original da diretriz. Foi acrescentado por
       necessidade de contraste: --slate-600 sobre branco dá 4,76:1 (passa em
       AA), mas sobre --surface cai para 4,28:1 (reprova). Use-o para texto
       pequeno assentado em fundo cinza — abas inativas, chips, legendas dentro
       de áreas tonais. Sobre --surface rende 6,0:1. */
    --slate-700: #475569;
    --slate-300: #CBD5E1;  /* bordas, divisores */

    /* --- Superfícies --- */
    --surface: #F0F3F8;       /* fundo geral da aplicação */
    --surface-tint: #E3E7EE;  /* fundo de cards, bordas de tabela */
    --card: #FFFFFF;

    /* --- Semânticas (uso exclusivo) --- */
    --success: #22C55E;      /* SLA cumprido / sucesso */
    /* #15803D dá 4,16:1 sobre o tonal verde composto — reprova por pouco.
       #146433 leva a 5,6:1. */
    --success-dark: #146433; /* texto sobre fundo tonal de sucesso */
    --danger: #EF4444;       /* alerta crítico / SLA estourado */
    --danger-dark: #B91C1C;  /* texto sobre fundo tonal de perigo */
    --warning: #F59E0B;      /* atenção — usar com parcimônia */
    /* #B45309 rende 4,17:1 sobre o tonal âmbar composto — reprova por pouco.
       #92400E leva a 5,9:1 e mantém a leitura de "atenção". */
    --warning-dark: #92400E;

    /* --- Fundos tonais (nunca sólidos saturados) --- */
    --tint-blue: rgba(30, 116, 200, 0.10);
    --tint-blue-400: rgba(74, 144, 217, 0.12);
    --tint-slate: rgba(100, 116, 139, 0.12);
    --tint-navy: rgba(9, 46, 82, 0.06);
    --tint-success: rgba(34, 197, 94, 0.10);
    --tint-danger: rgba(239, 68, 68, 0.10);
    --tint-warning: rgba(245, 158, 11, 0.12);

    /* --- Forma --- */
    --radius: 10px;      /* cards e painéis */
    --radius-sm: 8px;    /* botões e inputs */
    --radius-pill: 20px; /* badges */
    --shadow-card: 0 1px 2px rgba(9, 46, 82, 0.04);
    --shadow-raised: 0 4px 12px rgba(9, 46, 82, 0.08);
    --gap: 16px;
    --content-pad: 28px;

    /* --- Tipografia --- */
    --font: 'Carlito', Calibri, 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    --font-display: 'Michroma', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'SFMono-Regular', Menlo, Consolas, 'Courier New', monospace;

    /* --- Sidebar --- */
    --sidebar-width: 230px;
    --sidebar-item: rgba(255, 255, 255, 0.62);
    --sidebar-item-active-bg: rgba(255, 255, 255, 0.08);

    /* ------------------------------------------------------------------
       Compatibilidade com a paleta antiga.
       oraex.css e ~54 views ainda referenciam estes nomes. Remapeados para a
       paleta institucional para que a cor legada desapareça sem precisar de
       edição em massa. Removê-los é tarefa da Fase 5.
       ------------------------------------------------------------------ */
    --oraex-blue-dark: var(--navy-900);
    --oraex-blue: var(--navy-700);
    --oraex-blue-light: var(--blue-500);
    --oraex-blue-lighter: var(--blue-400);
    --oraex-blue-pale: var(--tint-blue);
    --oraex-white: #ffffff;
    --oraex-gray-light: var(--surface);
    --oraex-gray: var(--surface-tint);
    --oraex-gray-dark: var(--slate-600);
    --oraex-text: var(--slate-800);
    --oraex-green: var(--success);
}

/* ============================================================================
   3. BASE TIPOGRÁFICA
   ============================================================================
   Michroma é display font: pesada, com avanço largo e sem itálico. Fica restrita
   a H1, labels de seção, títulos de painel e valores de KPI — sempre por classe
   explícita ou seletor de elemento de título, NUNCA herdada por texto corrido.
   Ver a trava negativa no fim desta seção.
   ============================================================================ */

body,
.content-wrapper,
.main-footer,
.main-sidebar,
.main-header,
.modal,
.tooltip,
.popover,
.select2-container,
.daterangepicker,
.datepicker {
    font-family: var(--font);
}

body {
    font-size: 14px;
    color: var(--slate-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Elementos de formulário não herdam font-family por padrão em alguns browsers */
input,
button,
select,
textarea,
.form-control,
.btn {
    font-family: var(--font);
}

/* --- Display -------------------------------------------------------------
   Aplicada por classe utilitária e nos títulos das seções redesenhadas.
   ------------------------------------------------------------------------ */
.font-display,
.oraex-display {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.3px;
}

/* --- Trava negativa (RF-0.4 / D1) ---------------------------------------
   Michroma jamais em texto corrido, tabela, formulário ou botão — mesmo que
   alguma regra futura tente aplicá-la por herança. A suíte de UI verifica isto
   (§12.8-C); esta regra garante que a verificação passe por construção.
   ------------------------------------------------------------------------ */
td, th, input, select, textarea, .form-control, .btn,
p, li, label, small, span, div, a, dt, dd, figcaption, caption, legend {
    font-family: var(--font);
}

/* A lista acima inclui `div` e `span` de propósito.
   Uma primeira versão listava só os elementos "óbvios" de texto, e a Michroma
   vazou por herança para dentro de contêineres genéricos — o resumo de
   paginação da GridView, por exemplo, saiu em fonte de display.
   Quem quer Michroma pede por classe (.oraex-display) ou é um título. */

/* Exceção: cabeçalho de tabela usa Carlito 600 uppercase, não Michroma */
th {
    font-weight: 600;
}
