/* Navigea — système commun des tableaux Log et Database. */
.database-console .dashboard-main,
.logistics-console .dashboard-main,
.db-admin-page main {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.database-console .dashboard-panel,
.logistics-console .dashboard-panel,
.db-admin-page .admin-box {
  min-width: 0;
}

.database-console .product-table-wrap,
.database-console .deletion-history-table-wrap,
.db-admin-page .db-table-wrap,
.logistics-console .table-scroll,
.logistics-console .bulk-orders-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
  overflow-y: visible;
}

.database-console .product-table,
.database-console .deletion-history-table,
.db-admin-page .db-table,
.logistics-console .dashboard-table,
.logistics-console .bulk-orders-table {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.database-console .product-table th,
.database-console .product-table td,
.database-console .deletion-history-table th,
.database-console .deletion-history-table td,
.db-admin-page .db-table th,
.db-admin-page .db-table td,
.logistics-console .dashboard-table th,
.logistics-console .dashboard-table td,
.logistics-console .bulk-orders-table th,
.logistics-console .bulk-orders-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding: 14px 10px !important;
  overflow: hidden;
  font-size: clamp(15px, .92vw, 17px) !important;
  line-height: 1.42;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.database-console .product-table th,
.database-console .deletion-history-table th,
.db-admin-page .db-table th,
.logistics-console .dashboard-table th,
.logistics-console .bulk-orders-table th {
  font-size: clamp(13px, .78vw, 15px) !important;
  font-weight: 900;
  letter-spacing: .025em;
  text-transform: none;
}

.database-console .product-table tbody tr,
.database-console .deletion-history-table tbody tr,
.db-admin-page .db-table tbody tr,
.logistics-console .dashboard-table tbody tr {
  border-bottom: 1px solid rgba(114, 99, 123, .18);
}

.database-console .product-table tbody tr.is-selected td,
.db-admin-page .db-table tbody tr.is-selected td,
.logistics-console .dashboard-table tbody tr.is-selected td {
  outline: 2px solid rgba(120, 81, 166, .28);
  outline-offset: -2px;
  filter: saturate(1.04);
}

.table-selection-column {
  width: 46px !important;
  padding-right: 6px !important;
  padding-left: 10px !important;
  text-align: center !important;
}

.table-selection-column input,
.table-row-checkbox,
.user-selection-checkbox input {
  width: 21px !important;
  height: 21px !important;
  min-height: 21px !important;
  margin: 0;
  accent-color: #7851a6;
  cursor: pointer;
}

.table-trash-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid #ddaeb8;
  border-radius: 8px;
  color: #8d3344;
  background: #fff0f2;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.table-trash-button span {
  display: inline-grid;
  min-width: 25px;
  min-height: 25px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: #a94455;
  font-size: 12px;
}

.table-trash-button:hover:not(:disabled) {
  border-color: #c97787;
  background: #ffe3e8;
}

.table-trash-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.table-selection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-left: auto;
}

.table-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5f5266;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.table-select-all input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #7851a6;
}

.database-console .product-table-toolbar,
.db-admin-page .db-toolbar-actions,
.logistics-console .logistics-section-actions {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .logistics-console .table-scroll,
  .logistics-console .bulk-orders-table-wrap {
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
  }

  .logistics-console .table-scroll > .dashboard-table,
  .logistics-console .bulk-orders-table {
    min-width: 760px !important;
    table-layout: auto !important;
  }

  .logistics-console .logistics-orders-table {
    min-width: 1100px !important;
  }

  .logistics-console .dashboard-table th,
  .logistics-console .bulk-orders-table th {
    overflow: visible;
    white-space: nowrap !important;
    overflow-wrap: normal;
  }
}

