/* =============================================
   CSS Variables — Tema IPP (Light/Dark)
   Inspirado no serena-dashboard-v2 (navy + vermelho)
   ============================================= */

:root {
  /* Espaçamentos */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Tipografia */
  --font-base: 'Helvetica Neue', Arial, sans-serif;
  --fs-xs: 0.7rem;
  --fs-sm: 0.8rem;
  --fs-base: 0.95rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;

  /* Bordas e raios */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transições */
  --transition: 200ms ease;

  /* Cores semânticas (fixas em ambos os temas) */
  --color-success: #16a34a;
  --color-success-bg: #16a34a15;
  --color-warning: #f59e0b;
  --color-warning-bg: #f59e0b15;
  --color-danger: #dc2626;
  --color-danger-bg: #dc262615;
  --color-info: #17a2b8;
  --color-info-bg: #17a2b815;
  --color-neutral: #6c757d;
  --color-neutral-bg: #6c757d15;

  /* Cores IPP — navy + vermelho (fixas em ambos os temas) */
  --color-red: #e74c3c;
  --color-red-hover: #c0392b;
  --color-teal: #1a5b6e;
  --color-teal-dark: #144d5d;
  --color-navy: #2c3e50;
  --color-navy-dark: #1f2d3a;
}

/* ====== Tema Claro (padrão) ====== */
:root,
[data-theme="light"] {
  --bg-page: #d5d8dc;
  --bg-card: #ffffff;
  --bg-card-alt: #f8f9fa;
  --bg-table-alt: #f1f3f5;
  --bg-kanban-col: #e9ecef;

  --text-primary: #2c3e50;
  --text-secondary: #4a5560;
  --text-muted: #8a929b;
  --text-inverse: #ffffff;

  --border-color: #bdc3c7;
  --border-strong: #95a5a6;
}

/* ====== Tema Escuro ====== */
[data-theme="dark"] {
  --bg-page: #14181f;
  --bg-card: #1f2d3a;
  --bg-card-alt: #2a3441;
  --bg-table-alt: #2a3441;
  --bg-kanban-col: #2a3441;

  --text-primary: #e8ecf1;
  --text-secondary: #b0b8c2;
  --text-muted: #6b7588;
  --text-inverse: #ffffff;

  --border-color: #3a4451;
  --border-strong: #4a5461;
}

/* ====== Respeitar prefers-color-scheme quando sem override ====== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-page: #14181f;
    --bg-card: #1f2d3a;
    --bg-card-alt: #2a3441;
    --bg-table-alt: #2a3441;
    --bg-kanban-col: #2a3441;

    --text-primary: #e8ecf1;
    --text-secondary: #b0b8c2;
    --text-muted: #6b7588;
    --text-inverse: #ffffff;

    --border-color: #3a4451;
    --border-strong: #4a5461;
  }
}
