/* ============================================================
   USECASE_LIST.CSS — Styles spécifiques à la liste des UC
   ============================================================ */

.col-code     { width: 90px; }
.col-us       { width: 160px; }
.col-feature  { width: 120px; }
.col-priority { width: 90px; text-align: center; }
.col-actions  { width: 80px; text-align: right; }

.uc-title { color: var(--text-bright); font-weight: 600; }

.us-ref {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 150px;
  display: block;
}

.feature-tag {
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text-muted);
  background: #ffffff08;
  padding: 2px 7px; border-radius: 4px;
  display: inline-block;
}

/* ── Ligne expandable ── */
.expand-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 10px;
  padding: 0 4px;
  transition: color var(--transition), transform var(--transition);
  display: inline-block;
}
.expand-btn:hover { color: var(--text-bright); }
.expand-btn.open { transform: rotate(90deg); color: var(--accent); }

.uc-detail-row { display: none; }
.uc-detail-row.open { display: table-row; }
.uc-detail-row.hidden { display: none !important; }

.uc-detail {
  padding: 16px 20px 20px 36px;
  background: #ffffff03;
  border-top: 1px solid var(--panel-border);
}
.uc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.uc-detail-section { display: flex; flex-direction: column; gap: 6px; }
.uc-detail-label {
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted);
}
.uc-detail-content {
  font-size: 12px; color: var(--text);
  line-height: 1.7;
}
.uc-detail-content ul { padding-left: 16px; }
.uc-detail-content li { margin-bottom: 4px; }
.uc-detail-content p  { margin-bottom: 8px; }


/* ============================================================
   COMPONENTS.CSS — Composants partagés entre les apps
   ============================================================ */

/* ── Panel ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  overflow: hidden;
}
.panel-padded {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 24px;
}
.panel-title {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 16px;
}

/* ── Table générique ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--panel-border);
  font-size: 13px; color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: #ffffff04; }
.data-table tbody tr.hidden { display: none; }

.row-actions {
  display: flex; gap: 4px; justify-content: flex-end;
  opacity: 0; transition: opacity var(--transition);
}
.data-table tbody tr:hover .row-actions { opacity: 1; }

/* ── Code badge ── */
.code-badge {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); background: var(--accent-glow);
  padding: 3px 7px; border-radius: 4px; display: inline-block;
}

/* ── Persona role badge (global : listes + pages détail) ── */
.persona-role-badge {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: var(--accent-glow); color: var(--accent);
  display: inline-block;
}

/* ── Status badges ── */
.status-badge {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  display: inline-block;
}
.status-badge.clickable {
  cursor: pointer;
  transition: opacity var(--transition);
  user-select: none;
}
.status-badge.clickable:hover { opacity: 0.8; }

