/* JamDash — Data-table avancé (100% tokens) */

.jd-dt { background: var(--bg-card); border: 0.0625rem solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: visible; }

/* toolbar */
.jd-dt__toolbar { display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border-bottom: 0.0625rem solid var(--border); flex-wrap: wrap; }
.jd-dt__searchbox { position: relative; flex: 1; min-width: 14rem; max-width: 30rem; }
.jd-dt__searchicon { position: absolute; left: 0.75rem; top: 0; bottom: 0; margin-block: auto; color: var(--text-muted); }
.jd-dt__search { padding-left: 2.25rem; padding-right: 2.25rem; }
.jd-dt__searchclear { position: absolute; right: 0.5rem; top: 0; bottom: 0; margin-block: auto;
  display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem;
  border-radius: var(--radius-pill); color: var(--text-muted); transition: background var(--t-fast), color var(--t-fast); }
.jd-dt__searchclear:hover { background: var(--bg-hover); color: var(--text-primary); }
.jd-dt__searchclear .jd-icon { width: 0.9rem; height: 0.9rem; }
.jd-dt__filter { display: flex; align-items: center; gap: var(--space-2); }
.jd-dt__filterlabel { font-size: var(--fs-small); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.02em; }
.jd-dt__resetfilters { color: var(--color-danger); }
.jd-dt__resetfilters:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.jd-dt__resetfilters .jd-icon { color: var(--color-danger); }

