@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap);
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Évite les scrollbars fantômes qui causent du CLS */
  overflow-x: hidden;
}

/* Réserve les dimensions des images pour éviter le CLS */
img { width: auto; height: auto; }

/* Sections off-screen : le navigateur ne les rend que quand elles deviennent visibles */
.deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

/* ── Lift effect on cards ── */
.lift-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}
.lift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.18) !important;
}

/* ── Shimmer skeleton ── */
@keyframes shimmer {
  0% { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
.skeleton-dark {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

/* ── Counter animation ── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.count-animated {
  animation: countUp 0.5s ease-out;
}

/* ── Toast notifications ── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}
.toast {
  animation: toastIn 0.3s ease-out forwards;
  pointer-events: auto;
}
.toast.hiding {
  animation: toastOut 0.3s ease-in forwards;
}

/* ── Floating label inputs ── */
.float-label-wrap {
  position: relative;
}
.float-label-wrap input,
.float-label-wrap select {
  padding-top: 18px !important;
  padding-bottom: 6px !important;
}
.float-label-wrap label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #94a3b8;
  pointer-events: none;
  transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease;
}
.float-label-wrap input:focus ~ label,
.float-label-wrap input:not(:placeholder-shown) ~ label,
.float-label-wrap select:focus ~ label,
.float-label-wrap select:not([value=""]) ~ label {
  top: 8px;
  font-size: 10px;
  color: #6366f1;
  font-weight: 600;
}

/* ── Nav active pill ── */
.nav-item-active {
  position: relative;
}
.nav-item-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  animation: navPillIn 0.2s ease-out;
}
@keyframes navPillIn {
  from { width: 0; opacity: 0; }
  to   { width: 60%; opacity: 1; }
}

/* ── Stock badge semantic colors ── */
.stock-badge-ok    { background: linear-gradient(135deg,#16a34a,#22c55e) !important; color:#fff !important; }
.stock-badge-warn  { background: linear-gradient(135deg,#d97706,#f59e0b) !important; color:#fff !important; }
.stock-badge-empty { background: linear-gradient(135deg,#dc2626,#ef4444) !important; color:#fff !important; }

/* ══════════════════════════════════════════════════
   DARK MODE GLOBAL — appliqué via body.dark-mode
   ══════════════════════════════════════════════════ */

/* ── CSS Variables overrides (composants qui utilisent var(--xxx)) ── */
body.dark-mode {
  --bg:     #0f172a;
  --text:   #e2e8f0;
  --muted:  #94a3b8;
  --border: #334155;
  --thead:  #0f172a;
  --card:   #1e293b;
  --input:  #1e293b;
  background-color: #0f172a !important;
  color: #e2e8f0 !important;
}

/* ════════════════════════
   MUI COMPONENTS
   ════════════════════════ */

/* Paper, Dialog, Popover, Menu */
body.dark-mode .MuiPaper-root,
body.dark-mode .MuiDialog-paper,
body.dark-mode .MuiPopover-paper,
body.dark-mode .MuiMenu-paper,
body.dark-mode .MuiAccordion-root {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Inputs MUI */
body.dark-mode .MuiInputBase-root,
body.dark-mode .MuiOutlinedInput-root,
body.dark-mode .MuiFilledInput-root {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}
body.dark-mode .MuiInputBase-input,
body.dark-mode .MuiSelect-select {
  color: #e2e8f0 !important;
}
body.dark-mode .MuiOutlinedInput-notchedOutline {
  border-color: #475569 !important;
}
body.dark-mode .MuiInputLabel-root,
body.dark-mode .MuiFormLabel-root {
  color: #94a3b8 !important;
}
body.dark-mode .MuiSelect-icon,
body.dark-mode .MuiSvgIcon-root {
  color: #94a3b8 !important;
}
body.dark-mode .MuiMenuItem-root {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}
body.dark-mode .MuiMenuItem-root:hover,
body.dark-mode .MuiListItemButton-root:hover {
  background-color: #334155 !important;
}
body.dark-mode .MuiAutocomplete-paper,
body.dark-mode .MuiAutocomplete-listbox {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}
body.dark-mode .MuiAutocomplete-option {
  color: #e2e8f0 !important;
}
body.dark-mode .MuiAutocomplete-option:hover,
body.dark-mode .MuiAutocomplete-option[aria-selected="true"] {
  background-color: #334155 !important;
}

/* Typography */
body.dark-mode .MuiTypography-root {
  color: #e2e8f0 !important;
}
body.dark-mode .MuiTypography-colorTextSecondary {
  color: #94a3b8 !important;
}

/* Tables MUI */
body.dark-mode .MuiTableContainer-root {
  background-color: #1e293b !important;
}
body.dark-mode .MuiTableCell-root {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
  background-color: transparent !important;
}
body.dark-mode .MuiTableCell-head {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
}
body.dark-mode .MuiTableRow-root {
  background-color: #1e293b !important;
}
body.dark-mode .MuiTableRow-root:nth-of-type(even) {
  background-color: #162032 !important;
}
body.dark-mode .MuiTableRow-root:hover {
  background-color: #273549 !important;
}

/* Tabs */
body.dark-mode .MuiTab-root { color: #94a3b8 !important; }
body.dark-mode .MuiTab-root.Mui-selected { color: #60a5fa !important; }
body.dark-mode .MuiTabs-indicator { background-color: #60a5fa !important; }
body.dark-mode .MuiTabs-root { border-bottom-color: #334155 !important; }

/* Chip */
body.dark-mode .MuiChip-root {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
}
body.dark-mode .MuiChip-label { color: inherit !important; }

/* Divider */
body.dark-mode .MuiDivider-root { border-color: #334155 !important; }

/* Buttons */
body.dark-mode .MuiIconButton-root { color: #94a3b8 !important; }
body.dark-mode .MuiButton-outlined {
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

/* Tooltip */
body.dark-mode .MuiTooltip-tooltip {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Alert */
body.dark-mode .MuiAlert-root {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border: 1px solid #334155 !important;
}

/* Stepper */
body.dark-mode .MuiStepLabel-label { color: #94a3b8 !important; }
body.dark-mode .MuiStepLabel-label.Mui-active { color: #60a5fa !important; }
body.dark-mode .MuiStepLabel-label.Mui-completed { color: #4ade80 !important; }
body.dark-mode .MuiStepConnector-line { border-color: #334155 !important; }

/* ════════════════════════
   INPUTS HTML NATIFS
   ════════════════════════ */
body.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.dark-mode select,
body.dark-mode textarea {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #64748b !important;
  opacity: 1 !important;
}
body.dark-mode select option {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
}

/* ════════════════════════
   TABLES HTML NATIVES
   ════════════════════════ */
body.dark-mode table { color: #e2e8f0 !important; }

body.dark-mode thead,
body.dark-mode thead tr,
body.dark-mode thead th,
body.dark-mode th {
  background-color: #0f172a !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}

body.dark-mode tbody tr { background-color: #1e293b !important; }
body.dark-mode tbody tr:nth-child(even) { background-color: #162032 !important; }
body.dark-mode tbody tr:hover { background-color: #273549 !important; }

body.dark-mode td {
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

/* ════════════════════════
   FONDS BLANCS / CLAIRS (inline styles)
   ════════════════════════ */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"],
body.dark-mode [style*="background: #FFF"],
body.dark-mode [style*="background: #ffffff"],
body.dark-mode [style*="background: #FFFFFF"],
body.dark-mode [style*="background:#ffffff"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:#fff"],
body.dark-mode [style*="background-color: #fff"],
body.dark-mode [style*="background-color: #ffffff"] {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

body.dark-mode [style*="background: #f8fafc"],
body.dark-mode [style*="background: #F8FAFC"],
body.dark-mode [style*="background: #f9fafb"],
body.dark-mode [style*="background: #F9FAFB"],
body.dark-mode [style*="background: #f6f8fa"],
body.dark-mode [style*="background: #f1f5f9"],
body.dark-mode [style*="background: #F1F5F9"],
body.dark-mode [style*="background: #edf2f7"],
body.dark-mode [style*="background: rgba(249,250,251"],
body.dark-mode [style*="background: rgba(248,250,252"] {
  background: #162032 !important;
  color: #e2e8f0 !important;
}

/* ════════════════════════
   TEXTES SOMBRES → CLAIRS
   ════════════════════════ */
body.dark-mode [style*="color: #0f172a"],
body.dark-mode [style*="color: #0F172A"],
body.dark-mode [style*="color: #111827"],
body.dark-mode [style*="color: #1a202c"],
body.dark-mode [style*="color: #1e293b"],
body.dark-mode [style*="color: #111"],
body.dark-mode [style*="color: #000"],
body.dark-mode [style*="color: black"],
body.dark-mode [style*="color: #2d3748"],
body.dark-mode [style*="color: #374151"] { color: #e2e8f0 !important; }

body.dark-mode [style*="color: #6b7280"],
body.dark-mode [style*="color: #64748b"],
body.dark-mode [style*="color: #64748B"],
body.dark-mode [style*="color: #4b5563"],
body.dark-mode [style*="color: #9ca3af"] { color: #94a3b8 !important; }

/* ════════════════════════
   BORDURES CLAIRES → SOMBRES
   ════════════════════════ */
body.dark-mode [style*="border: 1px solid #e5e7eb"],
body.dark-mode [style*="border: 1px solid #E5E7EB"],
body.dark-mode [style*="border-bottom: 1px solid #e5e7eb"],
body.dark-mode [style*="border-top: 1px solid #e5e7eb"],
body.dark-mode [style*="borderColor: #e5e7eb"],
body.dark-mode [style*="border: 2px solid #e5e7eb"],
body.dark-mode [style*="border-color: #e5e7eb"] {
  border-color: #334155 !important;
}

/* ════════════════════════
   BADGES DE STATUT
   ════════════════════════ */
/* Succès */
body.dark-mode [style*="background: #ecfdf5"],
body.dark-mode [style*="background: #ECFDF5"],
body.dark-mode [style*="background: #d1fae5"] {
  background: #064e3b !important;
}
body.dark-mode [style*="color: #065f46"],
body.dark-mode [style*="color: #065F46"],
body.dark-mode [style*="color: #166534"] { color: #6ee7b7 !important; }

/* Avertissement */
body.dark-mode [style*="background: #fef3c7"],
body.dark-mode [style*="background: #FEF3C7"],
body.dark-mode [style*="background: #fde68a"] {
  background: #451a03 !important;
}
body.dark-mode [style*="color: #92400e"],
body.dark-mode [style*="color: #92400E"],
body.dark-mode [style*="color: #854d0e"] { color: #fcd34d !important; }

/* Danger */
body.dark-mode [style*="background: #fee2e2"],
body.dark-mode [style*="background: #fef2f2"],
body.dark-mode [style*="background: #FEE2E2"] {
  background: #450a0a !important;
}
body.dark-mode [style*="color: #7f1d1d"],
body.dark-mode [style*="color: #7F1D1D"],
body.dark-mode [style*="color: #dc2626"],
body.dark-mode [style*="color: #b91c1c"] { color: #fca5a5 !important; }

/* Info */
body.dark-mode [style*="background: #eef2ff"],
body.dark-mode [style*="background: #dbeafe"],
body.dark-mode [style*="background: #eff6ff"] {
  background: #1e3a5f !important;
}
body.dark-mode [style*="color: #3730a3"],
body.dark-mode [style*="color: #1d4ed8"],
body.dark-mode [style*="color: #1e40af"] { color: #93c5fd !important; }

/* ════════════════════════
   SCROLLBAR
   ════════════════════════ */
body.dark-mode ::-webkit-scrollbar { width: 8px; height: 8px; }
body.dark-mode ::-webkit-scrollbar-track { background: #0f172a; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ════════════════════════
   SKELETON
   ════════════════════════ */
body.dark-mode .skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%) !important;
}

/* ════════════════════════════════════════════
   CSS CLASSES HARDCODÉES (Achats, Charges, Stock…)
   ════════════════════════════════════════════ */

/* Conteneur tableau */
body.dark-mode .table-scroll,
body.dark-mode .table-container {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Lignes / cellules */
body.dark-mode .table tbody td,
body.dark-mode .table td {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
body.dark-mode .table tbody tr:nth-child(even) td {
  background: #162032 !important;
}
body.dark-mode .table tbody tr:hover td,
body.dark-mode .table tbody tr:hover {
  background: #273549 !important;
}
body.dark-mode .table-total {
  background: #1a2744 !important;
  color: #fcd34d !important;
  border-color: #334155 !important;
}

/* Cartes */
body.dark-mode .card,
body.dark-mode .card-section,
body.dark-mode .panel,
body.dark-mode .box {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Champs de saisie (classes custom) */
body.dark-mode .field,
body.dark-mode .select,
body.dark-mode .input-field {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
body.dark-mode .field:focus,
body.dark-mode .select:focus { border-color: #6366f1 !important; }

/* Textes titrages */
body.dark-mode .section-title,
body.dark-mode .page-title,
body.dark-mode .card-title { color: #e2e8f0 !important; }

/* Notices / alertes (classes .notice) */
body.dark-mode .notice { border-color: #334155 !important; }
body.dark-mode .notice.success { background: #064e3b !important; color: #6ee7b7 !important; border-color: #065f46 !important; }
body.dark-mode .notice.error   { background: #450a0a !important; color: #fca5a5 !important; border-color: #7f1d1d !important; }
body.dark-mode .notice.warning { background: #451a03 !important; color: #fcd34d !important; border-color: #92400e !important; }
body.dark-mode .notice.info    { background: #1e3a5f !important; color: #93c5fd !important; border-color: #1e40af !important; }

/* Lignes colorées (bons transférés/originaux) */
body.dark-mode .bon-transfere { background: #0f2744 !important; border-left-color: #06b6d4 !important; }
body.dark-mode .bon-original  { background: #2d0a1e !important; border-left-color: #f472b6 !important; }

/* Boutons outline */
body.dark-mode .btn-outline {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
body.dark-mode .btn-outline:hover { border-color: #6366f1 !important; }

/* En-têtes de section (page-header conserve son dégradé coloré) */
body.dark-mode .page-header { box-shadow: 0 10px 40px rgba(79,70,229,.2) !important; }

/* Badges / chips */
body.dark-mode .chip {
  background: #2d1b4e !important;
  color: #c4b5fd !important;
  border-color: #4c1d95 !important;
}
body.dark-mode .qty {
  background: rgba(79,70,229,.25) !important;
  border-color: rgba(79,70,229,.4) !important;
}

/* Paiements — variables CSS dark déjà définies via html[data-theme='dark'] ✓ */
/* Les règles suivantes couvrent les éléments hardcodés restants */
body.dark-mode [style*="background: #fff !important"],
body.dark-mode [style*="background:#fff !important"] {
  background: #1e293b !important;
  color: #e2e8f0 !important;
}

/* Variables CSS pour une gestion cohérente */
:root {
  --primary-bg: linear-gradient(120deg, #223049 0%, #344060 100%);
  --card-bg: #2b3951;
  --table-bg: #082e80;
  --text-primary: #f1f5fb;
  --text-secondary: #e4edfa;
  --accent-color: #e3206f;
  --border-color: #38507c;
  --shadow-light: 0 8px 32px #18233b37;
  --shadow-heavy: 0 8px 48px #1d293c70;
  
  /* Tailles responsives */
  --font-base: clamp(14px, 2.5vw, 16px);
  --font-small: clamp(12px, 2vw, 14px);
  --font-large: clamp(16px, 3vw, 18px);
  --font-title: clamp(18px, 4vw, 24px);
  --font-header: clamp(24px, 5vw, 34px);
  
  --spacing-xs: clamp(4px, 1vw, 8px);
  --spacing-sm: clamp(8px, 2vw, 12px);
  --spacing-md: clamp(12px, 3vw, 18px);
  --spacing-lg: clamp(18px, 4vw, 24px);
  --spacing-xl: clamp(24px, 5vw, 32px);
  
  --border-radius: clamp(8px, 2vw, 15px);
  --border-radius-small: clamp(6px, 1.5vw, 11px);
}

/* Reset et base */
* { box-sizing: border-box; }

body {
  background: linear-gradient(120deg, #223049 0%, #344060 100%);
  background: var(--primary-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #041227;
  margin: 0;
  padding: 0;
  font-size: clamp(14px, 2.5vw, 16px);
  font-size: var(--font-base);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .fullscreen-table-title {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  line-height: 1.3;
}
h3 .fullscreen-table-title {
  font-family: 'Inter', Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0;
  padding: 0;
  line-height: 1.3;
}
.fullscreen-table-title {
  font-size: clamp(24px, 5vw, 34px);
  font-size: var(--font-header);
  font-weight: 800;
  color: #e4edfa;
  color: var(--text-secondary);
  padding: clamp(18px, 4vw, 24px) clamp(24px, 5vw, 32px) clamp(12px, 3vw, 18px) clamp(24px, 5vw, 32px);
  padding: var(--spacing-lg) var(--spacing-xl) var(--spacing-md) var(--spacing-xl);
  background: #2d3d56;
  filter: drop-shadow(0 30px 14px #1b253c38);
  margin-bottom: 0;
  text-align: left;
  border-bottom: 1.5px solid #384c69;
  word-break: break-word;
}

/* Container principal */
.fullscreen-table-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #223049;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Cards */
.paper-card, .MuiPaper-root {
  background: #2b3951;
  background: var(--card-bg);
  border-radius: clamp(8px, 2vw, 15px);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px #18233b37;
  box-shadow: var(--shadow-light);
  padding: clamp(18px, 4vw, 24px) clamp(12px, 3vw, 18px);
  padding: var(--spacing-lg) var(--spacing-md);
  margin: clamp(12px, 3vw, 18px) clamp(8px, 2vw, 12px) clamp(18px, 4vw, 24px) clamp(8px, 2vw, 12px);
  margin: var(--spacing-md) var(--spacing-sm) var(--spacing-lg) var(--spacing-sm);
  border: 1px solid #38507c;
  border: 1px solid var(--border-color);
  filter: drop-shadow(0 12px 8px #1d253f15);
  width: calc(100% - 2 * clamp(8px, 2vw, 12px));
  width: calc(100% - 2 * var(--spacing-sm));
  max-width: calc(100vw - 2 * clamp(8px, 2vw, 12px));
  max-width: calc(100vw - 2 * var(--spacing-sm));
}

/* Tableaux avec scroll horizontal optimisé */
.table-pro-full, .table-pro {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin: 0 clamp(12px, 3vw, 18px) clamp(18px, 4vw, 24px) clamp(12px, 3vw, 18px);
  margin: 0 var(--spacing-md) var(--spacing-lg) var(--spacing-md);
  border-radius: clamp(8px, 2vw, 15px);
  border-radius: var(--border-radius);
  background: #082e80;
  background: var(--table-bg);
  box-shadow: 0 8px 48px #1d293c70;
  box-shadow: var(--shadow-heavy);
  border: 1.5px solid #405a85;
  width: calc(100% - 2 * clamp(12px, 3vw, 18px));
  width: calc(100% - 2 * var(--spacing-md));
  max-width: calc(100vw - 2 * clamp(12px, 3vw, 18px));
  max-width: calc(100vw - 2 * var(--spacing-md));
}
.table-pro-full table, .table-pro table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: clamp(14px, 2.5vw, 16px);
  font-size: var(--font-base);
  min-width: 100%;
}

/* Headers sticky et responsive */
.table-pro-full thead th,
.table-pro thead th {
  position: sticky;
  top: 0;
  background: #1a2332;
  z-index: 3;
  font-size: clamp(16px, 3vw, 18px);
  font-size: var(--font-large);
  font-weight: 700;
  padding: clamp(12px, 3vw, 18px) clamp(4px, 1vw, 8px);
  padding: var(--spacing-md) var(--spacing-xs);
  color: #99b2d4;
  border-bottom: 2px solid #32486a;
  letter-spacing: 0.015em;
  text-shadow: 0 2px 10px #121b2d28;
  word-break: break-word;
  white-space: nowrap;
  min-width: 100px;
}

/* Body du tableau avec scroll */
.table-pro-full tbody,
.table-pro tbody {
  display: block;
  height: calc(100vh - 300px);
  min-height: 200px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #223049;
  width: 100%;
}
.table-pro-full thead,
.table-pro-full tbody tr,
.table-pro thead,
.table-pro tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.table-pro-full td,
.table-pro td {
  padding: clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px);
  padding: var(--spacing-sm) var(--spacing-xs);
  font-size: clamp(14px, 2.5vw, 16px);
  font-size: var(--font-base);
  border-bottom: 1px solid #dadee8;
  text-align: center;
  background: #0c1f41;
  color: #eff1f7;
  font-weight: 500;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.18s;
  word-break: break-word;
  min-width: 100px;
}
.table-pro-full tbody tr:hover td,
.table-pro tbody tr:hover td {
  background: #2e415c;
  color: #fff;
}

/* ===================== BOUTONS (longhands, pas de shorthand border) ===================== */
.btn,
.table-pro-full button,
.table-pro button,
button,
.btn-neumorph {
  min-width: clamp(80px, 15vw, 126px);
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px);
  padding: var(--spacing-sm) var(--spacing-md);
  margin: clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) 0;
  margin: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) 0;
  border-radius: clamp(6px, 1.5vw, 11px);
  border-radius: var(--border-radius-small);

  /* AVANT: border: none;  APRES: longhands cohérents */
  border-width: 0;
  border-style: solid;
  border-color: transparent;

  background: linear-gradient(90deg, #3272e0 50%, #61c7ef 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 13px #314e8830;
  font-size: clamp(14px, 2.5vw, 16px);
  font-size: var(--font-base);
  letter-spacing: 0.01em;
  transition: all 0.18s, filter 0.13s;
  filter: drop-shadow(0 2px 7px #1b243a99);
  font-family: 'Inter', Arial, sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.btn:hover,
.table-pro-full button:hover,
.table-pro button:hover,
button:hover,
.btn-neumorph:hover {
  background: linear-gradient(90deg, #61c7ef 10%, #3272e0 90%);
  color: #fff;
  font-weight: 800;
  filter: drop-shadow(0 2px 14px #3272e090);
  transform: translateY(-1px);
}

/* Variantes de boutons (laisser border en longhands si besoin d’un contour visible) */
.btn.danger, .btn-neumorph.danger, .table-pro-full button.danger {
  background: linear-gradient(90deg, #ee4e61 60%, #fddada 100%);
  color: #fff;
}
.btn.danger:hover, .btn-neumorph.danger:hover, .table-pro-full button.danger:hover {
  background: linear-gradient(90deg, #ee4e61 85%, #c94a4a 100%);
  color: #fff;
}
.btn.print, .btn-neumorph.print, .table-pro-full button.print {
  background: linear-gradient(90deg, #2bd2a6 60%, #6ee9df 100%);
  color: #fff;
}
.btn.print:hover, .btn-neumorph.print:hover, .table-pro-full button.print:hover {
  background: linear-gradient(90deg, #6ee9df 0%, #2bd2a6 100%);
  color: #fff;
}
.btn.info {
  background: linear-gradient(90deg, #61c7ef 40%, #3272e0 100%);
  color: #fff;
}
.btn.success {
  background: linear-gradient(90deg, #2bd2a6 40%, #6ee9df 100%);
  color: #fff;
}

/* ===== Style spécifique pour le bouton d’historique (évite tout conflit) ===== */
button[data-role="history-toggle"]{
  border-width: 1px;
  border-style: solid;
  border-color: #a5b4fc;
  background-color: #a5b4fc; /* pas de shorthand background, volontaire */
  color: #ffffff;
  font-weight: 900;
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(99,102,241,0.25);
  line-height: 1.1;
}
button[data-role="history-toggle"].is-open{
  border-color: #4f46e5;
  background-color: #4f46e5;
  box-shadow: 0 2px 10px rgba(79,70,229,0.35);
}

/* Formulaires responsive */
form {
  display: flex;
  gap: clamp(12px, 3vw, 18px);
  gap: var(--spacing-md);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: clamp(12px, 3vw, 18px);
  margin-bottom: var(--spacing-md);
  margin-top:3%;
}
input, select, textarea,
.MuiInputBase-root,
.MuiInputLabel-root,
.MuiSelect-select {
  border-radius: clamp(6px, 1.5vw, 11px) !important;
  border-radius: var(--border-radius-small) !important;
  font-family: 'Inter', Arial, sans-serif;
  font-size: clamp(14px, 2.5vw, 16px) !important;
  font-size: var(--font-base) !important;
  background: #3b3e41 !important;
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px) !important;
  padding: var(--spacing-sm) var(--spacing-md) !important;
  border: 1.2px solid #34518b !important;
  color: #cecde2 !important;
  margin-bottom: clamp(4px, 1vw, 8px) !important;
  margin-bottom: var(--spacing-xs) !important;
  box-shadow: 0 2px 8px #23376b1b;
  outline: none !important;
  transition: border-color 0.12s, background-color 0.12s;
  width: clamp(120px, 25vw, 200px);
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: #56b8e9 !important;
  background: #dfe1e7 !important;
  color: #110e16 !important;
}
.w-full { width: 100% !important; }

/* Classes utilitaires responsive */
label {
  font-size: clamp(12px, 2vw, 14px);
  font-size: var(--font-small);
  font-weight: 600;
  color: #b5c9e4;
  margin-bottom: clamp(4px, 1vw, 8px);
  margin-bottom: var(--spacing-xs);
  display: block;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 8px; height: 8px; background: #1a2535; }
::-webkit-scrollbar-thumb { background: #466294; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #5a7ab0; }
::-webkit-scrollbar-corner { background: #1a2535; }

/* Status chips */
.status-chip, .MuiChip-root {
  padding: clamp(4px, 1vw, 8px) clamp(12px, 3vw, 18px);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: clamp(6px, 1.5vw, 11px);
  border-radius: var(--border-radius-small);
  font-weight: 700;
  font-size: clamp(12px, 2vw, 14px);
  font-size: var(--font-small);
  background: linear-gradient(90deg,#273c54 60%,#2c4567 100%);
  color: #a6e4ee;
  margin: clamp(4px, 1vw, 8px) 0;
  margin: var(--spacing-xs) 0;
  border: 1px solid #2bd2a6;
  display: inline-block;
  white-space: nowrap;
}
.status-chip.danger {
  background: linear-gradient(90deg,#ee4e61 40%,#fcdada 100%);
  color: #fff;
  border: 1px solid #ee4e61;
}
.status-chip.success {
  background: linear-gradient(90deg,#2bd2a6 40%,#6ee9df 100%);
  color: #233c29;
  border: 1px solid #2bd2a6;
}
.status-chip.info {
  background: linear-gradient(90deg,#61c7ef 40%,#3272e0 100%);
  color: #fff;
  border: 1px solid #61c7ef;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: clamp(12px, 3vw, 18px);
  padding: var(--spacing-md);
}

/* ===================== RESPONSIVE BREAKPOINTS ===================== */

/* Desktop Large (> 1400px) */
@media (min-width: 1400px) {
  :root { --font-base: 16px; --font-large: 18px; --font-header: 36px; }
  .table-pro-full tbody, .table-pro tbody { height: calc(100vh - 280px); }
}

/* Desktop (1024px - 1399px) */
@media (max-width: 1399px) and (min-width: 1024px) {
  .fullscreen-table-title { padding: clamp(12px, 3vw, 18px) clamp(18px, 4vw, 24px) clamp(8px, 2vw, 12px) clamp(18px, 4vw, 24px); padding: var(--spacing-md) var(--spacing-lg) var(--spacing-sm) var(--spacing-lg); }
  .table-pro-full, .table-pro {
    margin: 0 clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px) clamp(8px, 2vw, 12px);
    margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
    width: calc(100% - 2 * clamp(8px, 2vw, 12px));
    width: calc(100% - 2 * var(--spacing-sm));
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  :root { --spacing-md: 10px; --spacing-lg: 16px; --spacing-xl: 20px; }
  .fullscreen-table-title {
    font-size: clamp(20px, 4vw, 28px);
    padding: clamp(12px, 3vw, 18px) clamp(12px, 3vw, 18px) clamp(8px, 2vw, 12px) clamp(12px, 3vw, 18px);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm) var(--spacing-md);
  }
  .table-pro-full, .table-pro {
    margin: 0 clamp(4px, 1vw, 8px) clamp(12px, 3vw, 18px) clamp(4px, 1vw, 8px);
    margin: 0 var(--spacing-xs) var(--spacing-md) var(--spacing-xs);
    width: calc(100% - 2 * clamp(4px, 1vw, 8px));
    width: calc(100% - 2 * var(--spacing-xs));
    overflow-x: auto;
  }
  .table-pro-full table, .table-pro table { min-width: 800px; }
  .paper-card, .MuiPaper-root {
    margin: clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px) clamp(12px, 3vw, 18px) clamp(4px, 1vw, 8px);
    margin: var(--spacing-sm) var(--spacing-xs) var(--spacing-md) var(--spacing-xs);
    padding: clamp(12px, 3vw, 18px) clamp(8px, 2vw, 12px);
    padding: var(--spacing-md) var(--spacing-sm);
    width: calc(100% - 2 * clamp(4px, 1vw, 8px));
    width: calc(100% - 2 * var(--spacing-xs));
  }
  form { gap: clamp(8px, 2vw, 12px); gap: var(--spacing-sm); }
  .btn, .table-pro-full button, .table-pro button, button {
    min-width: clamp(70px, 12vw, 100px);
    padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: clamp(12px, 2vw, 14px);
    font-size: var(--font-small);
  }
}

/* Mobile Large (480px - 767px) */
@media (max-width: 767px) and (min-width: 480px) {
  :root {
    --spacing-xs: 6px; --spacing-sm: 8px; --spacing-md: 12px;
    --spacing-lg: 16px; --spacing-xl: 20px;
  }
  .fullscreen-table-title {
    font-size: clamp(18px, 5vw, 24px);
    padding: clamp(8px, 2vw, 12px) clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px);
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm);
  }
  .table-pro-full, .table-pro {
    margin: 0 clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px);
    margin: 0 var(--spacing-xs) var(--spacing-sm) var(--spacing-xs);
    width: calc(100% - 2 * clamp(4px, 1vw, 8px));
    width: calc(100% - 2 * var(--spacing-xs));
    overflow-x: auto;
    border-radius: 10px;
  }
  .table-pro-full table, .table-pro table { min-width: 700px; font-size: 14px; }
  .table-pro-full thead th, .table-pro thead th {
    padding: clamp(4px, 1vw, 8px) 4px;
    padding: var(--spacing-xs) 4px; font-size: 13px; min-width: 80px;
  }
  .table-pro-full td, .table-pro td {
    padding: clamp(4px, 1vw, 8px) 4px;
    padding: var(--spacing-xs) 4px; font-size: 13px; min-width: 80px;
  }
  .table-pro-full tbody, .table-pro tbody {
    height: calc(100vh - 320px); min-height: 180px;
  }
  .paper-card, .MuiPaper-root {
    margin: clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px);
    margin: var(--spacing-xs) var(--spacing-xs) var(--spacing-sm) var(--spacing-xs);
    padding: clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px);
    padding: var(--spacing-sm) var(--spacing-xs);
    width: calc(100% - 2 * clamp(4px, 1vw, 8px));
    width: calc(100% - 2 * var(--spacing-xs));
    border-radius: 10px;
  }
  form { gap: clamp(4px, 1vw, 8px); gap: var(--spacing-xs); }
  input, select, textarea {
    width: clamp(100px, 30vw, 150px) !important;
    padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px) !important;
    padding: var(--spacing-xs) var(--spacing-sm) !important;
    font-size: 14px !important;
  }

  .css-1ygil4i-MuiToolbar-root{ flex-direction: column; }
  .css-awgou1 {
    position: relative; display: flex; align-items: center;
    padding-left: 16px; padding-right: 16px; min-height: 56px; flex-direction: column;
  }
}

/* Mobile Small (< 480px) */
@media (max-width: 479px) {
  :root {
    --spacing-xs: 4px; --spacing-sm: 6px; --spacing-md: 8px;
    --spacing-lg: 12px; --spacing-xl: 16px;
    --font-base: 13px; --font-small: 11px; --font-large: 14px;
    --border-radius: 8px; --border-radius-small: 6px;
  }
  body { overflow-x: hidden; }
  .fullscreen-table-wrap { padding: 0; overflow-x: hidden; }
  .fullscreen-table-title {
    font-size: clamp(16px, 6vw, 20px);
    padding: clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px);
    padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-xs);
    word-break: break-word; -webkit-hyphens: auto; hyphens: auto;
  }
  .table-pro-full, .table-pro {
    margin: 0 2px clamp(4px, 1vw, 8px) 2px;
    margin: 0 2px var(--spacing-xs) 2px;
    width: calc(100vw - 4px);
    overflow-x: auto;
    border-radius: 6px;
  }
  .table-pro-full table, .table-pro table { min-width: 600px; font-size: 12px; }
  .table-pro-full thead th, .table-pro thead th {
    padding: clamp(4px, 1vw, 8px) 2px;
    padding: var(--spacing-xs) 2px; font-size: 11px; min-width: 70px; white-space: nowrap;
  }
  .table-pro-full td, .table-pro td {
    padding: clamp(4px, 1vw, 8px) 2px;
    padding: var(--spacing-xs) 2px; font-size: 11px; min-width: 70px;
  }
  .table-pro-full tbody, .table-pro tbody {
    height: calc(100vh - 300px); min-height: 150px;
  }
  .paper-card, .MuiPaper-root {
    margin: clamp(4px, 1vw, 8px) 2px clamp(4px, 1vw, 8px) 2px;
    margin: var(--spacing-xs) 2px var(--spacing-xs) 2px;
    padding: clamp(4px, 1vw, 8px) 4px;
    padding: var(--spacing-xs) 4px;
    width: calc(100vw - 4px);
    border-radius: 6px;
  }
  form { gap: 4px; flex-direction: column; align-items: stretch; }
  form > div { width: 100%; }
  input, select, textarea {
    width: 100% !important; max-width: none !important;
    padding: clamp(4px, 1vw, 8px) clamp(4px, 1vw, 8px) !important;
    padding: var(--spacing-xs) var(--spacing-xs) !important;
    font-size: 13px !important; margin-bottom: 4px !important;
  }
  .btn, .table-pro-full button, .table-pro button, button {
    min-width: 50px; padding: 4px 6px; font-size: 11px; margin: 1px; border-radius: 4px;
  }
  .status-chip { font-size: 10px; padding: 2px 6px; }
  .table-pro-full td:last-child, .table-pro td:last-child { min-width: 120px; }

  .table-pro-full::-webkit-scrollbar, .table-pro::-webkit-scrollbar { height: 6px; }
  .table-pro-full::-webkit-scrollbar-thumb, .table-pro::-webkit-scrollbar-thumb {
    background: #466294; border-radius: 3px;
  }

  .css-1ygil4i-MuiToolbar-root{ flex-direction: column; }
  .css-awgou1 {
    position: relative; display: flex; align-items: center;
    padding-left: 16px; padding-right: 16px; min-height: 56px; flex-direction: column;
  }
}

/* Très petit mobile (< 320px) */
@media (max-width: 319px) {
  .fullscreen-table-title { font-size: 14px; padding: 2px; }
  .table-pro-full table, .table-pro table { min-width: 500px; font-size: 11px; }
  .btn, .table-pro-full button, .table-pro button, button {
    font-size: 10px; padding: 2px 4px; min-width: 40px;
  }
}

/* Amélioration pour les écrans tactiles */
@media (hover: none) and (pointer: coarse) {
  .btn, .table-pro-full button, .table-pro button, button {
    min-height: 44px; min-width: 44px;
  }
  input, select, textarea { min-height: 44px !important; }
  .table-pro-full td, .table-pro td { min-height: 40px; }
}

/* Mode paysage sur mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .table-pro-full tbody, .table-pro tbody { height: calc(100vh - 200px); min-height: 120px; }
  .fullscreen-table-title { padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px) clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px); padding: var(--spacing-xs) var(--spacing-sm) var(--spacing-xs) var(--spacing-sm); }
}

/* Animation et transitions */
@media (prefers-reduced-motion: no-preference) {
  .btn, .table-pro-full button, .table-pro button, button { transition: all 0.2s ease-in-out; }
  .table-pro-full td, .table-pro td { transition: background-color 0.15s ease-in-out; }
  .paper-card, .MuiPaper-root { transition: box-shadow 0.2s ease-in-out; }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .fullscreen-table-title,
  .table-pro-full thead th,
  .table-pro thead th {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

.field{ background: #1c0454; }

/* Empêche la sélection et le drag globalement */
html, body, #root { -webkit-user-select: none; user-select: none; }
img, a, svg { -webkit-user-drag: none; user-drag: none; }

/* MAIS réactive la sélection dans les champs de saisie */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text !important;
  user-select: text !important;
}

/* BackToTop floating button */
.backtotop{
  position: fixed; right: 16px; bottom: 16px;
  width: 46px; height: 46px; border-radius: 999px;
  border: 0; cursor: pointer; z-index: 9999;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff; font-weight: 900; font-size: 20px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  display: grid; place-items: center;
  opacity: 0; transform: translateY(12px) scale(.9);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}
.backtotop:hover{ box-shadow: 0 22px 50px rgba(0,0,0,.3); }
.backtotop:active{ transform: translateY(12px) scale(.88); }
.backtotop.show{ opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
@media (max-width: 768px){
  .backtotop{ right: 12px; bottom: 12px; width: 44px; height: 44px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce){ .backtotop{ transition: none; } }


/*# sourceMappingURL=main.48b18018.css.map*/