/* ============================================================
   anett.css — Feuille de style principale (Anett Maroc)
   Architecture : Variables → Reset → Layout → Sidebar → Header
                  → Composants → Tableaux → Modules Spécifiques
                  → Login → Utilitaires → Responsive
   Logic : Styles extraits et synchronisés avec les wireframes.
   ============================================================ */

/* ──────────────────────────────────────────────────────────
   1. VARIABLES CSS (Design Tokens)
   ────────────────────────────────────────────────────────── */
:root {
  --background: #f7f9fb;
  --foreground: #0f1724;
  --border: #00000023;
  --input: #ffffff;
  --primary: #88b754;
  --primary-foreground: #ffffff;
  --secondary: #f2b860;
  --secondary-foreground: #003a6a;
  --muted: #f1f5f9;
  --muted-foreground: #6b7280;
  --success: #80b296;
  --success-foreground: #ffffff;
  --accent: #9bc5de;
  --accent-foreground: #1f2937;
  --destructive: #dc2626;
  --destructive-foreground: #ffffff;
  --warning: #f97316;
  --warning-foreground: #1f2937;
  --card: #ffffff;
  --card-foreground: #0f1724;
  --sidebar: #ffffff;
  --sidebar-foreground: #0f1724;
  --sidebar-primary: #0078d4;
  --sidebar-primary-foreground: #ffffff;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --font-family-body: 'DM Sans', 'Inter', -apple-system, sans-serif;
  --sidebar-width: 84px;
  --header-height: 72px;
}

/* ──────────────────────────────────────────────────────────
   2. RESET & BASE
   ────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: var(--font-family-body);
  font-size: 14px;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  font-family: inherit;
  cursor: pointer;
}

/* ──────────────────────────────────────────────────────────
   3. LAYOUT PRINCIPAL
   ────────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--background);
  overflow: hidden;
}

/* ──────────────────────────────────────────────────────────
   4. SIDEBAR — menu.html
   ────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.25s ease;
}

.sidebar-top {
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-frame {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.nav-item {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-lg);
  color: var(--sidebar-foreground);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.18s ease, color 0.18s ease;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--muted);
}

.nav-item.active {
  background: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
}

.nav-item iconify-icon {
  font-size: 32px;
  pointer-events: none;
  stroke-width: 2.8px;
}

.nav-item>div {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-hint {
  position: absolute;
  left: calc(var(--sidebar-width) + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item:hover .nav-hint {
  opacity: 1;
}

.sidebar-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--foreground);
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
}

/* ──────────────────────────────────────────────────────────
   5. CONTENU PRINCIPAL
   ────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 32px;
}

/* ──────────────────────────────────────────────────────────
   6. EN-TÊTE — header.html
   ────────────────────────────────────────────────────────── */
.top-bar {
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 24px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 80;
}