/* table */
.jd-dt__wrap { overflow-x: auto; }
.jd-dt__table { width: var(--size-full); border-collapse: collapse; font-size: var(--fs-body); }
.jd-dt__th { text-align: left; padding: var(--space-3) var(--space-4); font-size: var(--fs-small);
  font-weight: var(--fw-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap; border-bottom: 0.0625rem solid var(--border); user-select: none; }
.jd-dt__th.is-right { text-align: right; }
.jd-dt__th.is-sortable { cursor: pointer; }
.jd-dt__th.is-sortable:hover { color: var(--text-secondary); }
.jd-dt__sorticon { width: 0.875rem; height: 0.875rem; margin-left: 0.25rem; vertical-align: middle; }
.jd-dt__th--check, .jd-dt__td--check { width: 2.5rem; text-align: center; }
.jd-dt__th--actions, .jd-dt__td--actions { width: 5rem; text-align: right; }
.jd-dt__td--actions:has(.jd-dt__actions--inline) { width: auto; white-space: nowrap; }

/* Actions en ligne : icônes colorées directement dans la cellule (pas de menu) */
.jd-dt__actions--inline { display: inline-flex; gap: 0.25rem; justify-content: flex-end; }
.jd-dt__inlinebtn {
  width: 1.9rem; height: 1.9rem; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0.0625rem solid transparent; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.jd-dt__inlinebtn .jd-icon { width: 1.05rem; height: 1.05rem; }
/* couleur au repos par action (dérivée de la 1re/2e/3e/… icône) */
.jd-dt__inlinebtn:nth-child(1) { color: var(--color-accent); }
.jd-dt__inlinebtn:nth-child(2) { color: var(--color-info); }
.jd-dt__inlinebtn:nth-child(3) { color: var(--color-success); }
.jd-dt__inlinebtn.is-danger { color: var(--color-danger); }
/* survol : fond teinté de la même couleur */
.jd-dt__inlinebtn:hover { background: color-mix(in srgb, currentColor 14%, transparent);
  border-color: color-mix(in srgb, currentColor 30%, transparent); }

.jd-dt__row { border-bottom: 0.0625rem solid var(--border); transition: background var(--t-fast); }
.jd-dt--clickable .jd-dt__row { cursor: pointer; }
.jd-dt__row:hover { background: var(--bg-hover); }
.jd-dt__row.is-selected { background: color-mix(in srgb, var(--color-accent) 8%, transparent); }
.jd-dt__row--out { background: color-mix(in srgb, var(--color-danger) 6%, transparent); }
.jd-dt__row--out:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.jd-dt__td { padding: var(--space-3) var(--space-4); color: var(--text-primary); white-space: nowrap; }
.jd-dt__td.is-right { text-align: right; font-variant-numeric: tabular-nums; }
.jd-dt__empty { padding: var(--space-6); text-align: center; color: var(--text-muted); }

/* checkbox accent */
.jd-dt input[type="checkbox"] { width: 1rem; height: 1rem; accent-color: var(--color-accent); cursor: pointer; }

/* profil cell (avatar + nom) */

.jd-dt__link { color: var(--color-accent); font-weight: var(--fw-medium); }
.jd-taux-input { width: 6rem; padding: 0.35em 0.5em; }

/* badges de statut */
.jd-dt__badge { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.2em 0.6em;
  border-radius: var(--radius-pill); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.jd-dt__badge--green { background: var(--status-green-bg); color: var(--status-green-fg); }
.jd-dt__badge--red { background: var(--status-red-bg); color: var(--status-red-fg); }
.jd-dt__badge--yellow { background: var(--status-yellow-bg); color: var(--status-yellow-fg); }
.jd-dt__badge--gray { background: var(--bg-active); color: var(--text-secondary); }

/* menu actions "..." */
.jd-dt__actions { position: relative; display: inline-block; }
.jd-dt__menu { position: absolute; right: 0; top: calc(var(--size-full) + 0.25rem); z-index: 60; min-width: 11rem;
  background: var(--bg-card); border: 0.0625rem solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: var(--space-1); display: none; flex-direction: column; gap: 0.125rem; }
.jd-dt__actions.is-open .jd-dt__menu { display: flex; }
/* ouverture vers le haut si pas de place en bas */
.jd-dt__actions.is-up .jd-dt__menu { top: auto; bottom: calc(var(--size-full) + 0.25rem); }
.jd-dt__menuitem { display: flex; align-items: center; gap: var(--space-2); width: var(--size-full); text-align: left;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: var(--fs-body); transition: background var(--t-fast), color var(--t-fast); }
.jd-dt__menuitem:hover { background: var(--bg-hover); color: var(--text-primary); }
.jd-dt__menuitem.is-danger { color: var(--color-danger); }
.jd-dt__menuitem.is-danger:hover { background: color-mix(in srgb, var(--color-danger) 12%, transparent); }
.jd-dt__menuitem.is-danger .jd-icon { color: var(--color-danger); }

/* footer / pagination */
.jd-dt__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-top: 0.0625rem solid var(--border); flex-wrap: wrap; }
.jd-dt__info { font-size: var(--fs-label); color: var(--text-muted); }
.jd-dt__pager { display: inline-flex; align-items: center; gap: var(--space-1); }
.jd-dt__pageinfo { padding: 0 var(--space-3); color: var(--text-secondary); font-size: var(--fs-body); }
.jd-dt__pagebtn { min-width: 2rem; height: 2rem; display: inline-grid; place-items: center; padding: 0 0.5rem;
  border-radius: var(--radius-sm); font-size: var(--fs-label); color: var(--text-secondary);
  border: 0.0625rem solid transparent; transition: all var(--t-fast); }
.jd-dt__pagebtn:hover:not(:disabled) { background: var(--bg-hover); color: var(--text-primary); }
.jd-dt__pagebtn.is-active { background: var(--color-accent); color: var(--color-on-accent); font-weight: var(--fw-semibold); }
.jd-dt__pagebtn:disabled { opacity: 0.4; cursor: default; }
.jd-dt__dots { padding: 0 0.25rem; color: var(--text-muted); }

/* switch label (ex: Sans infos) */
.jd-switch { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; user-select: none; }
.jd-switch__track { position: relative; width: 2.25rem; height: 1.25rem; border-radius: var(--radius-pill);
  background: var(--bg-active); transition: background var(--t-fast); flex-shrink: 0; }
.jd-switch__track::after { content: ""; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 0.875rem; height: 0.875rem;
  border-radius: var(--radius-pill); background: var(--color-on-accent); transition: transform var(--t-fast); }
.jd-switch.is-on .jd-switch__track { background: var(--color-accent); }
.jd-switch--danger.is-on .jd-switch__track { background: var(--color-danger); }
.jd-switch.is-on .jd-switch__track::after { transform: translateX(1rem); }
.jd-switch__label { font-size: var(--fs-label); color: var(--text-secondary); font-weight: var(--fw-medium); }

/* toggle actif/inactif (statut) */

