@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* ── Fond légèrement teinté — plus doux que le blanc pur */
    --background:         240 20% 98%;
    --foreground:         237 25% 10%;

    /* ── Cartes : blanc pur pour contraster avec le fond */
    --card:               0 0% 100%;
    --card-foreground:    237 25% 10%;

    --popover:            0 0% 100%;
    --popover-foreground: 237 25% 10%;

    /* ── Primary : indigo profond & saturé */
    --primary:            243 75% 59%;
    --primary-foreground: 0 0% 100%;

    /* ── Secondary & muted : cool-gray léger */
    --secondary:          240 12% 95%;
    --secondary-foreground: 237 25% 22%;
    --muted:              240 12% 95%;
    --muted-foreground:   240 8% 52%;

    /* ── Accent : même teinte que secondary */
    --accent:             240 12% 93%;
    --accent-foreground:  237 25% 16%;

    --destructive:        4 86% 58%;
    --destructive-foreground: 0 0% 100%;

    /* ── Bordures très fines */
    --border:             240 10% 90%;
    --input:              240 10% 90%;
    --ring:               243 75% 59%;

    --radius: 0.5rem;

    /* ── Charts */
    --chart-1: 243 75% 59%;
    --chart-2: 162 73% 40%;
    --chart-3: 32 95% 50%;
    --chart-4: 4 86% 58%;
    --chart-5: 270 73% 60%;

    /* ══ Sidebar : Obsidian — quasi-noir avec chaleur subtile */
    --sidebar-background:          237 28% 7%;
    --sidebar-foreground:          240 18% 93%;
    --sidebar-primary:             243 90% 70%;
    --sidebar-primary-foreground:  0 0% 100%;
    --sidebar-accent:              237 22% 14%;
    --sidebar-accent-foreground:   240 18% 93%;
    --sidebar-border:              237 18% 13%;
    --sidebar-ring:                243 75% 59%;

    /* ── Ombres personnalisées */
    --shadow-card:  0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-raised: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  }

  .dark {
    --background:         237 25% 8%;
    --foreground:         240 18% 94%;
    --card:               237 22% 11%;
    --card-foreground:    240 18% 94%;
    --popover:            237 22% 11%;
    --popover-foreground: 240 18% 94%;
    --primary:            243 82% 68%;
    --primary-foreground: 237 25% 8%;
    --secondary:          237 18% 18%;
    --secondary-foreground: 240 18% 94%;
    --muted:              237 18% 18%;
    --muted-foreground:   240 10% 56%;
    --accent:             237 18% 22%;
    --accent-foreground:  240 18% 94%;
    --destructive:        4 72% 52%;
    --destructive-foreground: 0 0% 100%;
    --border:             237 15% 20%;
    --input:              237 15% 20%;
    --ring:               243 82% 68%;
    --chart-1: 243 82% 68%;
    --chart-2: 162 65% 50%;
    --chart-3: 32 90% 58%;
    --chart-4: 4 72% 62%;
    --chart-5: 270 65% 66%;

    --sidebar-background:         237 28% 7%;
    --sidebar-foreground:         240 18% 93%;
    --sidebar-primary:            243 90% 70%;
    --sidebar-primary-foreground: 0 0% 100%;
    --sidebar-accent:             237 22% 14%;
    --sidebar-accent-foreground:  240 18% 93%;
    --sidebar-border:             237 18% 13%;
    --sidebar-ring:               243 82% 68%;
  }
}

@layer base {
  * {
    @apply border-border;
  }

  body {
    @apply bg-background text-foreground antialiased;
    font-feature-settings: "rlig" 1, "calt" 1;
  }

  h1, h2, h3, h4, h5, h6 {
    @apply tracking-tight;
  }
}

/* ── Cartes avec ombre subtile ───────────────────────────── */
@layer components {
  .card {
    box-shadow: var(--shadow-card);
  }
}

@layer utilities {
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  .glass {
    @apply bg-white/80 backdrop-blur-sm border border-white/20;
  }

  .dark .glass {
    @apply bg-gray-900/80 border-gray-700/20;
  }

  /* ── Ombre portée subtile pour les éléments élevés */
  .shadow-card {
    box-shadow: var(--shadow-card);
  }
  .shadow-raised {
    box-shadow: var(--shadow-raised);
  }

  /* ── Fond gradient très discret pour les KPI ── */
  .kpi-gradient {
    background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(240 20% 99%) 100%);
  }
}
