@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; }

/* 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.0e5f724a.css.map*/