/* css/components.css
   Tous les composants UI : boutons, cartes, formulaires, modales, chat…
   ─────────────────────────────────────────────────────────────────── */

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--dur-std) var(--ease);
  letter-spacing: .01em;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-primary {
  background: var(--purple);
  color: var(--text-primary);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px var(--purple-glow);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--purple-border);
  color: var(--text-primary);
}

.btn-ghost {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(255,90,95,0.22);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255,90,95,0.22);
  transform: translateY(-1px);
}

.btn-full { width: 100%; justify-content: center; }
.btn-sm   { padding: 9px 16px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg   { padding: 16px 32px; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: all var(--dur-fast);
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--purple-border); color: var(--text-primary); }

/* ── FORMS ───────────────────────────────────────────────────────────────── */
.field-group { margin-bottom: var(--space-4); }

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.field-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.field-input:focus {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.07);
}

.field-input::placeholder { color: var(--text-muted); }

.field-textarea { resize: vertical; min-height: 88px; line-height: 1.5; }

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23666' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select.field-input option { background: var(--bg-2); }

.field-password-wrap {
  position: relative;
}

.field-password-wrap .field-input { padding-right: 48px; }

.field-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--dur-fast);
}
.field-eye-btn:hover { color: var(--text-secondary); }

.field-error {
  font-size: 0.84rem;
  color: var(--danger);
  min-height: 20px;
  margin-top: var(--space-3);
  font-weight: 600;
}

.field-check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.check-input {
  width: 18px; height: 18px;
  accent-color: var(--purple);
  cursor: pointer;
  flex-shrink: 0;
}

.check-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.form-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.badge-count {
  background: var(--purple);
  color: #fff;
  min-width: 20px;
  text-align: center;
}

.badge-role {
  background: var(--purple-soft);
  color: var(--purple);
  text-transform: uppercase;
}

.badge-active   { background: var(--success-soft); color: var(--success); }
.badge-pending  { background: var(--warning-soft);  color: var(--warning); }
.badge-danger   { background: var(--danger-soft);   color: var(--danger); }

/* Level dots — identiques au mobile */
.level-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.level-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.45);
}

.level-dot.filled { background: var(--text-primary); border-color: var(--text-primary); }

.level-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  padding: 4px 11px;
  font-size: 0.73rem;
  font-weight: 800;
}

.date-pill {
  background: var(--purple);
  color: var(--text-primary);
  border-radius: var(--radius-full);
  padding: 4px 13px;
  font-size: 0.75rem;
  font-weight: 800;
}

.badge-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

/* ── BENTO GRID ──────────────────────────────────────────────────────────── */
.bento-stats {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  margin-bottom: var(--space-8);
}

.bento-cell {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

/* Grande card vedette — prochaine tenue */
.bento-next {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 170px;
  background:
    linear-gradient(135deg, rgba(123,47,247,0.10) 0%, transparent 60%),
    var(--card-bg);
  border-color: rgba(123,47,247,0.25);
}

/* Compteur de tenues à venir */
.bento-count {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-start;
  gap: 4px;
}

/* Nom de l'atelier */
.bento-atelier {
  grid-column: 2;
  grid-row: 2;
}

.bento-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
}

.bento-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.bento-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--purple);
  margin-top: 6px;
}

.bento-pcount {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 14px;
}

.bento-big {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  margin-bottom: 2px;
}

/* Events en grille bento */
.bento-events {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.bento-events .event-card {
  margin-bottom: 0;
  border-radius: 18px;
}

@media (min-width: 900px) {
  .bento-events .event-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .bento-stats {
    grid-template-columns: 1fr 1fr;
  }
  .bento-next {
    grid-column: span 2;
    grid-row: auto;
    min-height: 130px;
  }
  .bento-count { grid-column: auto; grid-row: auto; }
  .bento-atelier { grid-column: auto; grid-row: auto; }
  .bento-events {
    grid-template-columns: 1fr;
  }
  .bento-events .event-card:first-child {
    grid-column: span 1;
  }
}

/* ── EVENT CARDS ─────────────────────────────────────────────────────────── */
.event-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  cursor: pointer;
  transition: border-color var(--dur-std) var(--ease),
              box-shadow var(--dur-std) var(--ease),
              background var(--dur-std) var(--ease),
              transform var(--dur-std) var(--ease);
  margin-bottom: 10px;
}