/* User Story statuts */
.status-draft       { background: rgba(140,148,170,0.15); color: #8c94aa; }
.status-validated   { background: rgba(91,138,255,0.12);  color: var(--accent); }
.status-implemented { background: rgba(80,200,120,0.12);  color: #50c878; }
.status-rejected    { background: rgba(255,107,107,0.12); color: #ff6b6b; }
.status-unused      { background: rgba(245,166,35,0.12);  color: var(--warn); }

/* Projet statuts */
.status-active   { background: rgba(91,138,255,0.12); color: var(--accent); }
.status-inactive { background: rgba(84,91,112,0.15);  color: var(--text-muted); }
.status-critical { background: rgba(245,166,35,0.12); color: var(--warn); }

/* ── Status dropdown ── */
.status-wrapper { position: relative; display: inline-block; }

.status-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 8px; padding: 4px;
  min-width: 150px; z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.status-menu.open { display: block; }

.status-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: none; border: none; border-radius: 6px;
  cursor: pointer; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  text-align: left;
}
.status-menu-item:hover { background: #ffffff08; color: var(--text-bright); }
.status-menu-item.current { color: var(--text-bright); background: #ffffff06; }

/* ── Status & priority dots ── */
.status-dot,
.priority-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.dot-draft       { background: #8c94aa; }
.dot-validated   { background: var(--accent); }
.dot-implemented { background: #50c878; }
.dot-rejected    { background: #ff6b6b; }
.dot-unused      { background: var(--warn); }

/* ── Priorité — couleurs partagées ──
   Échelle partagée (utils/choices.py) : 0 = Critique … 3 = Basse.
   Le NOMBRE DE POINTS ALLUMÉS reste décroissant avec l'urgence (4 points =
   critique), donc les sélecteurs sont inversés par rapport à la valeur :
   .priority-0 allume 4 points. */
.p-low,
.priority-color-3 { color: #50c878; }
.p-medium,
.priority-color-2 { color: var(--accent); }
.p-high,
.priority-color-1 { color: var(--warn); }
.p-critical,
.priority-color-0 { color: #ff6b6b; }

/* ── Priority dots (affichage liste) ── */
.priority-dots { display: flex; gap: 3px; }
.priority-dot  { background: var(--panel-border); }

.priority-3 .priority-dot:nth-child(-n+1) { background: #50c878; }
.priority-2 .priority-dot:nth-child(-n+2) { background: var(--accent); }
.priority-1 .priority-dot:nth-child(-n+3) { background: var(--warn); }
.priority-0 .priority-dot:nth-child(-n+4) { background: #ff6b6b; }

/* ── Select stylisé ── */
.styled-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 10px 32px 10px 12px;
  font-family: var(--font-ui); font-size: 13px;
  color: var(--text-bright); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23545b70' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.styled-select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.styled-select option { background: var(--panel); color: var(--text-bright); }

/* ── Modale ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 28px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 16px;
  transform: translateY(8px); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.modal-body  { font-size: 14px; color: var(--text); line-height: 1.6; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--panel-border);
}

/* ── Formulaire générique ── */
.form-layout { max-width: 680px; }
.form-header { margin-bottom: 28px; }
.form-title  { font-size: 20px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.form-subtitle { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top:1em;
}
.field-label span { color: var(--accent); margin-left: 2px; }
.field-hint { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.field-error { font-size: 11px; color: #ff6b6b; font-family: var(--font-mono); }

input[type="text"],
input[type="date"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 10px 12px;
  font-family: var(--font-ui); font-size: 13px;
  color: var(--text-bright); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.6; }
textarea { line-height: 1.6; resize: none; }
input.error, textarea.error { border-color: rgba(255,107,107,0.5); }

.form-actions {
  display: flex; align-items: center; gap: 10px;
  padding-top: 16px;
}
.form-actions-right { margin-left: auto; display: flex; gap: 8px; }

/* ── Pills génériques (status, priority) ── */
.pills-group {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: transparent;
  font-size: 12px; font-family: var(--font-mono); font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.pill input[type="radio"] { display: none; }
.pill:hover { color: var(--text-bright); border-color: var(--text-muted); }
.pill.active { border-color: currentColor; }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 64px 24px; gap: 12px; text-align: center;
}
.empty-icon  { font-size: 28px; opacity: 0.3; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-sub   { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-search {
  flex: 1; min-width: 200px; max-width: 300px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 7px 12px;
  font-family: var(--font-ui); font-size: 12px;
  color: var(--text-bright); outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.toolbar-search:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.toolbar-search::placeholder { color: var(--text-muted); opacity: 0.6; }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--panel-border);
  background: transparent; color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.filter-pill:hover { color: var(--text-bright); border-color: var(--text-muted); }
.filter-pill.active {
  background: var(--accent-glow); color: var(--accent);
  border-color: var(--accent-dim);
}
.toolbar-actions { margin-left: auto; }

/* ── Membres ── */
.member-name { font-weight: 600; color: var(--text-bright); font-size: 13px; }
.member-email { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }

.member-type {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: 20px; display: inline-block;
}
.member-type.internal { background: rgba(91,138,255,0.1);  color: var(--accent); }
.member-type.external { background: rgba(245,166,35,0.1);  color: var(--warn); }

.access-badge {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600;
  padding: 3px 8px; border-radius: 20px; display: inline-block;
}
.access-yes { background: rgba(80,200,120,0.1); color: #50c878; }
.access-no  { background: rgba(84,91,112,0.15); color: var(--text-muted); }

/* ── Filter dropdowns ── */
.filter-dropdown { position: relative; }

.filter-dropdown-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; height: 32px;
  background: var(--panel); color: var(--text-muted);
  border: 1px solid var(--panel-border);
  border-radius: 6px; cursor: pointer;
  font-family: var(--font-ui); font-size: 12px;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
}
.filter-dropdown-btn:hover,
.filter-dropdown.open .filter-dropdown-btn {
  border-color: var(--accent-dim); color: var(--accent);
}

.filter-count {
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
}

.filter-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 8px; padding: 6px;
  min-width: 180px; z-index: 50;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.filter-dropdown.open .filter-dropdown-menu { display: block; }

.filter-checkbox-item,
.filter-radio-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 12px; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.filter-checkbox-item:hover,
.filter-radio-item:hover { background: #ffffff08; color: var(--text-bright); }
.filter-checkbox-item input,
.filter-radio-item input { accent-color: var(--accent); }
/* ============================================================
   CARTES DE SYNTHÈSE (rangée au-dessus d'une liste)
   Composant transverse : utilisable sur n'importe quelle liste.
   Les compteurs décrivent le corpus entier, jamais la liste filtrée.
   ============================================================ */
.stat-cards {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
}
.stat-card {
  flex: 1 1 160px; min-width: 0;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--text-muted);
  border-radius: 4px;
}
.stat-card-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stat-card-value { font-size: 20px; font-weight: 700; color: var(--text-bright); }

.stat-card.clickable { cursor: pointer; transition: border-color var(--transition); }
.stat-card.clickable:hover  { border-color: var(--accent-dim); }
.stat-card.clickable.active { background: var(--accent-glow); border-color: var(--accent); }

/* Variantes de teinte : la bordure gauche porte le sens. */
.stat-card-accent { border-left-color: var(--accent); }
.stat-card-warn   { border-left-color: var(--warn); }
.stat-card-warn .stat-card-value { color: var(--warn); }

/* ── Badge de rejouabilité (testcase) ──
   « Non qualifié » reste neutre : c'est l'état de départ, pas une anomalie.
   Le signal d'alerte est porté par la carte « À repasser ». */
.replay-badge {
  font-size: 10px; font-family: var(--font-mono); font-weight: 700;
  padding: 2px 7px; border-radius: 4px; display: inline-block;
  white-space: nowrap;
}
.replay-badge.replay-scripted    { background: rgba(70,201,155,0.12);  color: #46c99b; }
.replay-badge.replay-manual      { background: rgba(245,166,35,0.12);  color: var(--warn); }
.replay-badge.replay-mixed       { background: var(--accent-glow);     color: var(--accent); }
.replay-badge.replay-unqualified { background: rgba(140,148,170,0.15); color: var(--text-muted); }

.col-replay { width: 110px; }

/* ── Cellule « dernière exécution » ──
   La date est indissociable du statut : « réussi » sans « quand » ne dit pas si
   le test a tourné hier ou il y a six mois, or c'est là-dessus que repose toute
   la lecture de fraîcheur. */
.exec-cell { display: flex; flex-direction: column; gap: 2px; }
.exec-cell-main { display: flex; align-items: center; gap: 6px; }
.exec-cell-date {
  font-size: 10px; font-family: var(--font-mono); color: var(--text-muted);
}
/* ⚙ runner / ✍ testeur : deux niveaux de preuve différents (mesuré vs constaté). */
.exec-source { margin-left: 2px; opacity: 0.7; cursor: help; }

/* Marqueur : qualifié scripté/mixte mais sans « Couvert par » — inatteignable
   par l'ingestion, donc « à repasser » à perpétuité sans que rien ne l'explique. */
.replay-warning {
  margin-left: 4px; color: var(--warn); font-size: 12px; cursor: help;
}
