/* Pattern commun listes — wrapper scroll + sticky actions */

.list-table,
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-card);
}

.list-table table,
.table-wrapper table {
  min-width: 900px;
  width: 100%;
  border-collapse: collapse;
}

.list-table thead th,
.list-table tbody td,
.table-wrapper thead th,
.table-wrapper tbody td {
  padding: 10px 14px;
}

.list-table thead th,
.table-wrapper thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.list-table tbody tr,
.table-wrapper tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
}

.list-table tbody tr:last-child,
.table-wrapper tbody tr:last-child {
  border-bottom: 0;
}

.list-table tbody tr:hover,
.table-wrapper tbody tr:hover {
  background: var(--bg-elevated);
}

.list-table tbody td,
.table-wrapper tbody td {
  color: var(--text-primary);
  vertical-align: middle;
}

.list-table thead th.col-price,
.list-table tbody td.col-price,
.table-wrapper thead th.col-price,
.table-wrapper tbody td.col-price {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.list-table thead th.col-actions,
.list-table tbody td.col-actions,
.table-wrapper thead th.col-actions,
.table-wrapper tbody td.col-actions {
  position: sticky;
  right: 0;
  background: var(--bg-card);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.4);
  z-index: 2;
  min-width: 180px;
  text-align: right;
  white-space: nowrap;
}

.list-table thead th.col-actions,
.table-wrapper thead th.col-actions {
  z-index: 3;
}

.list-table tbody tr:hover td.col-actions,
.table-wrapper tbody tr:hover td.col-actions {
  background: var(--bg-hover);
}

.list-table .col-actions__group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.table-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--accent);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  cursor: pointer;
}

.table-action-icon:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-dim, var(--border-subtle));
  text-decoration: none;
}

.table-action-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.5;
  flex-shrink: 0;
}

.list-table__name {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.list-table__name:hover {
  color: var(--accent);
  text-decoration: none;
}

.list-table__type {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.list-table__type.badge--particulier {
  background: var(--bg-base);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.list-table__type.badge--professionnel {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border-accent, var(--border-subtle));
}

.list-table .col-ville {
  color: var(--text-muted);
  font-size: 13px;
}

.list-table .col-ref {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-secondary);
}

.list-table .col-client {
  font-weight: 500;
}

.list-table .col-status {
  white-space: nowrap;
}

.list-table .col-devis-count {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.list-table .col-model-cell {
  max-width: 180px;
}

.badge--tier {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-base);
  color: var(--accent);
  border: 1px solid var(--border-subtle);
}

.list-table__model-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.card--flush > .list-table,
.card--flush > .table-wrapper {
  border: 0;
  border-radius: 0;
}

.card--flush .list-table thead th:first-child,
.card--flush .list-table tbody td:first-child,
.card--flush .table-wrapper thead th:first-child,
.card--flush .table-wrapper tbody td:first-child {
  padding-left: var(--space-6);
}

.card--flush .list-table thead th.col-actions,
.card--flush .list-table tbody td.col-actions,
.card--flush .table-wrapper thead th.col-actions,
.card--flush .table-wrapper tbody td.col-actions {
  padding-right: var(--space-4);
}
