/**
 * Liste des rapports - Whisp It
 * Recherche et filtres toujours visibles, reunions regroupees par periode, pastille de date.
 * Style plat, memes couleurs et arrondis que le reste de l application (variables.css).
 */

/* ---------- Recherche toujours visible ---------- */
.reports-header-actions .btn-search-toggle {
  display: none !important;
}

.reports-view .reports-search-wrap {
  display: flex !important;
  align-items: center;
  gap: 9px;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  box-sizing: border-box;
  transition: border-color var(--transition-fast);
}

.reports-view .reports-search-wrap:focus-within {
  border-color: #0f172a;
}

.reports-view .reports-search-icon {
  position: static;
  display: inline-flex;
  transform: none;
  color: var(--text-muted);
  flex-shrink: 0;
}

.reports-view .reports-search-input {
  flex: 1;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 16px; /* 16px minimum : pas de zoom automatique sur iPhone */
  color: var(--text-primary);
}

.reports-view .reports-search-input:focus {
  border: 0;
  background: transparent;
}

/* ---------- Filtres ---------- */
.rpt-chips {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.rpt-chips::-webkit-scrollbar {
  display: none;
}

.rpt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.rpt-chip span {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.rpt-chip:hover {
  border-color: var(--border-input);
}

.rpt-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.rpt-chip.active span {
  color: #94a3b8;
}

.rpt-chip:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

/* ---------- Groupes par periode ---------- */
.rpt-group-label {
  margin: 22px 0 6px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.rpt-group {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  overflow: hidden;
}

.rpt-group .meeting-swipe-wrapper {
  border-radius: 0;
  border-bottom: 0;
  -webkit-mask-image: none;
}

.rpt-group .meeting-swipe-wrapper + .meeting-swipe-wrapper {
  border-top: 1px solid var(--border-subtle);
}

/* ---------- Ligne d une reunion ---------- */
.rpt-group .meeting-list-row {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 13px 16px 13px 10px !important;
  border-radius: 0 !important;
  background-color: var(--bg-card) !important;
}

.rpt-group .meeting-list-row:hover,
.rpt-group .meeting-list-row.is-viewing {
  background-color: var(--bg-input) !important;
}

.rpt-datebox {
  width: 44px;
  flex-shrink: 0;
  text-align: center;
  line-height: 1;
  color: var(--text-primary);
}

.rpt-datebox b {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.rpt-datebox i {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.rpt-row-body {
  flex: 1;
  min-width: 0;
}

.rpt-row-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.rpt-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.rpt-tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  background: var(--bg-app);
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-secondary);
  white-space: nowrap;
}

.rpt-state {
  flex-shrink: 0;
  white-space: nowrap;
}

.rpt-state-ready {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rpt-state-ready svg {
  color: #16a34a;
  flex-shrink: 0;
}

.rpt-state-todo {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-size: 12px;
  font-weight: 700;
}

/* Mode selection : le rond de selection prend la place de l etat */
.rpt-group .meeting-select-indicator {
  position: static;
  order: 5;
}

.reports-list.selection-active .rpt-state {
  display: none;
}

.rpt-empty {
  margin: 28px 0 0;
  padding: 0 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.reports-list > .rpt-group-label:first-child {
  margin-top: 16px;
}

/* ---------- Telephone etroit : l etat passe sous le titre ---------- */
@media (max-width: 379px) {
  .rpt-state-ready {
    font-size: 0;
    gap: 0;
  }
}

/* ---------- Barre de selection : tient sur un telephone ---------- */
.selection-count-text,
.btn-selection-merge,
.btn-selection-delete {
  white-space: nowrap;
}

@media (max-width: 479px) {
  .reports-selection-bar {
    gap: 8px;
    padding: 8px 10px;
  }

  .selection-bar-left {
    gap: 8px;
    min-width: 0;
  }

  .btn-selection-delete span {
    display: none;
  }

  .btn-selection-delete {
    padding: 9px 11px;
  }
}

/* Compte-rendu en attente de quota (v291) : reunion gardee, rien a lancer pour l'instant */
.rpt-state-wait {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