.event-card:hover {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(123,47,247,0.1);
}

.event-card-pills {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.event-atelier-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.event-title {
  font-size: 0.97rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-bottom: var(--space-3);
}

.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.event-participants {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.event-participants strong { color: var(--text-primary); font-weight: 800; }

.event-arrow {
  width: 32px; height: 32px;
  background: var(--purple);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Event row (liste compacte) */
.event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--dur-std) var(--ease);
}

.event-row:hover {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.055);
  transform: translateX(3px);
}

.event-row-date {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

.event-row-title {
  font-weight: 800;
  font-size: 0.93rem;
}

.event-row-chevron {
  color: var(--purple);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ── NOTIFICATIONS ───────────────────────────────────────────────────────── */
.notif-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.notif-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.notif-tab:hover { color: var(--text-secondary); border-color: rgba(255,255,255,0.14); }

.notif-tab.active {
  border-color: var(--purple-border);
  background: var(--purple-soft);
  color: var(--text-primary);
}

.tab-count {
  background: var(--purple);
  color: var(--text-primary);
  font-size: 0.65rem;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
  line-height: 1.5;
}

.notif-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.notif-card:hover {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.05);
}

.notif-card--unread {
  background: var(--purple-subtle, rgba(139,92,246,0.08));
  border-color: var(--purple-border);
}

.notif-icon-wrap {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative;
}

.notif-unread-dot {
  position: absolute;
  top: -3px; right: -3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--purple, #7c3aed);
  border: 2px solid var(--bg, #0f0f12);
}

.notif-body-wrap { flex: 1; min-width: 0; }

.notif-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.notif-type-new-member  { background: var(--purple-soft);  color: var(--purple);  border: 1px solid var(--purple-border); }
.notif-type-paid        { background: var(--success-soft);  color: var(--success); border: 1px solid rgba(52,211,153,.3); }

.notif-title {
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 3px;
}

.notif-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 600;
}

.notif-cta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  font-size: 0.78rem;
  color: var(--purple);
  font-weight: 700;
}

/* ── ADMIN ───────────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.admin-tab {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
  text-align: center;
}

.admin-tab:hover { color: var(--text-secondary); }
.admin-tab.active {
  background: var(--purple-soft);
  border-color: var(--purple-border);
  color: var(--text-primary);
}

.member-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: var(--space-3);
  transition: border-color var(--dur-fast);
}

.member-card:hover { border-color: rgba(255,255,255,0.13); }
.member-card.highlighted {
  border-color: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.member-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.member-name { font-weight: 900; font-size: 1rem; margin-bottom: 3px; }
.member-meta { font-size: 0.79rem; color: var(--text-muted); font-weight: 600; }

.member-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }

.member-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Pending progress */
.pending-progress { margin: var(--space-3) 0 var(--space-2); }

.progress-steps {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: var(--text-primary);
}

.step-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
}

.step-label.done { color: var(--text-secondary); }

.progress-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.07);
  margin-bottom: 18px;
  margin-top: 1px;
  align-self: center;
  flex-shrink: 0;
  min-width: 16px;
  max-width: 40px;
}

.progress-line.done { background: var(--success); }

.progress-detail {
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  border: 1px solid;
}

.progress-detail-title { font-size: 0.78rem; font-weight: 700; margin-bottom: 2px; }
.progress-detail-body  { font-size: 0.79rem; color: var(--text-muted); line-height: 1.4; }

/* ── CHAT ────────────────────────────────────────────────────────────────── */
.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--dur-std) var(--ease);
}

.room-card:hover {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.05);
  transform: translateX(3px);
}

.room-name    { font-weight: 800; font-size: 0.97rem; margin-bottom: 3px; }
.room-preview { font-size: 0.82rem; color: var(--text-muted); }
.room-chevron { color: var(--purple); font-size: 1.3rem; flex-shrink: 0; }

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--glass-border);
}

