/* ============================================================
   SIGSPA-SINDPESCA — DESIGN SYSTEM / THEME
   Tokens de identidade visual (Mobile First).
   Carregado primeiro — modern.css pode sobrescrever onde necessário.
   ============================================================ */

:root {
    /* Cores primárias */
    --brand-primary: #6366f1;
    --brand-secondary: #8b5cf6;
    --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    /* Cores semânticas */
    --color-success: #3b82f6;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #0ea5e9;

    /* Neutros */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Fundo e superfícies */
    --surface-bg: #ffffff;
    --surface-alt: #f8fafc;
    --surface-border: #e5e7eb;

    /* Tipografia */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base: 14px;
    --font-size-sm: 12.5px;
    --font-size-lg: 16px;

    /* Espaçamento (escala 4px) */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;

    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
    --shadow-focus: 0 0 0 4px rgba(99, 102, 241, 0.15);

    /* Z-index escala */
    --z-sidebar: 1030;
    --z-topbar: 1020;
    --z-modal: 1050;
    --z-tooltip: 1070;

    /* Transições */
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.15s;
    --dur-med: 0.28s;
    --dur-slow: 0.4s;

    /* Modais */
    --modal-radius: 18px;
}

/* ---------- Dark Mode (arquitetura preparada) ---------- */
[data-theme="dark"] {
    --surface-bg: #171a23;
    --surface-alt: #1e212c;
    --surface-border: #2a2e3d;
    --gray-100: #1e212c;
    --gray-200: #2a2e3d;
    --gray-300: #3b4054;
    --gray-400: #7c8298;
    --gray-500: #9aa1b5;
    --gray-600: #b4bacd;
    --gray-700: #cdd2e0;
    --gray-800: #e2e6f0;
    --gray-900: #f1f3f8;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* ---------- Base ---------- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--gray-800);
    background: #f0f2f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Foco visível e acessível (navegação por teclado) */
:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Scrollbars consistentes */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Toque preciso em telas touch */
button,
a,
select,
input[type="submit"],
input[type="button"] {
    touch-action: manipulation;
}
