/**
 * ══════════════════════════════════════════════════════════════════════════════
 * Janio Pontes SaaS - Design System Tokens (Regra 60-30-10)
 * ══════════════════════════════════════════════════════════════════════════════
 * Paleta Oficial Padrão (Ergonomia Contábil & Legibilidade):
 * • 60% - Branco Giz (Canvas dominante, áreas de respiro, superfícies limpas)
 * • 30% - Grafite Profundo (Tipografia de alto contraste, sidebar, bordas e cards)
 * • 10% - Azul Safira (Ações primárias / CTA, acentos e estados de foco)
 * 
 * Modo Escuro disponível via atributo [data-theme="dark"] ou classe .theme-dark
 * ══════════════════════════════════════════════════════════════════════════════
 */

:root {
  /* ═══════════ 60% - BRANCO GIZ (CANVAS DOMINANTE & SUPERFÍCIES LIMPAS) ═══════════ */
  --surface-dominant: #f8fafc;        /* Fundo geral da aplicação (Branco Giz / Off-white) */
  --surface-card: #ffffff;            /* Fundo de cards, modais e containers */
  --surface-subtle: #f1f5f9;          /* Fundo suave para cabeçalhos de tabela, inputs e apoios */
  --surface-overlay: rgba(15, 23, 42, 0.45); /* Overlay translúcido de modais */
  --surface-border: #e2e8f0;          /* Bordas de separação de cards e divisores */
  --surface-border-subtle: #f1f5f9;   /* Bordas internas e linhas de grade finas */
  --surface-sidebar: #0f172a;         /* Sidebar executiva ancorada em Grafite Profundo */
  --surface-sidebar-hover: #1e293b;   /* Item de menu no hover */
  --surface-sidebar-active: #334155;  /* Item de menu selecionado */

  /* ═══════════ 30% - GRAFITE PROFUNDO (TIPOGRAFIA, ESTRUTURA & CONTRASTE) ═══════════ */
  --content-primary: #0f172a;         /* Grafite Profundo para textos principais, títulos e dados */
  --content-secondary: #475569;       /* Grafite intermediário para subtítulos e labels */
  --content-muted: #94a3b8;           /* Grafite suave para metadados, placeholders e ícones inativos */
  --surface-contrast: #0f172a;        /* Elemento de alto contraste */

  /* ═══════════ 10% - AZUL SAFIRA (AÇÕES PRIMÁRIAS / CALL TO ACTION & FOCO) ═══════════ */
  --brand-primary: #1d4ed8;           /* Azul Safira oficial para botões e CTAs primários */
  --brand-hover: #1e40af;             /* Azul Safira no estado hover */
  --brand-active: #172554;            /* Azul Safira no clique/pressionado */
  --brand-accent: #2563eb;            /* Azul Safira vibrante para foco e destaques */
  --brand-surface: #eff6ff;           /* Tint safira translúcido para badges e seleções ativas */
  --brand-ring: rgba(29, 78, 216, 0.25); /* Anel de foco para acessibilidade */

  /* ═══════════ STATUS & FEEDBACK SEMÂNTICO ═══════════ */
  --status-success: #10b981;
  --status-success-bg: #ecfdf5;
  --status-warning: #f59e0b;
  --status-warning-bg: #fffbeb;
  --status-danger: #ef4444;
  --status-danger-bg: #fef2f2;
  --status-info: #0284c7;
  --status-info-bg: #f0f9ff;

  /* ═══════════ ELEVAÇÃO & SOMBRAS ════════════ */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(15, 23, 42, 0.03);
  --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.08);

  /* ═══════════ CURVATURA & TRANSIÇÃO ════════════ */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Legado para retrocompatibilidade */
  --jp-navy: #0f172a;
  --jp-navy-deep: #020617;
  --jp-accent: #1d4ed8;
  --jp-accent-glow: rgba(29, 78, 216, 0.25);
}

/* ═══════════ TEMA ESCURO (INVERSÃO ERGONÔMICA 60-30-10) ═══════════ */
[data-theme="dark"], .theme-dark {
  /* 60% - Grafite Profundo como dominante no modo escuro */
  --surface-dominant: #0b0f19;
  --surface-card: #0f172a;
  --surface-subtle: #1e293b;
  --surface-overlay: rgba(0, 0, 0, 0.7);
  --surface-border: #334155;
  --surface-border-subtle: #1e293b;
  --surface-sidebar: #070a11;
  --surface-sidebar-hover: #1e293b;
  --surface-sidebar-active: #334155;

  /* 30% - Branco Giz para leitura nítida sobre o grafite */
  --content-primary: #f8fafc;
  --content-secondary: #cbd5e1;
  --content-muted: #64748b;
  --surface-contrast: #ffffff;

  /* 10% - Azul Safira luminoso */
  --brand-primary: #3b82f6;
  --brand-hover: #2563eb;
  --brand-active: #1d4ed8;
  --brand-accent: #60a5fa;
  --brand-surface: rgba(59, 130, 246, 0.14);
  --brand-ring: rgba(59, 130, 246, 0.35);

  --jp-navy: #0b0f19;
  --jp-navy-deep: #05070c;
  --jp-accent: #3b82f6;
}

/* ═══════════ COMPONENTES UTILITÁRIOS 60-30-10 ═══════════ */

/* Botão Primário (10% - Acento / CTA Azul Safira) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--brand-primary);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--transition-smooth);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover {
  background-color: var(--brand-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  background-color: var(--brand-active);
  transform: translateY(0);
}
.btn-primary:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* Botão Secundário (30% - Superfície com Borda e Tipografia Grafite) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--surface-card);
  color: var(--content-primary) !important;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover {
  background-color: var(--surface-subtle);
  border-color: var(--content-muted);
  color: var(--content-primary) !important;
}

/* Badge Semântica de Acento */
.badge-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--brand-surface);
  color: var(--brand-primary);
  border: 1px solid var(--brand-ring);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.625rem;
}

/* Card Semântico 60-30-10 */
.card-theme {
  background-color: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--content-primary);
  transition: all 0.25s var(--transition-smooth);
}
.card-theme:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-ring);
}
