/* ============================================================================
 * Module : artisan/styles/pages/clients.css
 * Rôle   : Styles spécifiques à la page Clients (table responsive,
 *          badges type client, infos secondaires).
 *
 *          Les classes communes (`.stats-row`, `.stat-card`, `.topbar-search`,
 *          `.table-header`, `.table-tabs`, `.table-wrap`, `.row-actions`, …)
 *          sont désormais dans `dashboard-shell.css` (D-133/D-134).
 *
 * Dépend de : tokens.css + dashboard-shell.css
 * Utilisé par : /artisan/clients.html
 * ============================================================================ */

/* ─── Container ────────────────────────────────────────────────── */
.clients-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Table ───────────────────────────────────────────────────── */
.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.clients-table thead th {
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--gray-100);
}

.clients-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.clients-table tbody tr:last-child td { border-bottom: none; }
.clients-table tbody tr:hover { background: var(--gray-50); }

.client-name {
  font-weight: var(--weight-bold);
  color: var(--brand-dark);
}

.client-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: var(--weight-bold);
}
.client-badge-particulier {
  background: var(--gray-100);
  color: var(--gray-600);
}
.client-badge-entreprise {
  background: var(--brand-50);
  color: var(--brand);
}

.client-secondary {
  font-size: .85rem;
  color: var(--gray-600);
}

.client-total {
  font-weight: var(--weight-bold);
  color: var(--brand-dark);
}

.clients-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
  font-style: italic;
}

/* ─── Modals client (Détail + Édition) ───────────────────────── */
.cl-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: cl-modal-fade-in 150ms ease-out;
}
.cl-modal[hidden] { display: none; }
.cl-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.cl-modal-card {
  position: relative;
  background: white;
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cl-modal-slide 200ms ease-out;
}
.cl-modal-card-wide {
  max-width: 780px;
}
.cl-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50, #f9fafb);
  flex-shrink: 0;
}
.cl-modal-title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  color: var(--gray-800);
  font-weight: 700;
}
.cl-modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.cl-modal-close:hover { background: var(--gray-100); color: var(--gray-800); }
.cl-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
@keyframes cl-modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cl-modal-slide {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ─── Détail client ─── */
.cl-detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin-bottom: 16px;
}
.cl-detail-info-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cl-detail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cl-detail-empty { color: var(--gray-400); font-style: italic; }
.cl-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 14px;
}
.cl-detail-subtitle {
  margin: 0 0 8px 0;
  font-size: 0.88rem;
  color: var(--gray-700);
  font-weight: 700;
}
.cl-detail-history { font-size: 0.85rem; }
.cl-history-table {
  width: 100%;
  border-collapse: collapse;
}
.cl-history-table th,
.cl-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
}
.cl-history-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 600;
}
.cl-history-table td a { color: var(--brand); font-weight: 600; text-decoration: none; }
.cl-history-table td a:hover { text-decoration: underline; }
.cl-history-table .t-right { text-align: right; }
.cl-detail-empty-state {
  text-align: center;
  padding: 20px;
  color: var(--gray-400);
  font-style: italic;
  background: var(--gray-50, #f9fafb);
  border-radius: 8px;
}

/* ─── Édition client ─── */
.cl-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cl-input-locked {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}
.cl-lock-hint {
  font-size: 0.72rem;
  color: #dc2626;
  font-weight: 600;
  margin-left: 8px;
}
.cl-required {
  color: #dc2626;
  margin-left: 2px;
}
.cl-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--gray-100);
}