.chat-room-name { font-size: 1.15rem; font-weight: 900; }

.chat-messages {
  height: calc(100vh - 340px);
  min-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-3);
  padding: 4px 0 var(--space-3);
}

.msg-wrap {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  animation: fade-up .2s var(--ease);
}

.msg-wrap.mine {
  align-items: flex-end;
  margin-left: auto;
}

.msg-sender {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--purple-soft);
  border: 1px solid var(--purple-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--purple);
  flex-shrink: 0;
}

.msg-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-mine  {
  background: var(--purple);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.msg-other {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--card-border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.msg-time {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.chat-input-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--glass-border);
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 13px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}

.chat-input:focus {
  border-color: var(--purple-border);
  background: rgba(255,255,255,0.07);
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
  width: 44px; height: 44px;
  background: var(--purple);
  color: var(--text-primary);
  border-radius: 50%;
  font-size: 1.1rem;
  transition: all var(--dur-fast);
}

.chat-send:hover { opacity: .88; transform: scale(1.06); }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
/* ── EVENT DETAIL SIDE PANEL ─────────────────────────────────────────────── */
.modal-overlay {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: -401px; bottom: 0;
  width: 400px;
  z-index: 500;
  background: var(--bg-2);
  overflow: hidden;
  transition: right var(--dur-std) var(--ease);
}

.modal-overlay.is-open {
  right: 0;
  overflow-y: auto;
  border-left: 1px solid var(--glass-border);
  box-shadow: -12px 0 48px rgba(0,0,0,0.45);
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.modal-box {
  background: none;
  border: none;
  border-radius: 0;
  padding: 32px;
  max-width: 100%;
  width: 100%;
  max-height: unset;
  overflow-y: unset;
  position: relative;
  box-shadow: none;
  animation: none;
}

/* Sticky header — toujours visible au scroll */
.modal-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-2);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  flex-shrink: 0;
}

.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid var(--card-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}

.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

/* Hero */
.modal-hero {
  margin-bottom: var(--space-5);
}

/* Titre + level pill sur la même ligne */
.modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  flex: 1;
}

/* Level pill inline */
#modal-level-pill .level-pill {
  margin-top: 4px;
  flex-shrink: 0;
}

/* Atelier · Obédiance sous le titre */
.modal-atelier-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Bento grid d'infos */
.modal-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: var(--space-5);
}

.modal-bento-cell {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Quand (date + heure) — cell vedette, span 2 lignes, accent violet */
.modal-bento-when {
  background:
    linear-gradient(135deg, rgba(123,47,247,0.09) 0%, transparent 70%),
    var(--card-bg);
  border-color: rgba(123,47,247,0.20);
}
.modal-bento-when .modal-info-val {
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 4px;
}
.modal-info-sub {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--purple);
  margin-top: 2px;
}

/* Lieu — pleine largeur en bas */
.modal-bento-lieu {
  grid-column: span 2;
}

.modal-info-label {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  display: block;
  margin-bottom: 2px;
}

.modal-info-val {
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.4;
}

.modal-section {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--glass-border);
}

/* Première section après le hero — pas de séparateur au-dessus */
.modal-section-first {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.modal-section-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--space-2);
}

.modal-section-body {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* KPI bento : grande card tenue + colonne agapes/excusés */
.modal-kpis {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-5);
  align-items: stretch;
}

.modal-kpis-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.modal-kpis-col .kpi-card { flex: 1; }

.kpi-card {
  border-radius: 14px;
  padding: var(--space-4);
  text-align: center;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Grande card tenue */
.kpi-large {
  flex: none;
  width: 40%;
  padding: var(--space-5) var(--space-4);
}
.kpi-large .kpi-val { font-size: 2.4rem; }

.kpi-purple { background: var(--purple-soft); border-color: rgba(123,47,247,.22); }
.kpi-yellow { background: var(--warning-soft); border-color: rgba(251,191,36,.35); }
.kpi-red    { background: var(--danger-soft);  border-color: rgba(255,90,95,.22); }

.kpi-val   { display: block; font-size: 1.4rem; font-weight: 900; margin-bottom: 2px; }
.kpi-label { display: block; font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

.modal-my-status {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: var(--space-3);
  font-weight: 600;
}

.participate-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.participate-select {
  flex: 1;
  min-width: 160px;
}

/* ── PROFILE ─────────────────────────────────────────────────────────────── */
.profile-header-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-4);
}