.database-console .product-cell-input,
.database-console .product-cell-category,
.database-console .product-cell-notes,
.db-admin-page .db-table input,
.db-admin-page .db-table select,
.logistics-console .dashboard-table input:not([type="checkbox"]),
.logistics-console .dashboard-table select,
.logistics-console .bulk-orders-table input,
.logistics-console .bulk-orders-table select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 50px !important;
  padding: 9px 10px !important;
  font-size: 16px !important;
  text-overflow: ellipsis;
}

.database-console .product-row-actions,
.logistics-console .logistics-order-actions {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 7px !important;
  width: 100%;
  margin: 0 !important;
}

.database-console .product-row-actions button,
.logistics-console .logistics-order-actions button {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  font-size: 13px;
  white-space: normal;
}

.table-sort-button {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}

.table-sort-button span,
.table-sort-button i {
  min-width: 0;
  font-style: normal;
}

.table-sort-button.is-active {
  color: #68428c;
}

.product-money-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid #cfc4d7;
  border-radius: 8px;
  background: #fff;
}

.product-money-field:focus-within {
  border-color: #8c69aa;
  box-shadow: 0 0 0 3px rgba(120, 81, 166, .12);
}

.database-console .product-money-field input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.product-money-field > span {
  display: grid;
  min-width: 31px;
  min-height: 50px;
  place-items: center;
  color: #5d466d;
  background: #f1eaf5;
  font-size: 16px;
  font-weight: 900;
}

.logistics-console .logistics-orders-table th:last-child,
.logistics-console .logistics-orders-table td:last-child {
  width: 132px;
  box-shadow: none !important;
}

.database-console .product-table th:last-child,
.database-console .product-table td:last-child {
  width: 118px;
}

/* Produits — une vue essentielle avec classement hiérarchique intégré. */
.database-console .product-table th:nth-child(1),
.database-console .product-table td:nth-child(1) { width: 46px; }
.database-console .product-table th:nth-child(2),
.database-console .product-table td:nth-child(2) { width: 82px; }
.database-console .product-table th:nth-child(3),
.database-console .product-table td:nth-child(3) { width: 22%; }
.database-console .product-table th:nth-child(4),
.database-console .product-table td:nth-child(4) { width: 20%; }
.database-console .product-table th:nth-child(5),
.database-console .product-table td:nth-child(5) { width: 12%; }
.database-console .product-table th:nth-child(6),
.database-console .product-table td:nth-child(6),
.database-console .product-table th:nth-child(7),
.database-console .product-table td:nth-child(7) { width: 10%; }
.database-console .product-table th:nth-child(8),
.database-console .product-table td:nth-child(8) { width: 8%; }
.database-console .product-table th:nth-child(9),
.database-console .product-table td:nth-child(9) { width: 7%; }

