/* ================================================================
 * ProVsup Design System — pv-eventslist.css
 * Page Historique des événements.
 * Réutilise : pv-page.css (header, sidebar), pv-inputs.css,
 *             pv-buttons.css, pv-variables.css
 *
 * Classes :
 *   .pv-ev-bar              — barre de pagination
 *   .pv-ev-bar-info         — compteur central
 *   .pv-ev-bar-total        — "sur N" (atténué)
 *   .pv-ev-list             — conteneur scrollable des lignes
 *   .pv-ev-row              — ligne d'événement
 *   .pv-ev-row--unread      — ligne non lue (highlight)
 *   .pv-ev-color--[type]    — couleur de bord gauche par type
 *   .pv-ev-date             — cellule date
 *   .pv-ev-icon-wrap        — cellule icône
 *   .pv-ev-icon             — image de l'icône
 *   .pv-ev-body             — cellule nom équip. + libellé
 *   .pv-ev-name             — nom de l'équipement (lien)
 *   .pv-ev-label            — libellé de l'événement
 *   .pv-ev-user             — cellule utilisateur
 *   .pv-ev-avatar           — avatar utilisateur
 *   .pv-ev-username         — nom d'utilisateur
 *   .pv-ev-comment          — cellule commentaire (editable)
 *   .pv-ev-comment--empty   — style quand aucun commentaire
 *   .pv-ev-loading          — état de chargement
 *   .pv-ev-radio            — bouton radio stylisé sidebar
 *   .pv-ev-choice-desc      — description dans ui-select choices
 *   .pv-uiselect            — wrapper ui-select design system
 * ================================================================ */


/* ── Barre de pagination ────────────────────────────────────────── */

.pv-theme .pv-ev-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex: none;
}

.pv-theme .pv-ev-bar-info {
  font-size: 12.5px;
  color: var(--text-2);
  font-family: var(--font-ui);
  min-width: 240px;
  text-align: center;
}

.pv-theme .pv-ev-bar-total {
  color: var(--faint);
}


/* ── Liste ──────────────────────────────────────────────────────── */

.pv-theme .pv-ev-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg);
}

.pv-theme .pv-ev-list::-webkit-scrollbar { width: 4px; }
.pv-theme .pv-ev-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}


/* ── Ligne d'événement ──────────────────────────────────────────── */

.pv-theme .pv-ev-row {
  display: flex;
  align-items: center;
  padding: 9px 16px 9px 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  border-left: 3px solid transparent;
  transition: background 0.10s;
  gap: 4px;
  min-height: 52px;
}

.pv-theme .pv-ev-row:hover {
  background: var(--surface-2);
}

.pv-theme .pv-ev-row--unread {
  background: oklch(0.97 0.025 75 / 0.6);
}

:root[data-theme="dark"] .pv-theme .pv-ev-row--unread {
  background: oklch(0.24 0.04 75 / 0.5);
}


/* ── Couleurs (type d'événement) ────────────────────────────────── */

.pv-theme .pv-ev-color--warning { border-left-color: var(--warn); }
.pv-theme .pv-ev-color--danger  { border-left-color: var(--stop); }
.pv-theme .pv-ev-color--info    { border-left-color: var(--info); }
.pv-theme .pv-ev-color--success { border-left-color: var(--ok);   }


/* ── Date ───────────────────────────────────────────────────────── */

.pv-theme .pv-ev-date {
  width: 102px;
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  line-height: 1.3;
}


/* ── Icône ──────────────────────────────────────────────────────── */

.pv-theme .pv-ev-icon-wrap {
  width: 40px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pv-theme .pv-ev-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: block;
}


/* ── Corps (nom + libellé) ──────────────────────────────────────── */

.pv-theme .pv-ev-body {
  flex: 1;
  min-width: 0;
  padding: 0 12px 0 8px;
}

.pv-theme .pv-ev-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.pv-theme .pv-ev-name a,
.pv-theme .pv-ev-name .clickable {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.10s;
}

.pv-theme .pv-ev-name a:hover,
.pv-theme .pv-ev-name .clickable:hover {
  color: var(--accent);
}

/* Couleur du nom par type */
.pv-theme .pv-ev-color--warning .pv-ev-name a,
.pv-theme .pv-ev-color--warning .pv-ev-name .clickable { color: var(--warn); }
.pv-theme .pv-ev-color--danger  .pv-ev-name a,
.pv-theme .pv-ev-color--danger  .pv-ev-name .clickable { color: var(--stop); }
.pv-theme .pv-ev-color--info    .pv-ev-name a,
.pv-theme .pv-ev-color--info    .pv-ev-name .clickable { color: var(--info); }
.pv-theme .pv-ev-color--success .pv-ev-name a,
.pv-theme .pv-ev-color--success .pv-ev-name .clickable { color: var(--ok);   }

.pv-theme .pv-ev-label {
  font-size: 11.5px;
  color: var(--text-2);
  font-family: var(--font-ui);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}


/* ── Utilisateur ────────────────────────────────────────────────── */

.pv-theme .pv-ev-user {
  width: 110px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  overflow: hidden;
}

.pv-theme .pv-ev-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  flex: none;
  display: block;
}

.pv-theme .pv-ev-username {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-ui);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ── Commentaire (editable) ─────────────────────────────────────── */

.pv-theme .pv-ev-comment {
  width: 190px;
  flex: none;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
  font-family: var(--font-ui);
  cursor: text;
  transition: background 0.10s, border-color 0.10s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 30px;
  display: flex;
  align-items: center;
}

.pv-theme .pv-ev-comment:hover {
  background: var(--surface-3);
  border-color: var(--border-2);
}

.pv-theme .pv-ev-comment .pv-ev-comment--empty {
  color: var(--faint);
  font-style: italic;
}


/* ── État chargement ────────────────────────────────────────────── */

.pv-theme .pv-ev-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13.5px;
}

.pv-theme .pv-ev-loading i {
  font-size: 26px;
  color: var(--accent);
}


/* ── Radios sidebar ─────────────────────────────────────────────── */

.pv-theme .pv-ev-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-2);
  font-family: var(--font-ui);
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.pv-theme .pv-ev-radio input[type="radio"] {
  margin: 0;
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  flex: none;
}


/* ── Classes spécifiques aux choix ──────────────────────────────── */
/* Le styling ui-select est dans pv-uiselect.css (global, réutilisable) */

.pv-theme .pv-ev-choice-desc {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-top: 1px;
}