.page-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.page-title-wrap h1 {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.page-subtitle {
  font-size: 14px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-user-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-user-name {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ──────────────────────────────────────────────────────────
   7. BOUTONS & INPUTS
   ────────────────────────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 16px;
  min-height: 40px;
  width: 280px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(136, 183, 84, 0.2);
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--foreground);
  width: 100%;
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn:hover,
.button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active,
.button:active {
  transform: translateY(0);
}

.btn-primary,
.button-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-outline,
.button-outline {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.icon-btn {
  width: 40px;
  padding: 0;
}

/* ──────────────────────────────────────────────────────────
   8. CARTES MÉTRIQUES
   ────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

/* Dashboard : 5 cartes métriques (dont "Alertes de stock") */
#metrics-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-card {
  min-height: 156px;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.metric-card.primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.metric-card.accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.metric-card.success {
  background: var(--success);
  color: var(--success-foreground);
}

.metric-card.soft {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--success);
}

.metric-card.danger {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

/* ──────────────────────────────────────────────────────────
   9. PANNEAU GÉNÉRIQUE
   ────────────────────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────
   10. TABLEAU DES COMMANDES
   ────────────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th {
  text-align: left;
  padding: 16px 24px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.orders-table td {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.orders-table tbody tr {
  transition: background 0.12s ease;
}

.orders-table tbody tr:hover {
  background: var(--muted);
}

.order-link {
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
  font-weight: 500;
}

.order-link:hover {
  color: var(--primary);
}

.client-cell {
  min-width: 200px;
}

.client-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.client-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 13px;
  white-space: nowrap;
}

.type-cell,
.status-cell,
.actions-cell {
  white-space: nowrap;
}

.type-badge {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.type-badge.clean {
  background: var(--success);
  color: var(--success-foreground);
}

.type-badge.dirty {
  background: var(--warning);
  color: var(--warning-foreground);
}

.type-badge>div {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-badge iconify-icon {
  font-size: 24px;
  stroke-width: 2.4px;
}

/* ──────────────────────────────────────────────────────────
   11. MENU DÉROULANT DE STATUT
   ────────────────────────────────────────────────────────── */
.status-select {
  min-width: 150px;
  padding: 7px 30px 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: opacity 0.15s ease;
}

.status-select:hover {
  opacity: 0.85;
}

.status-select.status-expedition {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.status-select.status-ramassage {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.status-select.status-retards {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.status-select.status-alert {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

/* ──────────────────────────────────────────────────────────
   12. ACTIONS — icônes cliquables
   ────────────────────────────────────────────────────────── */
.actions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-foreground);
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.action-btn:hover {
  background: var(--muted);
  transform: scale(1.12);
}

.action-btn.action-view:hover {
  color: var(--accent-foreground);
}

.action-btn.action-edit:hover {
  color: var(--primary);
}

.action-btn.action-delete:hover {
  color: var(--destructive);
}

.action-btn iconify-icon {
  font-size: 32px;
  pointer-events: none;
  stroke-width: 2.4px;
}

.action-btn.disabled,
.action-btn[disabled],
.action-mini-btn.disabled,
.action-mini-btn[disabled],
.action-mini.disabled,
.action-mini[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────
   13. TOAST
   ────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  animation: toastIn 0.25s ease forwards;
  pointer-events: auto;
  max-width: 320px;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ──────────────────────────────────────────────────────────
   14. UTILITAIRES
   ────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--sidebar-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ──────────────────────────────────────────────────────────
   15. RESPONSIVE — Tablette (768px – 1279px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 1279px) and (min-width: 768px) {
  :root {
    --sidebar-width: 72px;
  }

  .scroll-area {
    padding: 20px 20px 28px;
  }

  .top-bar {
    padding: 0 20px;
    gap: 12px;
  }

  .metrics-grid,
  #metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }

  .header-user-name {
    display: none;
  }

  .orders-table th,
  .orders-table td {
    padding: 14px 16px;
  }

  .col-articles {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────
   16. RESPONSIVE — Mobile (< 768px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Sidebar : drawer coulissant */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 200;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .sidebar-nav {
    align-items: flex-start;
    padding: 20px 16px;
  }

  .nav-item {
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    justify-content: flex-start;
    gap: 14px;
    padding: 0 12px;
  }

  .nav-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
  }

  .nav-hint {
    display: none;
  }

  .sidebar-toggle {
    display: flex;
  }

  .top-bar {
    padding: 0 16px;
    gap: 8px;
  }

  .btn-search-text {
    display: none;
  }

  .search-box {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .search-box:focus-within {
    width: calc(100vw - 180px);
    position: absolute;
    left: 16px;
    background: var(--card);
    z-index: 100;
    justify-content: flex-start;
    padding: 0 12px;
  }

  .search-input {
    display: none;
  }

  .search-box:focus-within .search-input {
    display: block;
  }

  .header-user-name {
    display: none;
  }

  .metrics-grid,
  #metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }

  .metric-card {
    min-height: 120px;
    padding: 18px;
  }

  .scroll-area {
    padding: 16px;
  }

  .col-date,
  .col-articles {
    display: none;
  }

  .orders-table th,
  .orders-table td {
    padding: 12px 12px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 13px;
    padding: 0 10px;
  }

  .status-select {
    min-width: 120px;
    font-size: 11px;
    padding: 5px 26px 5px 10px;
  }
}

/* ──────────────────────────────────────────────────────────
   17. PAGINATION & ÉTATS VIDES
   ────────────────────────────────────────────────────────── */
.pagination,
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  background: var(--card);
  border-top: 1px solid var(--border);
  gap: 24px;
}

.pagination-container {
  justify-content: flex-end;
}

/* Mode dashboard */

.pagination-info {
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--foreground);
  background: var(--card);
  transition: all 0.18s ease;
  user-select: none;
}

.page-btn:hover {
  background: var(--muted);
  border-color: var(--muted-foreground);
}

.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-num:hover {
  background: var(--muted);
  color: var(--foreground);
}

.page-num.active {
  background: var(--sidebar-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
}

.empty-state iconify-icon {
  font-size: 48px;
  color: var(--muted-foreground);
  opacity: 0.5;
  margin-bottom: 16px;
}

/* ──────────────────────────────────────────────────────────
   18. STYLES SPÉCIFIQUES EXPÉDITIONS (Ajout depuis wireframe)
   ────────────────────────────────────────────────────────── */

/* Barre de filtres */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.filter-select {
  min-height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--foreground);
  white-space: nowrap;
  min-width: 150px;
  justify-content: space-between;
  cursor: pointer;
}

.filters-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.inline-filters-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

#orders-filters {
  width: 100%;
}

#orders-filter-row {
  width: 100%;
}

#orders-filter-row .search-input {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#orders-filter-row .filter-select {
  flex: 0 0 auto;
}

#orders-filter-row .btn {
  flex: 0 0 auto;
}

/* Entête de tableau spécifique */
.table-panel-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.table-panel-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

/* Badges et alertes supplémentaires */
.type-badge>div {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.type-badge>iconify-icon,
.type-badge>div>iconify-icon {
  font-size: 24px;
  stroke-width: 2.4px;
  color: inherit;
}

.alert-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--destructive);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  color: var(--destructive-foreground);
}

/* Contrôle de statut (Expéditions) */
.status-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.status-new {
  background: var(--muted);
  color: var(--foreground);
}

.status-to-deliver {
  background: var(--primary);
  color: var(--primary-foreground);
}

.status-ramassage {
  background: var(--accent);
  color: var(--accent-foreground);
}

.status-retards {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

/* Actions cellulaires & Mini boutons */
.orders-table td:last-child .actions-cell,
.orders-table td:last-child .actions-row,
.orders-table td:last-child .line-actions {
  justify-content: flex-start;
}

.actions-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.actions-row>div {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease;
}

.actions-row>div>iconify-icon {
  font-size: 30px;
  stroke-width: 2.4px;
}

.line-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.action-mini-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.action-mini-btn:hover {
  background: var(--muted);
}

.action-mini-btn>div {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-mini-btn iconify-icon,
.action-mini-btn>div>iconify-icon {
  font-size: 18px;
  stroke-width: 2.2px;
}

/* ──────────────────────────────────────────────────────────
   19. STYLES PAGE DE CONNEXION (Login)
   ────────────────────────────────────────────────────────── */
.login-body {
  background: #c8d4dc;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('/anett-maroc/public/assets/img/laundromat-bg.jpg') center center / cover no-repeat;
}

.login-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
}

.login-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--sidebar-primary);
}

.btn-signin {
  width: 100%;
  padding: 16px;
  font-weight: 600;
  font-size: 16px;
  margin-top: 10px;
}

/* ──────────────────────────────────────────────────────────
   20. UTILITAIRES FINAUX
   ────────────────────────────────────────────────────────── */
.text-current {
  color: currentColor;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

/* ──────────────────────────────────────────────────────────
   17. PAGE DE CONNEXION (LOGIN)
   ────────────────────────────────────────────────────────── */
.login-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 48px 24px;
}

.login-background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.login-background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}

.login-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--background) 62%, transparent);
}

.login-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.login-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8px;
}

.login-logo {
  width: 132px;
  height: auto;
  display: block;
}

.login-card {
  width: 100%;
  max-width: 372px;
  background-color: color-mix(in srgb, var(--card) 92%, transparent);
  color: var(--card-foreground);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 16px 40px rgba(15, 23, 36, 0.12);
  border: 1px solid var(--border);
}

.login-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.login-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--card-foreground);
}

.login-card-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.login-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.login-input {
  min-height: 42px;
  width: 100%;
  padding: 0 14px;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(136, 183, 84, 0.15);
}

.login-input::placeholder {
  color: var(--muted-foreground);
}

.login-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-remember-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.login-checkbox {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--card);
  flex-shrink: 0;
  cursor: pointer;
}

.login-forgot-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.login-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.login-footer {
  font-size: 12px;
  color: color-mix(in srgb, var(--foreground) 45%, white);
  text-align: center;
  white-space: nowrap;
}

.login-alert {
  padding: 10px 14px;
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* ──────────────────────────────────────────────────────────
   17. NEW EXPEDITION - order-styles
   ────────────────────────────────────────────────────────── */
.order-meta-top {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  flex-shrink: 0;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.meta-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.meta-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.meta-value {
  font-size: 14px;
  display: flex;
  align-items: center;
  color: var(--foreground);
  white-space: nowrap;
}

.client-code-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--input);
  cursor: default;
}