.database-console .product-reference-cell,
.database-console .product-classification-cell { overflow: visible; }
.product-reference-workspace,
.product-classification-workspace { display: grid; gap: 8px; }
.database-console .product-reference-workspace > .product-cell-name {
  min-height: 52px !important;
  color: #31253b;
  background: #fff;
  font-size: 17px !important;
  font-weight: 900 !important;
}
.product-reference-code {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.product-reference-code > span,
.product-extra-field > span,
.product-classification-field > span {
  color: #725c7e;
  font-size: 12px;
  font-weight: 900;
}
.database-console .product-reference-code .product-cell-sku {
  min-height: 38px !important;
  padding-block: 6px !important;
  color: #564b5d;
  background: #f7f3f8;
  font-size: 14px !important;
  font-weight: 800;
}
.product-classification-field { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; }
.database-console .product-classification-field .product-cell-input,
.database-console .product-classification-field .product-cell-category {
  min-height: 42px !important;
  padding-block: 7px !important;
  font-size: 14px !important;
}
.database-console .product-cell-menu { background-color: #fff; }
.product-extra-details { border: 1px solid #ded4e3; border-radius: 8px; background: #faf7fb; }
.product-extra-details > summary {
  padding: 8px 10px;
  color: #664977;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}
.product-extra-details[open] > summary { border-bottom: 1px solid #e4dce8; }
.product-extra-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(78px, .55fr);
  gap: 10px;
  padding: 10px;
}
.product-extra-field { display: grid; gap: 5px; min-width: 0; }
.product-extra-field-wide { grid-column: 1 / -1; }
.database-console .product-extra-grid .product-cell-input,
.database-console .product-extra-grid .product-cell-notes { min-height: 42px !important; font-size: 14px !important; }
.database-console .product-extra-grid .product-cell-notes { min-height: 70px !important; }
.database-console .product-usage { text-align: center; }
.database-console .product-usage strong { color: #51356e; font-size: 19px !important; }

.database-console .product-source-price,
.database-console .product-usage,
.logistics-console .logistics-order-article {
  min-width: 0;
}

.database-console .product-source-price strong,
.database-console .product-source-price small,
.database-console .product-usage strong,
.database-console .product-usage small,
.logistics-console .logistics-order-article strong,
.logistics-console .logistics-order-article small {
  display: block;
  font-size: 13px !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Commandes Log — poste de saisie agrandi et regroupé en huit blocs métier. */
.logistics-console .logistics-orders-table th,
.logistics-console .logistics-orders-table td {
  padding: 18px 12px !important;
  vertical-align: top;
}

.logistics-console .logistics-orders-table th {
  color: #4b4152 !important;
  background: #eee8f2 !important;
  font-size: clamp(14px, .86vw, 16px) !important;
  line-height: 1.25;
}

.logistics-console .logistics-orders-table td {
  font-size: clamp(16px, 1vw, 18px) !important;
  line-height: 1.5;
}

.logistics-console .logistics-orders-table th:nth-child(1),
.logistics-console .logistics-orders-table td:nth-child(1) { width: 48px !important; }
.logistics-console .logistics-orders-table th:nth-child(2),
.logistics-console .logistics-orders-table td:nth-child(2) { width: 15%; }
.logistics-console .logistics-orders-table th:nth-child(3),
.logistics-console .logistics-orders-table td:nth-child(3) { width: 23%; }
.logistics-console .logistics-orders-table th:nth-child(4),
.logistics-console .logistics-orders-table td:nth-child(4) { width: 10%; }
.logistics-console .logistics-orders-table th:nth-child(5),
.logistics-console .logistics-orders-table td:nth-child(5) { width: 13%; }
.logistics-console .logistics-orders-table th:nth-child(6),
.logistics-console .logistics-orders-table td:nth-child(6) { width: 21%; }
.logistics-console .logistics-orders-table th:nth-child(7),
.logistics-console .logistics-orders-table td:nth-child(7) { width: 9%; }
.logistics-console .logistics-orders-table th:nth-child(8),
.logistics-console .logistics-orders-table td:nth-child(8) { width: 164px; }

.logistics-console .logistics-client-cell strong,
.logistics-console .logistics-order-article > strong,
.logistics-console .logistics-delivery-cell strong {
  display: block;
  color: #2d2632;
  font-size: clamp(17px, 1.05vw, 19px) !important;
  font-weight: 950;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.logistics-console .logistics-client-cell small,
.logistics-console .logistics-order-article > small,
.logistics-console .logistics-delivery-cell small {
  display: block;
  margin-top: 7px;
  color: #6d6473;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.35;
}

.logistics-order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-top: 10px; }
.logistics-console .logistics-order-meta .logistics-badge,
.logistics-color-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid #cec3d6;
  border-radius: 7px;
  font-size: 13px !important;
  font-weight: 900;
  line-height: 1.2;
}
.logistics-color-chip { color: #56396f; background: #f0e7f5; }

.logistics-console .logistics-promise-cell { overflow: visible; }
.logistics-console .logistics-inline-date {
  width: 100% !important;
  min-height: 58px !important;
  padding: 10px !important;
  border-width: 2px !important;
  border-color: #b8a8c5 !important;
  font-size: 16px !important;
  font-weight: 850;
}
.logistics-console .logistics-inline-feedback {
  display: block;
  min-height: 22px;
  margin-top: 6px;
  font-size: 13px !important;
  font-weight: 900;
  white-space: normal;
}

.logistics-followup-cell { overflow: visible !important; }
.logistics-followup-field { display: grid; gap: 5px; }
.logistics-followup-field + .logistics-followup-field { margin-top: 11px; }
.logistics-followup-field > span {
  color: #675b6e;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.logistics-console .logistics-followup-field select {
  width: 100% !important;
  min-height: 54px !important;
  padding: 9px 34px 9px 10px !important;
  border-width: 2px !important;
  border-color: #c7b9d1 !important;
  color: #302936;
  background-color: #fff;
  font-size: 15px !important;
  font-weight: 800;
  line-height: 1.25;
}

.logistics-console .logistics-orders-table td:nth-child(7) .logistics-badge {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 13px !important;
  font-weight: 950;
}

.logistics-console .logistics-orders-table .logistics-order-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px !important;
}
.logistics-console .logistics-orders-table .logistics-order-actions button {
  min-height: 48px;
  padding: 7px 5px;
  border-width: 2px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}
.logistics-console .logistics-orders-table .logistics-order-actions .is-primary:not(:disabled) {
  border-color: #bea8cf;
  color: #402856;
  background: #e8dcf0;
}
.logistics-console .logistics-orders-table .logistics-order-actions button:disabled { opacity: .42; }

.logistics-console .logistics-filters input,
.logistics-console .logistics-filters select,
.logistics-console .bulk-orders-table input,
.logistics-console .bulk-orders-table select {
  min-height: 54px !important;
  padding: 10px 12px !important;
  font-size: 16px !important;
}
.logistics-console .logistics-section-actions > button { min-height: 50px; padding-inline: 16px; font-size: 15px; }

.database-console .user-admin-row {
  position: relative;
  padding-left: 58px !important;
  font-size: 15px;
}

.user-selection-checkbox {
  position: absolute;
  top: 50%;
  left: 18px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transform: translateY(-50%);
}

.database-console .user-admin-row.is-selected {
  border-color: #aa8cc0;
  background: #f3ebf8;
  box-shadow: inset 4px 0 0 #7851a6;
}

/* L'état stock disponible reste volontairement doré et brillant. */
.logistics-console .logistics-row-button.is-stock-ready {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: #bf7d09 !important;
  color: #382401 !important;
  background: linear-gradient(135deg, #a86f08 0%, #f8d873 35%, #fff1ad 50%, #d79b20 72%, #a86f08 100%) !important;
  background-size: 180% 180% !important;
  font-weight: 950 !important;
  text-shadow: 0 1px rgba(255,255,255,.7);
  box-shadow: 0 0 0 2px rgba(255,221,125,.5), 0 5px 16px rgba(166,106,24,.34) !important;
  animation: logistics-golden-pulse 2.8s ease-in-out infinite !important;
}

.logistics-console .logistics-row-button.is-stock-ready::after {
  animation: logistics-golden-shine 2.8s ease-in-out infinite !important;
}

@media (max-width: 1100px) {
  .database-console .product-table th,
  .database-console .product-table td,
  .db-admin-page .db-table th,
  .db-admin-page .db-table td,
  .logistics-console .dashboard-table th,
  .logistics-console .dashboard-table td {
    padding: 10px 6px !important;
    font-size: 14px !important;
  }
  .logistics-console .logistics-orders-table th { font-size: 13px !important; }
  .logistics-console .logistics-orders-table td { padding: 14px 7px !important; font-size: 15px !important; }
  .logistics-console .logistics-orders-table th:nth-child(8),
  .logistics-console .logistics-orders-table td:nth-child(8) { width: 146px; }
  .logistics-console .logistics-orders-table .logistics-order-actions button { min-height: 44px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .logistics-console .logistics-row-button.is-stock-ready,
  .logistics-console .logistics-row-button.is-stock-ready::after {
    animation: none !important;
  }
}
