/* ============================================================
   utilities.css — Atomic utility classes (créé 2026-04-11)
   Conçu pour remplacer les styles inline dans index.html
   Toutes les valeurs s'appuient sur les tokens de main.css
   ============================================================ */

/* === DISPLAY === */
/* PAS de !important sur .hidden — sinon les style.display='block' en JS ne peuvent plus override */
.hidden { display: none; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.block { display: block; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* === FLEXBOX === */
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

/* === GAP === */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

/* === MARGIN — bottom === */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* === MARGIN — top === */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

/* === MARGIN — right/left === */
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* === PADDING === */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.px-2 { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* === TEXT ALIGN === */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* === FONT SIZE === */
.text-3xs { font-size: var(--fs-3xs); }
.text-2xs { font-size: var(--fs-2xs); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); }
.text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }
.text-2xl { font-size: var(--fs-2xl); }

/* === FONT WEIGHT === */
.font-regular { font-weight: var(--fw-regular); }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }

/* === COLORS — text === */
.text-primary-c { color: var(--text-primary); }
.text-secondary-c { color: var(--text-secondary); }
.text-muted-c { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }
.text-brand { color: var(--primary); }

/* === BORDERS === */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-pill { border-radius: var(--radius-pill); }

/* === EMPTY STATE — pattern composé fréquent === */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--text-dim);
}
.empty-state-icon {
  font-size: var(--fs-display);
  margin-bottom: var(--space-4);
  display: block;
  opacity: 0.3;
}

/* === TABLE HEADERS — pattern composé fréquent === */
.th-cell {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  font-weight: var(--fw-semibold);
}

/* === FORM LABELS === */
.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
}

/* === SECTION HEADER ROW (titre + actions) === */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
}
.section-header-row-mb4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

/* === MARGIN === */
.m-0 { margin: 0; }

/* === BACKGROUND tints fréquents === */
.bg-success-5 { background: rgba(16, 185, 129, 0.05); }
.bg-danger-5 { background: rgba(239, 68, 68, 0.05); }
.bg-primary-5 { background: rgba(59, 130, 246, 0.05); }

/* === SIZING === */
.max-w-600 { max-width: 600px; }
.w-full { width: 100%; }
.w-auto { width: auto; }

/* === MISC text === */
.font-3xl { font-size: var(--fs-3xl); }

/* === KPI empty icon (placeholder dashboards) === */
.kpi-empty-icon {
  font-size: var(--fs-display-lg);
  margin-bottom: var(--space-4);
  display: block;
  opacity: 0.3;
}

/* === Table cells === */
.td-left { padding: var(--space-2); text-align: left; }
.td-center { padding: var(--space-2); text-align: center; }
.th-uppercase {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
}
.th-uppercase-center {
  padding: var(--space-3) var(--space-4);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-dim);
  text-transform: uppercase;
}

/* === Flex compositions fréquentes === */
.flex-center-gap-3 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
