/**
 * Thème pages dashboard (hors accueil) : noir & blanc + actions CRUD colorées.
 * Utilisé avec .ds-page sur <main> (layout dashboard).
 */

/* Sidebar : pas de soulignement (Bootstrap Reboot remet souvent underline sur <a>) */
.dashboard-sidebar a,
.dashboard-sidebar a:link,
.dashboard-sidebar a:visited,
.dashboard-sidebar a:hover,
.dashboard-sidebar a:focus,
.dashboard-sidebar a:active {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  text-decoration-line: none !important;
  color: #fff !important;
}

.dashboard-sidebar button {
  color: #fff;
}

/* Contenu : pas de soulignement sur les liens (override Bootstrap) */
.ds-page a,
.ds-page a:link,
.ds-page a:visited,
.ds-page a:hover,
.ds-page a:focus,
.ds-page a:active {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
  text-decoration-line: none !important;
}

/* Page hub Stock : liens en cartes — pas de bleu hérité de <a> (couleurs sur les spans) */
.stock-hub a.stock-hub-link {
  color: inherit;
}

/* ——— Actions CRUD : même forme, teinte différente (fond plein + texte blanc) ——— */
.ds-page .table td .btn-ds {
  margin: 0.1rem 0.1rem 0.1rem 0;
}

.btn-ds {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, filter 0.15s;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
}

a.btn-ds,
button.btn-ds {
  -webkit-appearance: none;
  appearance: none;
}

button.btn-ds {
  background-clip: padding-box;
  font: inherit;
}

button.btn-ds:disabled,
.btn-ds[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.15);
  box-shadow: none;
}

.btn-ds:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(59, 130, 246, 0.45);
}

/* Create */
.btn-ds-create {
  background: #059669;
  border-color: #047857;
  color: #fff;
}
.btn-ds-create:hover:not(:disabled) {
  background: #047857;
  border-color: #065f46;
  color: #fff;
}

/* Read */
.btn-ds-read {
  background: #0284c7;
  border-color: #0369a1;
  color: #fff;
}
.btn-ds-read:hover:not(:disabled) {
  background: #0369a1;
  border-color: #075985;
  color: #fff;
}

/* Update */
.btn-ds-update {
  background: #d97706;
  border-color: #b45309;
  color: #fff;
}
.btn-ds-update:hover:not(:disabled) {
  background: #b45309;
  border-color: #92400e;
  color: #fff;
}

/* Delete / danger */
.btn-ds-delete,
.btn-ds-destroy {
  background: #e11d48;
  border-color: #be123c;
  color: #fff;
}
.btn-ds-delete:hover:not(:disabled),
.btn-ds-destroy:hover:not(:disabled) {
  background: #be123c;
  border-color: #9f1239;
  color: #fff;
}

/* Soumission formulaire (même forme) */
.btn-ds-submit {
  background: #18181b;
  border-color: #3f3f46;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.btn-ds-submit:hover:not(:disabled) {
  background: #27272a;
  border-color: #52525b;
  color: #fff;
}

/* Neutre (filtre, retour) */
.btn-ds-muted {
  background: #52525b;
  border-color: #3f3f46;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn-ds-muted:hover:not(:disabled) {
  background: #3f3f46;
  border-color: #27272a;
  color: #fff;
}

/* Compact (lien dans un tableau) */
.btn-ds-compact {
  min-height: 1.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 0.375rem;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

/* Présentation tableau */
.ds-page table.min-w-full thead th {
  letter-spacing: 0.01em;
}

.ds-page table.min-w-full tbody tr {
  transition: background-color 0.1s;
}

.ds-page table.min-w-full tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* GridView (Bootstrap) dans le dashboard */
.ds-page .table-responsive .table.ds-gv-table,
.ds-page .table.ds-gv-table {
  --bs-table-bg: #fff;
  --bs-table-striped-bg: #fafafa;
  --bs-border-color: #e4e4e7;
  color: #18181b;
}

.ds-page .table-responsive .table.ds-gv-table thead th,
.ds-page .table.ds-gv-table thead th {
  background: #f4f4f5;
  color: #18181b;
  font-weight: 600;
  border-color: #e4e4e7;
  white-space: nowrap;
}

.ds-page .table-responsive .table.ds-gv-table td,
.ds-page .table-responsive .table.ds-gv-table th,
.ds-page .table.ds-gv-table td,
.ds-page .table.ds-gv-table th {
  border-color: #e4e4e7;
  vertical-align: middle;
}

.ds-page .pagination {
  --bs-pagination-color: #18181b;
  --bs-pagination-bg: #fff;
  --bs-pagination-border-color: #d4d4d8;
  --bs-pagination-hover-color: #18181b;
  --bs-pagination-hover-bg: #f4f4f5;
  --bs-pagination-focus-color: #18181b;
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(24, 24, 27, 0.1);
  --bs-pagination-active-bg: #18181b;
  --bs-pagination-active-border-color: #18181b;
}

/* Badges lots : cohérence b&W avec filet */
.ds-page .badge.text-bg-light {
  color: #3f3f46 !important;
  background: #f4f4f5 !important;
  border: 1px solid #e4e4e7;
}