.profile-avatar-lg {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--purple-soft);
  border: 2px solid var(--purple-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--purple);
  flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--dur-fast);
}

.stat-card:hover { border-color: rgba(255,255,255,0.13); }

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.stat-value { font-size: 0.93rem; font-weight: 800; }

.profile-actions { display: flex; gap: var(--space-3); }

/* ── FAB ─────────────────────────────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 54px; height: 54px;
  background: var(--purple);
  border-radius: 50%;
  color: #fff;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px var(--purple-glow);
  z-index: 50;
  cursor: pointer;
  transition: all var(--dur-std) var(--ease);
}

.fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 10px 32px var(--purple-glow); }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(28,28,32,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── UTILS ───────────────────────────────────────────────────────────────── */
.loader {
  width: 32px; height: 32px;
  border: 2px solid var(--card-border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 40px auto;
}

.empty {
  color: var(--text-muted);
  text-align: center;
  padding: 48px 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── RESPONSIVE COMPONENTS ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 22px 18px; }
  .profile-header-card { flex-direction: column; text-align: center; }
  .fab { bottom: 84px; right: 16px; }
  .modal-overlay { width: 100%; right: 0; top: auto; bottom: -86vh; height: 85vh; border-left: none; transition: bottom var(--dur-std) var(--ease); }
  .modal-overlay.is-open { right: 0; bottom: 0; height: 85vh; border-left: none; box-shadow: 0 -8px 32px rgba(0,0,0,0.45); }
  .modal-box { padding: 24px 18px; }
  .modal-bento-grid { grid-template-columns: 1fr 1fr; }
  .modal-bento-when .modal-info-val { font-size: 0.92rem; }
  .modal-info-sub { font-size: 1.15rem; }
  .modal-bento-lieu { grid-column: span 2; }
  .notif-tab { font-size: 0.74rem; padding: 8px 8px; gap: 4px; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-kpis { flex-direction: column; }
  .kpi-large { width: 100%; padding: var(--space-4); }
  .kpi-large .kpi-val { font-size: 1.8rem; }
  .participate-row { flex-direction: column; }
  .participate-select { width: 100%; min-width: unset; }
}

/* ── BIBLIOTHÈQUE ─────────────────────────────────────────────────────────── */
.lib-upload-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
}

.lib-progress-wrap {
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.lib-progress-bar {
  height: 6px;
  background: var(--glass);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.lib-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--purple);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

.lib-progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lib-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.lib-empty {
  text-align: center;
  padding: var(--space-12) var(--space-5);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lib-empty svg {
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.lib-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--dur-fast);
}

.lib-item:hover { border-color: var(--purple-border); }

.lib-item-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lib-icon-pdf  { background: rgba(255,59,48,.15);  color: #ff3b30; }
.lib-icon-word { background: rgba(0,122,255,.15);   color: #007aff; }
.lib-icon-excel{ background: rgba(52,199,89,.15);   color: #34c759; }
.lib-icon-other{ background: var(--glass);          color: var(--text-muted); }

.lib-item-info {
  flex: 1;
  min-width: 0;
}

.lib-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.lib-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lib-item-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.lib-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--dur-fast);
}

.lib-btn:hover { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-border); }
.lib-btn-delete:hover { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,59,48,.3); }

/* ── Participants list (admin modal) ─────────────────────────────────────── */
.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  gap: var(--space-3);
  border-bottom: 1px solid var(--card-border);
}

.participant-row:last-child { border-bottom: none; }

.participant-row.participant-excused { opacity: 0.55; }