.catalog-panel {
  flex: 1;
  padding: 24px;
  background: var(--background);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.catalog-filter {
  font-size: 13px;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.catalog-table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}

.catalog-table {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.catalog-table-header-row,
.catalog-table-row {
  display: grid;
  grid-template-columns: 0.85fr 1.9fr 0.95fr 0.95fr 0.9fr 1.15fr 1.1fr;
  gap: 8px;
  align-items: center;
}

.catalog-table-header-row {
  background: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.catalog-table-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  background: var(--card);
}

.catalog-col,
.catalog-cell,
.order-items-col,
.order-items-cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-col-actions,
.catalog-cell.catalog-col-actions,
.order-items-col-actions,
.order-items-cell.order-items-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.qty-field,
.add-row-btn,
.remove-item {
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.qty-field {
  min-width: 68px;
  height: 40px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  background: var(--input);
}

.add-row-btn {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  padding: 6px 10px;
}

.order-summary {
  width: 480px;
  background: var(--card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.summary-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-title {
  font-size: 16px;
  font-weight: 600;
}

.summary-count {
  font-size: 12px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.order-items-table-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px 0;
}

.order-items-table {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.order-items-header-row,
.order-items-row {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 0.6fr;
  gap: 8px;
  align-items: center;
}

.order-items-header-row {
  background: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.order-items-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.order-items-row-placeholder {
  grid-template-columns: 1fr;
  color: var(--muted-foreground);
  font-style: italic;
}

.remove-item {
  width: 40px;
  height: 40px;
  color: var(--muted-foreground);
  border: 4px solid var(--border);
  background: transparent;
}

.remove-item iconify-icon {
  font-size: 20px;
}

.summary-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.total-val {
  font-size: 16px;
}

.helper-copy {
  font-size: 12px;
  color: var(--muted-foreground);
}

.footer-actions {
  display: flex;
  gap: 8px;
}

.footer-actions .btn-secondary,
.footer-actions .submit-btn {
  flex: 1;
}

.delivery-number-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.delivery-number-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.delivery-number-field {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────
   18. NEW EXPEDITION - missing layout styles
   ────────────────────────────────────────────────────────── */
.content-scroll {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.btn-secondary {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.btn-secondary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.submit-btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.12s ease;
}

.submit-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────
   19. NEW RAMASSAGE - additional items
   ────────────────────────────────────────────────────────── */
.pickup-number-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.pickup-number-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.pickup-number-field {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────
   20. CONSULTATION EXPEDITION
   ────────────────────────────────────────────────────────── */
.consult-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.consult-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: nowrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.meta-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.meta-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

.client-meta {
  min-width: 170px;
}

.type-meta {
  align-items: flex-start;
}

.status-and-alert {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.consult-section {
  padding: 24px;
}

#consult-summary-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--muted);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.summary-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}

#consult-lines-panel {
  margin: 0 24px 24px;
}

#consult-lines-table th,
#consult-lines-table td {
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────
   21. AJUSTEMENT EXPEDITION
   ────────────────────────────────────────────────────────── */
#ajustement-app .catalog-table-header-row,
#ajustement-app .catalog-table-row {
  grid-template-columns: 0.85fr 1.9fr 0.95fr 0.95fr 0.9fr 1.15fr 1.1fr;
}

#ajustement-app .catalog-col-contract,
#ajustement-app .catalog-cell.catalog-col-contract,
#ajustement-app .catalog-col-br,
#ajustement-app .catalog-cell.catalog-col-br,
#ajustement-app .catalog-col-client,
#ajustement-app .catalog-cell.catalog-col-client {
  display: block;
}

#ajustement-app .order-items-header-row,
#ajustement-app .order-items-row {
  grid-template-columns: 2.4fr 1fr 1fr 0.6fr;
}

@media (max-width: 1279px) and (min-width: 768px) {

  #ajustement-app .catalog-table-header-row,
  #ajustement-app .catalog-table-row {
    grid-template-columns: 0.85fr 1.9fr 0.95fr 0.9fr 1.15fr 1.1fr;
  }
}

@media (max-width: 767px) {

  #ajustement-app .catalog-col-contract,
  #ajustement-app .catalog-cell.catalog-col-contract,
  #ajustement-app .catalog-col-br,
  #ajustement-app .catalog-cell.catalog-col-br,
  #ajustement-app .catalog-col-client,
  #ajustement-app .catalog-cell.catalog-col-client {
    display: none;
  }

  #ajustement-app .catalog-table-header-row,
  #ajustement-app .catalog-table-row {
    grid-template-columns: 0.85fr 1.9fr 1.15fr 1.1fr;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 14px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ──────────────────────────────────────────────────────────
   8. FORMULAIRE — Fiche client (main.html)
   ────────────────────────────────────────────────────────── */
.form-section {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* Champ de formulaire en lecture/écriture */
.field-box {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.field-box:hover {
  border-color: var(--muted-foreground);
}

.field-box.multiline {
  min-height: 88px;
  align-items: flex-start;
  padding-top: 14px;
  white-space: normal;
}

.placeholder {
  color: var(--muted-foreground);
}

/* Ligne de recherche : code client, bouton, nom, jour, contact */
.search-row {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 180px 180px;
  gap: 16px;
  align-items: end;
}

/* Surcharge spécifique à la ligne de recherche client */
#client-search-row {
  grid-template-columns: 280px 144px minmax(0, 1fr) 180px 180px;
}

#client-search-action-group {
  justify-content: flex-end;
}

#client-search-action-group .btn {
  width: 100%;
}

/* ──────────────────────────────────────────────────────────
   9. TABLEAU DES QUANTITÉS CONTRACTUELLES
   ────────────────────────────────────────────────────────── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.orders-table th {
  text-align: left;
  padding: 16px 24px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.orders-table td {
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.orders-table tbody tr {
  transition: background 0.12s ease;
}

.orders-table tbody tr:hover {
  background: var(--muted);
}

/* Colonnes première de chaque tableau */
#contract-table td:first-child,
#contract-table th:first-child,
#history-table td:first-child,
#history-table th:first-child {
  white-space: nowrap;
}

#contract-table td:nth-child(2) {
  min-width: 220px;
}

#history-table td:nth-child(3) {
  min-width: 280px;
}

/* Champ de quantité éditable dans le tableau */
.inline-input {
  min-width: 120px;
  max-width: 140px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--input);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  white-space: nowrap;
  cursor: text;
  transition: border-color 0.15s ease;
}

.inline-input:hover {
  border-color: var(--muted-foreground);
}

/* ──────────────────────────────────────────────────────────
   10. HISTORIQUE DES MODIFICATIONS
   ────────────────────────────────────────────────────────── */
.history-user {
  font-weight: 500;
}

.history-meta {
  color: var(--muted-foreground);
  white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────
   11. BADGE & BARRE D'ACTIONS
   ────────────────────────────────────────────────────────── */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

#save-client-btn {
  min-width: 160px;
}

/* ──────────────────────────────────────────────────────────
   12. RESPONSIVE — Tablette (768px – 1279px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 1279px) and (min-width: 768px) {

  .sidebar {
    width: 72px;
  }

  .nav-item {
    width: 54px;
    height: 54px;
  }

  .top-bar {
    padding: 0 20px;
    gap: 12px;
  }

  .scroll-area {
    padding: 20px;
  }

  .header-user-name {
    display: none;
  }

  /* Réduire la grille de recherche à 2 colonnes */
  #client-search-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 16px;
  }

  .orders-table th,
  .orders-table td {
    padding: 12px 16px;
  }
}

