/* =========================
   THEME TOKENS — Baumgratz Design System (Quali-like)
   Fiel a: foundations.md + sidebar.md
   - Tokens em HSL
   - Dark via html.dark e .dark
   ========================= */

:root{
  /* Tipografia (Quali-like: pesos mais leves) */
  --font-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-weight-strong: 700;
  --font-weight-title: 600;
  --font-weight-emphasis: 600;
  --radius: 0.5rem; /* 8px */

  /* Sidebar (sidebar.md) */
  --sidebar-w-expanded: 240px; /* w-60 */
  --sidebar-w-collapsed: 44px; /* w-11 */

  /* =========================
     Gradientes (foundations.md)
     ========================= */
  --background-gradient: linear-gradient(135deg, hsl(217 92% 61%), hsl(217 100% 85%));
  --gradient-medical: linear-gradient(140deg, hsl(215 70% 18%), hsl(217 92% 61%));
  --gradient-card: linear-gradient(150deg, hsl(0 0% 100%), hsl(217 88% 92%));

  /* =========================
     Core UI (Light)
     ========================= */
  --background: 216 100% 97%;
  --foreground: 218 52% 16%;

  --card: 0 0% 100%;
  --card-foreground: 218 52% 16%;

  --popover: 0 0% 100%;
  --popover-foreground: 218 52% 16%;

  --muted: 217 62% 88%;
  --muted-foreground: 218 22% 42%;

  --border: 218 54% 84%;
  --input: 218 54% 84%;

  --ring: 217 92% 61%;

  /* Brand */
  --primary: 217 92% 61%;
  --primary-foreground: 210 40% 98%;

  --secondary: 217 88% 90%;
  --secondary-foreground: 218 52% 16%;

  --accent: 172 68% 46%;
  --accent-foreground: 210 40% 98%;

  /* =========================
     Semânticas (Light)
     ========================= */
  --success: 88 82% 60%;
  --success-foreground: 224 63% 14%;
  --success-soft: 88 82% 92%;

  --warning: 32 96% 60%;
  --warning-foreground: 224 63% 14%;
  --warning-soft: 32 96% 90%;

  --info: 217 92% 61%;
  --info-foreground: 210 40% 98%;
  --info-soft: 217 92% 92%;

  --destructive: 12 84% 58%;
  --destructive-foreground: 210 40% 98%;
  --destructive-soft: 12 84% 94%;

  /* =========================
     Sidebar tokens (foundations.md)
     ========================= */
  --sidebar-background: 216 100% 97%;
  --sidebar-foreground: 218 52% 16%;
  --sidebar-primary: 217 92% 61%;
  --sidebar-primary-foreground: 210 40% 98%;
  --sidebar-accent: 172 68% 46%;
  --sidebar-accent-foreground: 210 40% 98%;
  --sidebar-border: 218 54% 84%;
  --sidebar-ring: 217 92% 61%;

  /* Sombras (padrão DS) */
  --shadow-card:
    0 8px 16px -6px hsl(215 70% 18% / 0.12),
    0 2px 6px -2px hsl(217 92% 61% / 0.10);

  --shadow-card-hover:
    0 18px 30px -12px hsl(215 70% 18% / 0.18),
    0 8px 16px -6px hsl(217 92% 61% / 0.12);

  --shadow-soft:
    0 6px 18px hsl(215 70% 18% / 0.08);
}

/* =========================
   Dark (foundations.md)
   - Não mexe no gradiente da sidebar aqui (isso é sidebar.css)
   ========================= */
html.dark, .dark{
  color-scheme: dark;

  --background-gradient: linear-gradient(150deg, hsl(217 86% 7%), hsl(221 70% 3%));

  --background: 217 86% 5%;
  --foreground: 214 64% 90%;

  --card: 219 60% 10%;
  --card-foreground: 214 64% 90%;

  --popover: 219 60% 10%;
  --popover-foreground: 214 64% 90%;

  --muted: 219 36% 24%;
  --muted-foreground: 214 28% 76%;

  --border: 219 44% 28%;
  --input: 219 44% 28%;

  --primary: 217 92% 66%;
  --primary-foreground: 217 86% 5%;

  --secondary: 219 52% 18%;
  --secondary-foreground: 214 64% 90%;

  --accent: 172 68% 44%;
  --accent-foreground: 217 86% 5%;

  --ring: 217 92% 66%;

  /* =========================
     Semânticas (Dark) — completado
     (mantém base e ajusta “soft”)
     ========================= */
  --success: 88 82% 60%;
  --success-foreground: 210 40% 98%;
  --success-soft: 145 70% 22%;

  --warning: 32 96% 60%;
  --warning-foreground: 210 40% 98%;
  --warning-soft: 32 70% 24%;

  --info: 217 92% 66%;
  --info-foreground: 217 86% 5%;
  --info-soft: 217 60% 24%;

  --destructive: 9 78% 56%;
  --destructive-foreground: 210 40% 98%; /* ← melhor consistência */
  --destructive-soft: 9 78% 24%;

  /* Sidebar tokens (dark) */
  --sidebar-background: 217 86% 6%;
  --sidebar-foreground: 214 64% 90%;
  --sidebar-primary: 217 92% 66%;
  --sidebar-primary-foreground: 217 86% 5%;
  --sidebar-accent: 172 68% 44%;
  --sidebar-accent-foreground: 217 86% 5%;
  --sidebar-border: 219 44% 28%;
  --sidebar-ring: 217 92% 66%;
}

/* Base */
*{ box-sizing: border-box; }

html, body{ height: 100%; }

html{
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "calt" 1;
}

body{
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