.participant-name {
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.participant-type {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.participant-guest {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px 4px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  gap: var(--space-3);
}

.participant-guest:last-child { border-bottom: none; }

/* ── Modal admin actions ─────────────────────────────────────────────────── */
.modal-admin-btn-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* ── Guest invite in event modal ─────────────────────────────────────────── */
.guest-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--glass);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ── Cancelled event banner ──────────────────────────────────────────────── */
.modal-cancelled-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 0.85rem;
  line-height: 1.5;
}

.modal-cancelled-banner svg { flex-shrink: 0; margin-top: 2px; }

/* ── Participants count badge ─────────────────────────────────────────────── */
.modal-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  margin-left: 6px;
  vertical-align: middle;
}

/* ── GRILLE DESKTOP (buntu layout) ──────────────────────────────────────── */
@media (min-width: 1200px) {
  #home-events,
  #events-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 10px;
    align-items: start;
  }

  #home-events .event-card,
  #events-list .event-card { margin-bottom: 0; }
}

/* ── HOME FILTERS — pills de niveau ────────────────────────────────────── */
.home-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: none;
}
.home-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-pill:hover {
  background: var(--glass-bg);
  color: var(--text);
}
.filter-pill-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-primary);
}
.filter-pill-active:hover {
  background: var(--accent-soft, var(--accent));
}

/* ── HOME OTHERS HEADER ─────────────────────────────────────────────────── */
.home-others-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-filter-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.home-filter-icon-btn:hover {
  background: var(--glass-bg);
  color: var(--text);
}

.home-filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: var(--text-primary);
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── FILTER DRAWER ──────────────────────────────────────────────────────── */
.filter-drawer { position: fixed; inset: 0; z-index: 400; }

.filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.filter-drawer-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-2, var(--card-bg));
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  z-index: 1;
  max-height: 80vh;
  overflow-y: auto;
}

.filter-drawer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.filter-drawer-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.filter-group-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 16px;
}

.filter-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.filter-actions .btn { flex: 1; }

/* ── EXCUSED SECTION — section excusés séparée ─────────────────────────── */
.excused-row {
  border-left: 3px solid var(--danger);
  padding-left: 10px;
}
.excused-row .participant-type {
  color: var(--danger);
}

/* ── PROFILE FIELDS — champs éditables ──────────────────────────────────── */
.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.profile-field .field-input:disabled {
  background: transparent;
  border-color: var(--glass-border);
  color: var(--text);
  cursor: default;
  opacity: 0.9;
}

.profile-field .field-input:not(:disabled) {
  background: var(--bg-2, var(--card-bg));
  border-color: var(--accent);
}

/* ── DASHBOARD (SIÈGES) ──────────────────────────────────────────────────── */
.dash-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Plan inactif */
.dash-no-plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}
.dash-no-plan-icon { font-size: 3rem; margin-bottom: 16px; }
.dash-no-plan-title { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin: 0 0 12px; }
.dash-no-plan-desc { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin: 0 0 24px; }

/* Barre plan actif */
.dash-plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.dash-plan-info { display: flex; align-items: center; gap: 10px; }
.dash-plan-renewal { font-size: 0.82rem; color: var(--text-muted); }
.dash-seats-counter { display: flex; align-items: baseline; gap: 3px; font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.dash-seats-sep { color: var(--text-muted); margin: 0 1px; }
.dash-seats-label { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); margin-left: 6px; }

/* Barre progression sièges */
.dash-seats-bar-wrap { margin-bottom: 20px; }
.dash-seats-bar-bg {
  height: 6px;
  background: var(--surface-medium);
  border-radius: 999px;
  overflow: hidden;
}
.dash-seats-bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

.dash-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 20px 0 10px;
}

/* Invitations */
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}
.invite-email { font-size: 0.9rem; color: var(--text-secondary); }

/* Aperçu prix */
.dash-buy-preview {
  background: var(--surface-subtle);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-medium);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border-strong);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); margin: 0; }
.modal-desc  { font-size: 0.88rem; color: var(--text-muted); margin: -8px 0 0; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal-error {
  font-size: 0.85rem;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

.dash-stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
}

.dash-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.dash-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dash-search-wrap {
  margin-bottom: 16px;
}

.dash-search-input {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--dur-fast);
}

.dash-search-input:focus {
  border-color: var(--purple-border);
}
