/* ============================================================
   SFEC Connect — Design tokens
   Variables de design partagées par les espaces entreprise (app)
   et super-admin (admin). Chargé en premier dans chaque layout.
   ============================================================ */

:root {
  /* Surfaces & fonds */
  --surface-1: #f4f5f7;   /* fond de page / champs */
  --surface-2: #ffffff;   /* cartes, panneaux */
  --border: #e4e6eb;      /* bordures fines (0.5px) */

  /* Texte */
  --text-primary: #1a1d21;
  --text-secondary: #5b6270;
  --text-muted: #9097a1;

  /* Accent (indigo) */
  --text-accent: #4f46e5;
  --bg-accent: #eef0fe;

  /* Sémantique succès */
  --text-success: #15803d;
  --bg-success: #e6f6ec;

  /* Sémantique avertissement */
  --text-warning: #b45309;
  --bg-warning: #fdf3e2;

  /* Sémantique danger */
  --text-danger: #dc2626;
  --bg-danger: #fdecec;

  /* Typographie */
  --font-sans: 'Inter', 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;

  /* Rayons & ombres */
  --radius-sm: 8px;
  --radius-md: 11px;
  --radius-lg: 14px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-2: 0 6px 24px rgba(16, 24, 40, .08);
}

/* Thème sombre — automatique (préférence système) + manuel ([data-theme]) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --surface-1: #15171c;
    --surface-2: #1c1f26;
    --border: #2a2e37;
    --text-primary: #f1f2f4;
    --text-secondary: #a8aeb9;
    --text-muted: #6f7681;
    --text-accent: #8b87ff;
    --bg-accent: #25263a;
    --text-success: #4ade80;
    --bg-success: #14271c;
    --text-warning: #fbbf24;
    --bg-warning: #2a2110;
    --text-danger: #f87171;
    --bg-danger: #2a1414;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 6px 24px rgba(0, 0, 0, .4);
  }
}

:root[data-theme='dark'] {
  --surface-1: #15171c;
  --surface-2: #1c1f26;
  --border: #2a2e37;
  --text-primary: #f1f2f4;
  --text-secondary: #a8aeb9;
  --text-muted: #6f7681;
  --text-accent: #8b87ff;
  --bg-accent: #25263a;
  --text-success: #4ade80;
  --bg-success: #14271c;
  --text-warning: #fbbf24;
  --bg-warning: #2a2110;
  --text-danger: #f87171;
  --bg-danger: #2a1414;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, .4);
}

/* ---------- Reset léger ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

[x-cloak] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scrollbar discrète */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