/* ──────────────────────────────────────────────────────────
   13. RESPONSIVE — Mobile (< 768px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-top {
    padding: 8px 12px;
    flex-direction: row;
  }

  .sidebar-nav {
    flex-direction: row;
    padding: 8px;
    justify-content: center;
    overflow-x: auto;
  }

  .nav-item {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .top-bar {
    height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-subtitle,
  .header-user-name {
    display: none;
  }

  .scroll-area {
    padding: 16px;
  }

  /* Formulaire en 1 colonne */
  .form-grid {
    grid-template-columns: 1fr;
  }

  #client-search-row {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .orders-table th,
  .orders-table td {
    padding: 10px 12px;
  }

  /* Masquer colonnes secondaires de l'historique */
  #history-table td:first-child,
  #history-table th:first-child {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────
   14. ACCESSIBILITÉ
   ────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--sidebar-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.search-input,
.filter-select {
  min-height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--foreground);
  white-space: nowrap;
}

.search-input {
  flex: 1;
  min-width: 0;
}

.filter-select {
  min-width: 150px;
  justify-content: space-between;
}

.inline-filters-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.filters-group {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

#orders-filters {
  width: 100%;
}

#orders-filter-row {
  width: 100%;
}

#orders-filter-row .search-input {
  flex: 1;
  min-width: 0;
}

#orders-filter-row .filter-select {
  flex: 0 0 auto;
}

#orders-filter-row .btn {
  flex: 0 0 auto;
}

.filter-list {
  min-width: 214px;
  height: auto;
  padding: 10px 14px;
  align-items: flex-start;
}

.filter-list-label {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-list-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}

.filter-option {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.filter-option.active {
  color: var(--foreground);
  font-weight: 500;
}

.status-dropdown {
  position: relative;
  min-width: 196px;
  height: 40px;
  padding: 0 14px;
  overflow: visible;
}

.status-dropdown-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}

.status-dropdown-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: -1px;
  width: calc(100% + 2px);
  min-width: calc(100% + 2px);
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 8;
  box-shadow: 0 8px 20px rgba(15, 23, 36, 0.06);
}

.status-dropdown-menu .filter-option {
  font-size: 13px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.status-dropdown-menu .filter-option.active {
  color: var(--foreground);
  font-weight: 500;
}

#status-filter {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

#orders-filter-group {
  overflow: visible;
}

#orders-filter-row {
  overflow: visible;
}

#orders-filters {
  overflow: visible;
}

.consult-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.consult-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: nowrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.meta-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.meta-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}

.client-meta {
  min-width: 170px;
}

.type-meta {
  align-items: flex-start;
}

.status-and-alert {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.consult-section {
  padding: 24px;
}

#consult-summary-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  background: var(--muted);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.summary-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}

#consult-lines-panel {
  margin: 0 24px 24px;
}

#consult-lines-table th,
#consult-lines-table td {
  white-space: nowrap;
}

#inline-alert-dot {
  margin: 0;
}

/* ── Styles des statuts (Consultation) ── */
.status-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-new {
  background: var(--muted);
  color: var(--foreground);
}

.status-to-deliver {
  background: var(--primary);
  color: var(--primary-foreground);
}

.status-ramassage {
  background: var(--accent);
  color: var(--accent-foreground);
}

.status-retards {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.search-input,
.filter-select {
  min-height: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--foreground);
  white-space: nowrap;
}

.search-input {
  flex: 1;
  min-width: 0;
}

.filter-select {
  min-width: 150px;
  justify-content: space-between;
}

.inline-filters-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}


/* ──────────────────────────────────────────────────────────
   23. MODAL DE CONFIRMATION
   ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 36, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 24px;
  color: #ef4444;
  background: #fee2e2;
  padding: 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-body p {
  margin: 0;
  font-size: 15px;
  color: var(--muted-foreground);
  line-height: 1.6;
}

.modal-footer {
  padding: 16px 24px 24px;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Validation visuelle des champs */
.error-field {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2) !important;
}

/* ---------- Alert Column ---------- */
.history-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.history-alert>div {
  width: 26px !important;
  height: 26px !important;
}

.history-alert iconify-icon {
  font-size: 26px !important;
}

.alert-good {
  color: var(--success);
}

.alert-bad {
  color: var(--destructive);
}

/* ---------- Actions Column ---------- */
.actions-row {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted-foreground);
}

.history-action {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  cursor: pointer;
}

.history-action iconify-icon {
  font-size: 32px !important;
  color: var(--muted-foreground);
}

/* ---------- Stock History Panel Overrides ---------- */
#stock-history-header {
  justify-content: flex-start;
  align-items: center;
}

#stock-history-actions {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

#stock-history-client,
#stock-history-date-start,
#stock-history-date-end,
#stock-history-export {
  align-self: flex-start;
}

#stock-history-table th:nth-child(1),
#stock-history-table td:nth-child(1),
#stock-history-table th:nth-child(2),
#stock-history-table td:nth-child(2),
#stock-history-table th:nth-child(3),
#stock-history-table td:nth-child(3),
#stock-history-table th:nth-child(4),
#stock-history-table td:nth-child(4),
#stock-history-table th:nth-child(6),
#stock-history-table td:nth-child(6),
#stock-history-table th:nth-child(7),
#stock-history-table td:nth-child(7),
#stock-history-table th:nth-child(8),
#stock-history-table td:nth-child(8),
#stock-history-table th:nth-child(9),
#stock-history-table td:nth-child(9) {
  white-space: nowrap;
}

#stock-history-panel .panel-header {
  border-bottom: 1px solid var(--border);
}

/* ---------- Pagination ---------- */
.history-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px 24px;
  border-top: 1px solid var(--border);
}

/* --- RAPPORT GLOBAL SPECIFIC --- */



/* --- RAPPORT GLOBAL SPECIFIC --- */
/* ──────────────────────────────────────────────────────────
   8. 5 CARTES DE SYNTHÈSE (KPI)
   ────────────────────────────────────────────────────────── */
.kpi5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.14s, box-shadow 0.14s;
}

.kc:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.kc-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.kc-ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kc-ico iconify-icon {
  font-size: 26px;
}

.kc-ico.g {
  background: var(--primary-light);
  color: var(--primary-d);
}

.kc-ico.b {
  background: var(--blue-light);
  color: var(--blue);
}

.kc-ico.a {
  background: var(--amber-light);
  color: #b45309;
}

.kc-ico.p {
  background: var(--purple-light);
  color: var(--purple);
}

.kc-ico.gr {
  background: var(--success-light);
  color: #065f46;
}

.kc-lbl { font-size: 14px; color: var(--mfg); margin-top: 4px; }
.kc-val { font-size: 32px; font-weight: 500; line-height: 1.1; color: var(--fg); }
.kc-val small { font-size: 14px; font-weight: 400; color: var(--mfg); }

