/**
 * ================================================================
 * BAMBA SOLUTIONS ERP — Design Token System
 * Source unique de vérité pour toutes les variables CSS.
 * Importer ce fichier EN PREMIER dans toutes les pages.
 * ================================================================
 */

:root {
  /* ────────────────────────────────────────────────────────────────
   * COULEURS PRIMAIRES (palette Microsoft Fluent)
   * ──────────────────────────────────────────────────────────────── */
  --clr-primary:        #0078d4;
  --clr-primary-hover:  #106ebe;
  --clr-primary-dark:   #005a9e;
  --clr-primary-light:  #deecf9;
  --clr-primary-xlight: #eff6fc;

  /* ────────────────────────────────────────────────────────────────
   * NEUTRES
   * ──────────────────────────────────────────────────────────────── */
  --clr-white:    #ffffff;
  --clr-gray-50:  #faf9f8;
  --clr-gray-100: #f5f4f3;
  --clr-gray-150: #f3f2f1;
  --clr-gray-200: #edebe9;
  --clr-gray-300: #d1d1d1;
  --clr-gray-400: #c8c6c4;
  --clr-gray-500: #a19f9d;
  --clr-gray-600: #605e5c;
  --clr-gray-700: #484644;
  --clr-gray-800: #323130;
  --clr-gray-900: #201f1e;
  --clr-black:    #000000;

  /* ────────────────────────────────────────────────────────────────
   * STATUTS SÉMANTIQUES
   * ──────────────────────────────────────────────────────────────── */
  --clr-success:        #107c10;
  --clr-success-bg:     #dff6dd;
  --clr-success-border: #57a300;

  --clr-warning:        #c19c00;
  --clr-warning-bg:     #fff4ce;
  --clr-warning-border: #f2b900;

  --clr-danger:         #a4262c;
  --clr-danger-bg:      #fde7e9;
  --clr-danger-border:  #d13438;

  --clr-info:           #0078d4;
  --clr-info-bg:        #deecf9;
  --clr-info-border:    #0078d4;

  --clr-neutral:        #605e5c;
  --clr-neutral-bg:     #f3f2f1;

  /* ────────────────────────────────────────────────────────────────
   * SIDEBAR (thème sombre)
   * ──────────────────────────────────────────────────────────────── */
  --sidebar-bg:         #1a1d23;
  --sidebar-bg-hover:   #2a2d35;
  --sidebar-bg-active:  #0078d4;
  --sidebar-text:       #c8cad0;
  --sidebar-text-muted: #6e7180;
  --sidebar-icon:       #8b8fa8;
  --sidebar-border:     #2e3140;
  --sidebar-width:      220px;
  --sidebar-width-collapsed: 52px;

  /* ────────────────────────────────────────────────────────────────
   * TOPBAR
   * ──────────────────────────────────────────────────────────────── */
  --topbar-bg:     #1a1d23;
  --topbar-height: 44px;
  --topbar-text:   #e8e9ec;
  --topbar-border: #2e3140;

  /* ────────────────────────────────────────────────────────────────
   * TAB BAR
   * ──────────────────────────────────────────────────────────────── */
  --tabbar-height: 34px;
  --tabbar-bg:     var(--clr-gray-100);
  /* Layout overhead: topbar(44) + breadcrumb(32) + tabbar(34) + statusbar(22) */
  --layout-overhead: 132px;

  /* ────────────────────────────────────────────────────────────────
   * TYPOGRAPHIE
   * ──────────────────────────────────────────────────────────────── */
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-size-xs:   10px;
  --font-size-sm:   11px;
  --font-size-base: 13px;
  --font-size-md:   14px;
  --font-size-lg:   16px;
  --font-size-xl:   20px;
  --font-size-2xl:  24px;
  --font-size-3xl:  32px;

  --font-weight-light:   300;
  --font-weight-normal:  400;
  --font-weight-medium:  500;
  --font-weight-semi:    600;
  --font-weight-bold:    700;

  /* ────────────────────────────────────────────────────────────────
   * ESPACEMENTS (base 4px)
   * ──────────────────────────────────────────────────────────────── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* ────────────────────────────────────────────────────────────────
   * BORDURES & OMBRES
   * ──────────────────────────────────────────────────────────────── */
  --border-radius-sm: 2px;
  --border-radius:    4px;
  --border-radius-md: 6px;
  --border-radius-lg: 8px;
  --border-radius-pill: 999px;

  --border:       1px solid var(--clr-gray-300);
  --border-light: 1px solid var(--clr-gray-200);

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.08);
  --shadow-sm:  0 2px 4px rgba(0,0,0,0.10);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.14);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.18);
  --shadow-focus: 0 0 0 2px rgba(0,120,212,0.30);

  /* ────────────────────────────────────────────────────────────────
   * TRANSITIONS
   * ──────────────────────────────────────────────────────────────── */
  --transition-fast:   0.12s ease;
  --transition-normal: 0.20s ease;
  --transition-slow:   0.35s ease;

  /* ────────────────────────────────────────────────────────────────
   * Z-INDEX SCALE
   * ──────────────────────────────────────────────────────────────── */
  --z-sidebar:   100;
  --z-topbar:    200;
  --z-modal:     900;
  --z-dropdown:  800;
  --z-tooltip:   1000;
  --z-chat:      850;

  /* ────────────────────────────────────────────────────────────────
   * THÈME SOMBRE (activé via .dark-theme sur <body>)
   * ──────────────────────────────────────────────────────────────── */
}

body.dark-theme {
  --clr-white:    #1f1f1f;
  --clr-gray-50:  #2a2a2a;
  --clr-gray-100: #2d2d2d;
  --clr-gray-150: #333333;
  --clr-gray-200: #3a3a3a;
  --clr-gray-300: #4a4a4a;
  --clr-gray-400: #5a5a5a;
  --clr-gray-500: #888888;
  --clr-gray-600: #aaaaaa;
  --clr-gray-700: #cccccc;
  --clr-gray-800: #e0e0e0;
  --clr-gray-900: #f0f0f0;
  --border:       1px solid #3a3a3a;
  --border-light: 1px solid #333333;
}
