/* ==========================================================================
   Design Tokens — Dashboard Premium de Tráfego Pago
   Tema escuro "azul-noite": base profunda, superfícies em camadas com brilho
   no topo, accent azul-elétrico com apoio em ciano e violeta usados de forma
   funcional (séries de gráfico, ícones), nunca decorativa aleatória.
   ========================================================================== */

:root {
  /* Marca */
  --color-accent: #4f8cff;
  --color-accent-hover: #7aa8ff;
  --color-accent-soft: rgba(79, 140, 255, 0.16);
  --color-accent-soft-border: rgba(79, 140, 255, 0.42);
  --color-cyan: #22d3ee;
  --color-violet: #8b7cff;
  --grad-brand: linear-gradient(135deg, #4f8cff 0%, #22d3ee 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(79, 140, 255, 0.22) 0%, rgba(34, 211, 238, 0.12) 100%);

  /* Superfícies */
  --color-bg: #060912;
  --color-surface: #0e1424;
  --color-surface-hover: #151d34;
  --color-input-bg: #0a0f1d;
  --color-border: rgba(255, 255, 255, 0.075);
  --color-border-strong: rgba(255, 255, 255, 0.15);
  --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.018) 100%);

  /* Texto */
  --color-text: #eef2ff;
  --color-text-secondary: #9aa7c7;
  --color-text-muted: #66729a;
  --color-text-inverse: #ffffff;

  /* Semânticas */
  --color-positive: #34d399;
  --color-positive-soft: rgba(52, 211, 153, 0.15);
  --color-negative: #fb7185;
  --color-negative-soft: rgba(251, 113, 133, 0.15);
  --color-warning: #fbbf24;
  --color-warning-soft: rgba(251, 191, 36, 0.15);
  --color-neutral-soft: rgba(255, 255, 255, 0.06);
  --color-track: #0a0f1d;

  /* Paleta curada para ícones/séries — ricas e distintas, não neon */
  --chip-blue: #4f8cff;       --chip-blue-soft: rgba(79, 140, 255, 0.17);
  --chip-emerald: #10d9a0;    --chip-emerald-soft: rgba(16, 217, 160, 0.16);
  --chip-violet: #9b8cff;     --chip-violet-soft: rgba(155, 140, 255, 0.17);
  --chip-amber: #fbbf24;      --chip-amber-soft: rgba(251, 191, 36, 0.16);
  --chip-cyan: #22d3ee;       --chip-cyan-soft: rgba(34, 211, 238, 0.16);
  --chip-pink: #f472b6;       --chip-pink-soft: rgba(244, 114, 182, 0.16);
  --chip-orange: #fb923c;     --chip-orange-soft: rgba(251, 146, 60, 0.16);
  --chip-teal: #2dd4bf;       --chip-teal-soft: rgba(45, 212, 191, 0.16);
  --chip-green: #4ade80;      --chip-green-soft: rgba(74, 222, 128, 0.16);
  --chip-rose: #fb7185;       --chip-rose-soft: rgba(251, 113, 133, 0.16);

  /* Tipografia */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-kpi: 1.875rem;

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

  /* Raio e elevação */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.7);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 14px 34px -16px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(79, 140, 255, 0.35), 0 10px 34px -8px rgba(79, 140, 255, 0.45);

  --sidebar-width: 244px;
  --topbar-height: 64px;

  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
  --transition-fast: 140ms ease;
  --transition-base: 220ms var(--ease-out);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--color-accent-soft-border); color: var(--color-text); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* O atributo [hidden] precisa vencer classes de display (ex.: .flex). */
[hidden] { display: none !important; }

/* Ícone nativo do input[type=date] é escuro por padrão. */
input::-webkit-calendar-picker-indicator { filter: invert(0.85); }

/* Barra de rolagem discreta */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
