/* ============================================================
   AgroGest — Design System (tokens)
   Direction artistique : agronomie moderne. Vert forêt profond +
   ocre de terre en accent, surfaces douces, hiérarchie nette.
   ============================================================ */
:root {
  /* ---------- Marque ---------- */
  --color-primary:    #1B6B47;
  --color-primary-h:  #14563A;
  --color-primary-soft: #E8F2EC;
  --color-accent:     #C4763A;
  --color-accent-soft:#F7ECE2;

  /* ---------- Surfaces & fonds ---------- */
  --bg-page:    #F4F6F4;
  --surface-1:  #FFFFFF;
  --surface-2:  #EEF2EF;
  --surface-3:  #E4EAE5;

  /* ---------- Texte ---------- */
  --text-1: #16201B;
  --text-2: #56655C;
  --text-3: #8A988F;
  --text-on-primary: #FFFFFF;

  /* ---------- Bordures ---------- */
  --border:        #E0E7E2;
  --border-strong: #CBD5CE;

  /* ---------- Couleurs sémantiques ---------- */
  --color-success: #1E8E4A;
  --color-warning: #D7920F;
  --color-danger:  #C9352B;
  --color-info:    #2A6FB0;

  --tint-success: rgba(30, 142, 74, .13);
  --tint-warning: rgba(215, 146, 15, .15);
  --tint-danger:  rgba(201, 53, 43, .13);
  --tint-info:    rgba(42, 111, 176, .13);
  --tint-primary: rgba(27, 107, 71, .12);
  --tint-neutral: rgba(86, 101, 92, .12);

  /* ---------- Typographie ---------- */
  --font-ui:   "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-body:  14px;
  --fs-sm:    13px;
  --fs-xs:    12px;
  --fs-h1:    26px;
  --fs-h2:    18px;
  --fs-h3:    15px;
  --fs-kpi:   30px;
  --lh-tight: 1.2;
  --lh-base:  1.55;

  /* ---------- Espacements ---------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* ---------- Rayons ---------- */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-pill: 999px;
  --radius-btn:  var(--radius-sm);
  --radius-card: var(--radius-md);

  /* ---------- Ombres ---------- */
  --shadow-sm:   0 1px 2px rgba(20, 40, 30, .06), 0 1px 3px rgba(20, 40, 30, .04);
  --shadow-card: 0 1px 3px rgba(20, 40, 30, .06), 0 1px 2px rgba(20, 40, 30, .04);
  --shadow-md:   0 4px 12px rgba(20, 40, 30, .08), 0 2px 4px rgba(20, 40, 30, .05);
  --shadow-lg:   0 12px 32px rgba(20, 40, 30, .14), 0 4px 8px rgba(20, 40, 30, .06);
  --shadow-pop:  var(--shadow-lg);

  /* ---------- Layout ---------- */
  --sidebar-w:           248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h:            60px;
  --content-max:         1320px;

  /* ---------- Transitions ---------- */
  --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
  --t-med:  220ms cubic-bezier(.4, 0, .2, 1);

  --gradient-brand: linear-gradient(135deg, #1B6B47 0%, #2E8B5C 100%);
}

[data-theme="dark"] {
  --color-primary:    #3DBA77;
  --color-primary-h:  #4ECE88;
  --color-primary-soft: rgba(61, 186, 119, .14);
  --color-accent:     #E0975B;
  --color-accent-soft: rgba(224, 151, 91, .14);

  --bg-page:    #0E1311;
  --surface-1:  #18201C;
  --surface-2:  #212B25;
  --surface-3:  #2B362F;

  --text-1: #E9EFEB;
  --text-2: #A3B1A8;
  --text-3: #76837B;

  --border:        #2A352E;
  --border-strong: #3A463F;

  --color-success: #46C97A;
  --color-warning: #EAB23E;
  --color-danger:  #E66056;
  --color-info:    #5B9BD8;

  --tint-success: rgba(70, 201, 122, .16);
  --tint-warning: rgba(234, 178, 62, .16);
  --tint-danger:  rgba(230, 96, 86, .16);
  --tint-info:    rgba(91, 155, 216, .16);
  --tint-primary: rgba(61, 186, 119, .16);
  --tint-neutral: rgba(163, 177, 168, .14);

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, .45);
  --shadow-lg:   0 12px 32px rgba(0, 0, 0, .55);

  --gradient-brand: linear-gradient(135deg, #18201C 0%, #1F2C25 100%);
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