.kc-trend {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-d);
}

.kc-conf {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--success-light);
  color: #065f46;
  font-size: 13px;
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────
   9. PANNEAUX GÉNÉRIQUES
   ────────────────────────────────────────────────────────── */
.pn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}

.ph {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pt { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.pt iconify-icon { font-size: 16px; color: var(--mfg); }
.ps { font-size: 13px; color: var(--mfg); margin-top: 2px; }

.pa {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pb {
  padding: 15px 18px;
}

/* Grilles de mise en page */
.g3 {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 13px;
  margin-bottom: 14px;
}

.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-bottom: 14px;
}

/* ──────────────────────────────────────────────────────────
   10. TABLEAUX
   ────────────────────────────────────────────────────────── */
.tw {
  width: 100%;
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--mfg);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tbl td {
  padding: 11px 15px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.tbl tr:hover td {
  background: #fafbfd;
}

.tbl tr.xt td {
  background: #fff8f8;
}

.cn {
  font-weight: 500;
}

/* ──────────────────────────────────────────────────────────
   11. PILLS DE STATUT
   ────────────────────────────────────────────────────────── */
.sp {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sg {
  background: var(--success-light);
  color: #065f46;
}

.sr {
  background: var(--danger-light);
  color: #991b1b;
}

.sa {
  background: var(--amber-light);
  color: #92400e;
}

.sgr {
  background: var(--muted);
  color: var(--mfg);
}

/* ──────────────────────────────────────────────────────────
   12. BARRES DE RÉPARTITION (secteur/type)
   ────────────────────────────────────────────────────────── */
.mbr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.mbl {
  font-size: 14px;
  width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.mbt {
  flex: 1;
  height: 7px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
}

.mbf {
  height: 100%;
  border-radius: 4px;
}

.mbv { font-size: 13px; font-weight: 600; width: 38px; text-align: right; flex-shrink: 0; color: var(--mfg); }

/* ──────────────────────────────────────────────────────────
   13. INVENTAIRE CONTRADICTOIRE — badges écart
   ────────────────────────────────────────────────────────── */
.bec    { padding: 2px 8px; border-radius: var(--r); font-size: 13px; font-weight: 600; }

.bec-ok {
  background: var(--success-light);
  color: #065f46;
}

.bec-ko {
  background: var(--danger-light);
  color: #991b1b;
}

/* ──────────────────────────────────────────────────────────
   14. MINI-CARTES STOCK
   ────────────────────────────────────────────────────────── */
.stock4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stk {
  background: var(--muted);
  border-radius: var(--r);
  padding: 11px;
  text-align: center;
}

.stk-v  { font-size: 24px; font-weight: 500; }
.stk-l  { font-size: 13px; color: var(--mfg); margin-top: 2px; }

/* ──────────────────────────────────────────────────────────
   15. PANNEAU D'ALERTES
   ────────────────────────────────────────────────────────── */
.alert-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r);
  margin-bottom: 7px;
}

.alert-row:last-child {
  margin-bottom: 0;
}

.ar-r {
  background: #fff8f8;
  border: 1px solid #fecaca;
}

.ar-a {
  background: #fffbf0;
  border: 1px solid #fde68a;
}

.ar-ico {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ──────────────────────────────────────────────────────────
   16. TOASTS
   ────────────────────────────────────────────────────────── */
#tc {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  pointer-events: auto;
  animation: tin .2s ease;
}

@keyframes tin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ──────────────────────────────────────────────────────────
   17. RESPONSIVE — Tablette (768px – 1279px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 1279px) and (min-width: 768px) {

  .kpi5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .g3 {
    grid-template-columns: 1fr 1fr;
  }

  .g3> :nth-child(3) {
    grid-column: span 2;
  }

  .hdr {
    padding: 0 16px;
    gap: 8px;
    flex-wrap: wrap;
    height: auto;
    min-height: var(--hdr-h);
  }

  .fsel {
    font-size: 11px;
  }

  .sc {
    padding: 16px;
  }

  .stock4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ──────────────────────────────────────────────────────────
   18. RESPONSIVE — Mobile (< 768px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  .shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .sb {
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 8px;
    overflow-x: auto;
  }

  .sb-logo {
    margin-bottom: 0;
    margin-right: 8px;
    flex-shrink: 0;
  }

  .sb-nav {
    flex-direction: row;
    flex: 0 0 auto;
  }

  .sb-bot {
    flex-direction: row;
    padding-bottom: 0;
    margin-left: 8px;
  }

  .ni-tip {
    display: none;
  }

  .hdr {
    height: auto;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
  }

  .hdr-sep {
    display: none;
    flex: 1 1 100%;
    height: 0;
  }

  .kpi5 {
    grid-template-columns: 1fr 1fr;
  }

  .g3,
  .g2 {
    grid-template-columns: 1fr;
  }

  .stock4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .sc {
    padding: 12px;
  }

  .mbl {
    width: 90px;
  }
}

/* ──────────────────────────────────────────────────────────
   19. ACCESSIBILITÉ
   ────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r);
}

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

/* --- MISSING STYLES (fsel, sec) --- */
.fsel {
  height: 32px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  background: var(--muted);
  color: var(--foreground);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 13px;
}

.sec {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sec iconify-icon {
  font-size: 14px;
}

/* --- MISSING VARIABLES FOR RAPPORT GLOBAL --- */
:root {
  --primary-d: #6a9640;
  --primary-light: #eef6e6;
  --blue: #3a7bd5;
  --blue-light: #ebf2fd;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
}

/* --- MISSING BASE VARIABLES FOR RAPPORT GLOBAL ALIASES --- */
:root {
  --fg: var(--foreground);
  --mfg: var(--muted-foreground);
  --r: var(--radius-md);
  --r-lg: var(--radius-lg);
}/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   11. ONGLETS (tabs) â€” Par client / Par famille / Alertes
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tabs-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.tab-btn {
  padding: 14px 20px; font-size: 14px; font-weight: 500;
  cursor: pointer; color: var(--muted-foreground);
  border: none; border-bottom: 2px solid transparent;
  background: transparent; transition: color 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover    { color: var(--foreground); }
.tab-btn.active   { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel        { display: none; }
.tab-panel.active { display: block; }

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   12. TABLEAU
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.table-wrap    { width: 100%; overflow-x: auto; }
.orders-table  { width: 100%; border-collapse: collapse; font-size: 14px; }

.orders-table th {
  text-align: left; padding: 14px 20px;
  background: var(--muted); color: var(--muted-foreground);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}

.orders-table th.r,
.orders-table td.r { text-align: right; }

.orders-table td {
  padding: 16px 20px; border-top: 1px solid var(--border);
  vertical-align: middle;
}

.orders-table tbody tr         { transition: background 0.12s ease; }
.orders-table tbody tr:hover   { background: var(--muted); }

/* Lien client cliquable */
.client-link {
  color: var(--primary); font-weight: 500;
  text-decoration: underline; cursor: pointer;
}
.client-link:hover { opacity: .8; }

/* Code article en monospace */
.code-mono {
  font-family: 'Courier New', monospace;
  font-size: 12px; color: var(--muted-foreground);
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   13. BADGES D'Ã‰TAT DU LINGE
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.state-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

.chip-ps    { background: #FFF8E1; color: #92600A; }  /* Propre/Sale  */
.chip-mab   { background: #E8EAF6; color: #3949AB; }  /* Mise Ã  blanc */
.chip-sale  { background: #FFEBEE; color: #B71C1C; }  /* Sale         */
.chip-ok    { background: #E8F5E9; color: #2E7D32; }  /* OK           */
.chip-alert { background: var(--destructive); color: #fff; }
.chip-warn  { background: var(--secondary); color: var(--secondary-foreground); }

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   14. BARRES DE PROGRESSION (taux de circulation)
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.progress-wrap  { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.progress-bar   { flex: 1; height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 999px; transition: width .3s; }
.fill-ok        { background: var(--success); }
.fill-warn      { background: var(--secondary); }
.fill-alert     { background: var(--destructive); }
.progress-label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); min-width: 36px; text-align: right; }

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   15. LIGNE D'ALERTE PERTE
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.row-alert        { background: #FFF5F5 !important; }
.row-alert:hover  { background: #FFEBEB !important; }

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   16. CARTES PAR FAMILLE D'ARTICLE
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.famille-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; padding: 24px;
}

.famille-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; background: var(--background);
}

.famille-title {
  font-size: 14px; font-weight: 600; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}

.famille-kpi  { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted-foreground); margin-bottom: 4px; }
.famille-val  { font-weight: 600; color: var(--foreground); }
.famille-ecart { font-size: 12px; font-weight: 600; margin-top: 10px; }
.ecart-ok     { color: var(--success); }
.ecart-warn   { color: var(--warning); }
.ecart-alert  { color: var(--destructive); }


/* STYLES SPECIFIQUES STOCKS - RECTIFICATION ONGLET ET FILTRES */
.stock-view .filters-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--muted); margin-bottom: 0; }
.stock-view .filter-select { height: 36px; padding: 0 28px 0 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); font-size: 13px; font-family: inherit; color: var(--foreground); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.stock-view .filter-input { height: 36px; padding: 0 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); font-size: 13px; font-family: inherit; min-width: 180px; }
.stock-view .filter-input:focus, .stock-view .filter-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.stock-view .tabs-bar { display: flex; gap: 0; border-bottom: 1px solid var(--border); background: var(--card); }
.stock-view .tab-btn { padding: 14px 20px; font-size: 14px; font-weight: 500; cursor: pointer; color: var(--muted-foreground); border: none; border-bottom: 2px solid transparent; background: transparent; transition: color 0.15s; margin-bottom: -1px; }
.stock-view .tab-btn:hover { color: var(--foreground); }
.stock-view .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.stock-view .tab-panel { display: none; }
.stock-view .tab-panel.active { display: block; }


/* Variables Utilisateurs */
:root {
  --r: 8px;
  --rl: 12px;
  --rs: 4px;
  --rm: 6px;
  --sw: 84px;
  --hh: 72px;
  --primary-fg: #ffffff;
  --secondary-fg: #003a6a;
  --success-fg: #fff;
  --accent-fg: #1f2937;
  --destructive-fg: #fff;
  --warning-fg: #1f2937;
}

/* ──────────────────────────────────────────────────────────
   9. CARTES KPI
   ────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  border-radius: var(--r);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
}

.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }

.kpi-card.c-primary { background: var(--primary);   color: var(--primary-fg); }
.kpi-card.c-accent  { background: var(--accent);    color: var(--accent-fg); }
.kpi-card.c-success { background: var(--success);   color: var(--success-fg); }
.kpi-card.c-soft    { background: var(--secondary); color: var(--secondary-fg); }

.kpi-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 500; }
.kpi-val  { font-size: 30px; font-weight: 700; line-height: 1; }
.kpi-sub  { font-size: 13px; opacity: 0.8; }

/* ──────────────────────────────────────────────────────────
   10. PANNEAU GÉNÉRIQUE
   ────────────────────────────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rl);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.panel-title { font-size: 16px; font-weight: 600; }

/* ──────────────────────────────────────────────────────────
   11. BARRE DE FILTRES
   ────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.f-input {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--rm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  min-width: 200px;
}

.f-select {
  height: 36px;
  padding: 0 28px 0 10px;
  border-radius: var(--rm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
}

.f-input:focus, .f-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ──────────────────────────────────────────────────────────
   12. TABLEAU UTILISATEURS
   ────────────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
  padding: 12px 20px;
  text-align: left;
  background: var(--muted);
  color: var(--muted-fg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

th.r, td.r { text-align: right; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--muted); }
td { padding: 14px 20px; vertical-align: middle; }

/* ──────────────────────────────────────────────────────────
   13. AVATARS UTILISATEURS
   ────────────────────────────────────────────────────────── */
.av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
}

.user-cell  { display: flex; align-items: center; gap: 12px; }
.user-info  { display: flex; flex-direction: column; }
.user-name2 { font-weight: 500; }
.user-code  { font-size: 12px; color: var(--muted-fg); font-family: monospace; }

/* ──────────────────────────────────────────────────────────
   14. BADGES PROFIL & STATUT
   ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.b-1 { background: #EEF2FF; color: #4338CA; }   /* Administrateur */
.b-2 { background: #FEF3C7; color: #92600A; }   /* Commercial     */
.b-3 { background: #DCFCE7; color: #166534; }   /* Production     */
.b-4 { background: #E0F2FE; color: #0369A1; }   /* Expédition     */
.b-5 { background: #FDF4FF; color: #7E22CE; }   /* Gestion        */
.b-6 { background: #FFF7ED; color: #C2410C; }   /* Client         */
.b-7 { background: #F1F5F9; color: #475569; }   /* Agent          */

.b-active   { background: #DCFCE7; color: #166534; }
.b-inactive { background: #FEF2F2; color: #991B1B; }

/* ──────────────────────────────────────────────────────────
   15. BOUTONS D'ACTIONS (par ligne)
   ────────────────────────────────────────────────────────── */
.actions { display: flex; align-items: center; gap: 6px; }

.act-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rm);
  border: none;
  background: transparent;
  color: var(--muted-fg);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.act-btn:hover             { background: var(--muted); transform: scale(1.1); }
.act-btn.view:hover        { color: var(--sidebar-primary); }
.act-btn.edit:hover        { color: var(--primary); }
.act-btn.del:hover         { color: var(--destructive); }
.act-btn iconify-icon      { font-size: 16px; pointer-events: none; }

/* ──────────────────────────────────────────────────────────
   16. PAGINATION
   ────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted-fg);
}

.page-btns { display: flex; gap: 4px; }

.page-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.page-btn:hover        { background: var(--muted); }
.page-btn.active       { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ──────────────────────────────────────────────────────────
   17. MODALE CRÉATION / MODIFICATION
   ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

.overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--rl);
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title  { font-size: 16px; font-weight: 600; }
.modal-body   { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Formulaire dans la modale */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--rm);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.form-input:focus,
.form-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

.form-hint { font-size: 12px; color: var(--muted-fg); }

/* ──────────────────────────────────────────────────────────
   18. TOAST
   ────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rm);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  animation: tin 0.25s ease forwards;
  pointer-events: auto;
  max-width: 320px;
}

@keyframes tin {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

/* ──────────────────────────────────────────────────────────
   19. ACCESSIBILITÉ
   ────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

:focus-visible { outline: 2px solid var(--sidebar-primary); outline-offset: 2px; border-radius: var(--rs); }

/* ──────────────────────────────────────────────────────────
   20. RESPONSIVE — Tablette (768px – 1279px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .topbar   { padding: 0 20px; }
  .scroll   { padding: 20px; }
  .page-sub { display: none; }
}

/* ──────────────────────────────────────────────────────────
   21. RESPONSIVE — Mobile (< 768px)
   ────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .shell         { flex-direction: column; }
  .sidebar       { width: 100%; height: auto; position: static; flex-direction: row; border-right: none; border-bottom: 1px solid var(--border); }
  .sb-top        { padding: 8px 12px; flex-direction: row; }
  .sb-nav        { flex-direction: row; padding: 8px; justify-content: center; overflow-x: auto; }
  .nav-item      { width: 44px; height: 44px; flex-shrink: 0; }
  .nav-hint      { display: none; }

  .topbar        { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .kpi-grid      { grid-template-columns: 1fr 1fr; gap: 12px; }
  .scroll        { padding: 16px; }
  .form-row      { grid-template-columns: 1fr; }
  .user-name     { display: none; }
}

/* ──────────────────────────────────────────────────────────
   Inventaire & Bascule — wizard
   ────────────────────────────────────────────────────────── */
.inv-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.52); z-index: 900; display: none; align-items: center; justify-content: center; padding: 20px; }
.inv-overlay.open { display: flex; }
.inv-wizard { background: var(--card); border-radius: var(--radius-xl); width: 820px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 28px 72px rgba(0,0,0,.22); overflow: hidden; }
.inv-wiz-header { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.inv-wiz-header.mode-mep { background: linear-gradient(135deg, #7a5209 0%, var(--secondary) 100%); }
.inv-wiz-header.mode-post { background: linear-gradient(135deg, #4c7a2a 0%, var(--primary) 100%); }
.inv-wiz-title { font-size: 15px; font-weight: 600; color: #fff; }
.inv-wiz-mode-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 700; margin-top: 4px; background: rgba(255,255,255,.2); color: #fff; }
.inv-wiz-close { width: 30px; height: 30px; border: none; background: rgba(255,255,255,.2); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; cursor: pointer; }
.inv-wiz-steps { display: flex; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--muted); }
.inv-step-item { display: flex; align-items: center; gap: 7px; flex: 1; }
.inv-step-item:last-child { flex: 0; }
.inv-step-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.inv-step-dot.done { background: var(--primary); color: #fff; }
.inv-step-dot.active-mep { background: var(--secondary); color: #fff; box-shadow: 0 0 0 3px #fef3c7; }
.inv-step-dot.active-post { background: var(--primary); color: #fff; box-shadow: 0 0 0 3px var(--primary-light); }
.inv-step-dot.todo { background: var(--border); color: var(--muted-foreground); }
.inv-step-lbl { font-size: 11.5px; font-weight: 500; white-space: nowrap; color: var(--muted-foreground); }
.inv-step-lbl.active { color: var(--foreground); font-weight: 600; }
.inv-step-lbl.done { color: var(--primary); }
.inv-step-line { flex: 1; height: 2px; background: var(--border); margin: 0 8px; }
.inv-step-line.done { background: var(--primary); }
.inv-wiz-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.inv-banner { border-radius: var(--radius-md); padding: 10px 13px; margin-bottom: 14px; font-size: 11.5px; }
.inv-banner.mep { background: #fef3c7; color: #7a5209; }
.inv-banner.post { background: var(--primary-light); color: #3d5c1f; }
.inv-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inv-tbl thead th { padding: 7px 10px; text-align: left; background: var(--muted); color: var(--muted-foreground); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.inv-tbl tbody tr { border-bottom: .5px solid var(--border); }
.inv-tbl td { padding: 8px 10px; }
.inv-qte-inp { width: 72px; height: 30px; padding: 0 6px; border-radius: var(--radius-md); border: 1.5px solid var(--primary); background: var(--primary-light); color: #3d5c1f; font-size: 12.5px; font-family: monospace; font-weight: 600; text-align: center; }
.inv-qte-inp.warn { border-color: var(--secondary); background: #fef3c7; }
.inv-ecart-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 700; font-family: monospace; }
.inv-ec-ok { background: var(--primary-light); color: #3d5c1f; }
.inv-ec-warn { background: #fef3c7; color: #7a5209; }
.inv-ec-err { background: var(--danger-light); color: var(--destructive); }
.inv-recap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 12px; }
.inv-recap-card { background: var(--muted); border-radius: var(--radius-md); padding: 11px 12px; }
.inv-recap-lbl { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 3px; }
.inv-recap-val { font-size: 16px; font-weight: 700; font-family: monospace; }
.inv-comment-box { width: 100%; min-height: 64px; padding: 9px 11px; border-radius: var(--radius-md); border: 1px solid var(--border); font-size: 12.5px; resize: vertical; font-family: inherit; }
.inv-confirm-block { border-radius: var(--radius-xl); padding: 18px; text-align: center; margin-bottom: 14px; }
.inv-confirm-block.mep { background: #fef3c7; }
.inv-confirm-block.post { background: var(--primary-light); }
.inv-confirm-icon { font-size: 38px; margin-bottom: 6px; }
.inv-confirm-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.inv-confirm-sub { font-size: 11.5px; color: var(--muted-foreground); }
.inv-checklist { list-style: none; display: flex; flex-direction: column; gap: 5px; padding: 0; margin: 0; }
.inv-checklist li { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; padding: 7px 11px; background: var(--card); border-radius: var(--radius-md); border: .5px solid var(--border); line-height: 1.4; }
.inv-checklist code { background: var(--muted); padding: 1px 5px; border-radius: 4px; font-family: monospace; font-size: 10.5px; }
.inv-warn-box { margin-top: 12px; padding: 9px 13px; background: var(--danger-light); border-radius: var(--radius-md); font-size: 11.5px; color: var(--destructive); }
.inv-wiz-footer { padding: 13px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; background: var(--muted); }
.inv-wiz-info { font-size: 11.5px; color: var(--muted-foreground); }

/* Modal motif obligatoire (changement quantité contractuelle) */
.motif-row { margin-bottom: 12px; padding: 10px 12px; background: var(--muted); border-radius: var(--radius-md); }
.motif-row-title { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.motif-row-code { color: var(--muted-foreground); font-weight: 400; }
.motif-row-delta { font-size: 12px; color: var(--muted-foreground); margin-bottom: 6px; font-family: monospace; }
.motif-input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12.5px; font-family: inherit; box-sizing: border-box; background: var(--card); color: inherit; }
.motif-input:focus { outline: none; border-color: var(--primary); }
#motif-error { color: var(--destructive); }

/* ── Notifications (cloche + panneau + historique) ── */
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: -6px; right: -6px; background: var(--destructive); color: #fff; font-size: 10px; font-weight: 600; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }
.notif-badge.hidden { display: none; }

.notif-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0,0,0,.14); overflow: hidden; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .16s ease, transform .16s ease; z-index: 300; }
.notif-panel.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.notif-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.notif-hdr-title { font-size: 14px; font-weight: 600; }
.notif-mark-actions { display: flex; align-items: center; gap: 6px; }
.notif-mark-all { font-size: 12px; color: var(--sidebar-primary); font-weight: 500; cursor: pointer; background: none; border: none; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-mark-sep { font-size: 12px; color: var(--border); }

.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--muted); cursor: pointer; transition: background .12s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--muted); }
.notif-item.unread { background: #f7fbf2; }
.notif-item.unread:hover { background: #f0f7e8; }
.notif-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.notif-icon iconify-icon { font-size: 16px; }
.notif-icon.success { background: #d1fae5; color: #0d7a53; }
.notif-icon.warning { background: #fef3c7; color: #b45309; }
.notif-icon.danger { background: #fee2e2; color: #b91c1c; }
.notif-icon.info { background: #ebf2fd; color: #1d4ed8; }
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; line-height: 1.45; color: var(--foreground); }
.notif-meta { font-size: 11px; color: var(--muted-foreground); margin-top: 3px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 5px; }

.notif-empty { padding: 48px 20px; text-align: center; color: var(--muted-foreground); }
.notif-empty iconify-icon { font-size: 30px; margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; color: var(--border); }
.notif-empty p { font-size: 13px; }

.notif-footer { padding: 11px 18px; text-align: center; border-top: 1px solid var(--border); }
.notif-footer a { font-size: 12px; color: var(--sidebar-primary); font-weight: 500; }
.notif-footer a:hover { text-decoration: underline; }

.hist-summary { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.hist-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.hist-chip .n { font-weight: 700; }
.hist-chip.c-success .n { color: #0d7a53; }
.hist-chip.c-warning .n { color: #b45309; }
.hist-chip.c-danger .n { color: #b91c1c; }
.hist-chip.c-info .n { color: #1d4ed8; }

.hist-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px; }
.hist-field { display: flex; flex-direction: column; gap: 4px; }
.hist-field label { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.hist-field select, .hist-field input { height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); padding: 0 10px; font-size: 12.5px; color: var(--foreground); min-width: 150px; }
.hist-field input[type="date"] { min-width: 130px; }
.hist-spacer { flex: 1; }

.hist-table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
table.hist-table { width: 100%; border-collapse: collapse; }
table.hist-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-foreground); padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--muted); }
table.hist-table td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--muted); vertical-align: middle; }
table.hist-table tr:last-child td { border-bottom: none; }
table.hist-table tr:hover td { background: #fafbfc; }
.type-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; }
.type-pill iconify-icon { font-size: 13px; }
.type-pill.success { background: #d1fae5; color: #0d7a53; }
.type-pill.warning { background: #fef3c7; color: #b45309; }
.type-pill.danger { background: #fee2e2; color: #b91c1c; }
.type-pill.info { background: #ebf2fd; color: #1d4ed8; }
.read-pill { font-size: 11px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); cursor: pointer; }
.read-pill.unread { background: #eef6e6; color: #5c8236; }

.hist-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 0; }
.hist-pagination-info { font-size: 12px; color: var(--muted-foreground); }
.hist-pages { display: flex; gap: 6px; }
.hist-page-btn { width: 30px; height: 30px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); font-size: 12px; font-weight: 500; display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; color: inherit; }
.hist-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.hist-page-btn:hover:not(.active) { background: var(--muted); }

/* ── Rapprochement BL/BR (fiche client) ── */
.bl-summary { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.bl-chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.bl-chip .n { font-weight: 700; font-size: 14px; }
.bl-chip.c-ok .n { color: #0d7a53; }
.bl-chip.c-warn .n { color: #b45309; }
.bl-chip.c-bad .n { color: #b91c1c; }
.bl-chip.c-neutral .n { color: var(--foreground); }

.bl-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px; }
.bl-field { display: flex; flex-direction: column; gap: 4px; }
.bl-field label { font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.bl-field select, .bl-field input { height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); padding: 0 10px; font-size: 12.5px; color: var(--foreground); min-width: 150px; }
.bl-field input[type="date"] { min-width: 130px; }
.bl-spacer { flex: 1; }
.bl-legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted-foreground); flex-wrap: wrap; }
.bl-legend span { display: flex; align-items: center; gap: 5px; }
.bl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.bl-dot.ok { background: #16a34a; }
.bl-dot.warn { background: #f59e0b; }
.bl-dot.bad { background: #dc2626; }
.bl-dot.none { background: #9ca3af; }

.pair-list { display: flex; flex-direction: column; gap: 12px; }
.pair-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--radius-lg); padding: 16px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pair-card.ok { border-left-color: #16a34a; }
.pair-card.warn { border-left-color: #f59e0b; }
.pair-card.bad { border-left-color: #dc2626; }
.pair-card.none { border-left-color: #9ca3af; }

.pair-side { flex: 1; min-width: 200px; display: flex; gap: 12px; align-items: center; }
.pair-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pair-icon.bl { background: #ebf2fd; color: #1d4ed8; }
.pair-icon.br { background: #fef0e6; color: #c2540a; }
.pair-info-code { font-size: 13.5px; font-weight: 700; }
.pair-info-meta { font-size: 11.5px; color: var(--muted-foreground); margin-top: 2px; }
.pair-qty { font-size: 12.5px; margin-top: 4px; color: var(--foreground); }
.pair-qty b { font-weight: 700; }

.pair-arrow { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 90px; }
.pair-arrow iconify-icon { font-size: 20px; color: var(--muted-foreground); }
.pair-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pair-status.ok { background: #d1fae5; color: #0d7a53; }
.pair-status.warn { background: #fef3c7; color: #b45309; }
.pair-status.bad { background: #fee2e2; color: #b91c1c; }
.pair-status.none { background: var(--muted); color: var(--muted-foreground); }

.pair-empty-br { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; color: var(--muted-foreground); font-size: 12.5px; font-style: italic; }
.pair-empty-br iconify-icon { font-size: 20px; color: #d97706; }
