/* ============================================================
   TEMA / PALETA — variáveis CSS centralizadas
   Suporta dark e light (toggle via classe no <html>)
   ============================================================ */

:root,
:root.dark {
    /* Backgrounds */
    --bg-app:        #0a0d12;
    --bg-primary:    #0f1115;
    --bg-secondary:  #1a1d27;
    --bg-tertiary:   #232734;
    --bg-elevated:   #2a2f3d;

    /* Bordas */
    --border:        #1f2430;
    --border-strong: #3a4050;

    /* Textos */
    --text-primary:   #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted:     #6b7280;
    --text-inverse:   #ffffff;

    /* Brand / Accent — Proservis (azul-petróleo) */
    --accent:        #0e7490;
    --accent-hover:  #0a5468;
    --accent-light:  #22d3ee;
    --accent-bg:     rgba(14, 116, 144, 0.12);

    /* Estados */
    --success:       #34d399;
    --success-bg:    rgba(52, 211, 153, 0.1);
    --warning:       #f59e0b;
    --warning-bg:    rgba(245, 158, 11, 0.1);
    --danger:        #ef4444;
    --danger-bg:     rgba(239, 68, 68, 0.1);

    /* Overlays / sombras */
    --overlay:       rgba(0, 0, 0, 0.7);
    --shadow:        0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   TEMA LIGHT
   ============================================================ */

:root.light {
    --bg-app:        #ffffff;
    --bg-primary:    #ffffff;
    --bg-secondary:  #f9fafb;
    --bg-tertiary:   #f3f4f6;
    --bg-elevated:   #ffffff;

    --border:        #e5e7eb;
    --border-strong: #d1d5db;

    --text-primary:   #0f1115;
    --text-secondary: #4b5563;
    --text-muted:     #9ca3af;
    --text-inverse:   #ffffff;

    --accent:        #0e7490;
    --accent-hover:  #0a5468;
    --accent-light:  #0e7490;
    --accent-bg:     rgba(14, 116, 144, 0.08);

    --success:       #059669;
    --success-bg:    rgba(5, 150, 105, 0.08);
    --warning:       #d97706;
    --warning-bg:    rgba(217, 119, 6, 0.08);
    --danger:        #dc2626;
    --danger-bg:     rgba(220, 38, 38, 0.08);

    --overlay:       rgba(15, 17, 21, 0.5);
    --shadow:        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Aplica fundo + texto nas tags base */
html, body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Tipografia consistente — DM Sans em todos os títulos, tamanhos padronizados */
h1, h2, h3, h4 {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.25;
}
h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.4px; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; }

/* <select> options seguem o tema (Chrome/Firefox aceitam; Safari mantém SO) */
select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
select optgroup {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}
