/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.84rem;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s;
}
.btn-primary {
  background: var(--grad-violet);
  color: #fff;
  box-shadow: var(--shadow-glow-violet);
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); }
.btn-outline {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---------- Grille KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.kpi-card::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  top: -30px;
  right: -30px;
  opacity: 0.07;
  background: var(--kpi-accent, var(--grad-violet));
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  background: var(--kpi-accent, var(--grad-violet));
  flex-shrink: 0;
}

.kpi-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 5px;
}
.kpi-trend.up { color: var(--color-success); }
.kpi-trend.down { color: var(--color-danger); }

/* ---------- Cartes génériques / panneaux ---------- */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.panel-header h3 { font-size: 0.92rem; font-weight: 600; }
.panel-header .see-all { font-size: 0.76rem; color: var(--color-primary); font-weight: 600; }

.grid-2col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--space-md);
}
@media (max-width: 1024px) {
  .grid-2col { grid-template-columns: 1fr; }
}

/* ---------- Liste alertes / activité ---------- */
.alert-list { display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex;
  gap: var(--space-sm);
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-soft);
  border-left: 3px solid var(--color-warning);
}
.alert-item.danger { border-left-color: var(--color-danger); }
.alert-item.info { border-left-color: var(--color-info); }
.alert-item.success { border-left-color: var(--color-success); }

.alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  background: #fff;
  color: var(--color-warning);
  flex-shrink: 0;
}
.alert-item.danger .alert-icon { color: var(--color-danger); }
.alert-item.info .alert-icon { color: var(--color-info); }
.alert-item.success .alert-icon { color: var(--color-success); }

.alert-title { font-size: 0.8rem; font-weight: 600; }
.alert-meta { font-size: 0.71rem; color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--color-warning); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }
.badge-info { background: rgba(59, 130, 246, 0.12); color: var(--color-info); }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}
.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.82rem;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-soft); }
.data-table a { color: var(--color-primary); font-weight: 600; }
.data-table a:hover { text-decoration: underline; }

.rank-avatar {
  width: 25px; height: 25px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem; font-weight: 700; color: #fff;
  background: var(--grad-pink);
}

/* ---------- Dropdown notifications ---------- */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
  display: none;
  flex-direction: column;
  z-index: 60;
  overflow: hidden;
}
.notif-dropdown.open { display: flex; }

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
}
.mark-read-btn {
  font-size: 0.72rem;
  color: var(--color-primary);
  font-weight: 600;
}

.notif-list {
  overflow-y: auto;
  max-height: 360px;
}
.notif-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-card-soft); }
.notif-item.unread { background: rgba(124, 58, 237, 0.04); }

.notif-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
  background: rgba(245, 158, 11, 0.12); color: var(--color-warning);
}
.notif-icon.danger { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }
.notif-icon.info { background: rgba(59, 130, 246, 0.12); color: var(--color-info); }
.notif-icon.success { background: rgba(16, 185, 129, 0.12); color: var(--color-success); }

.notif-title { font-size: 0.8rem; font-weight: 600; }
.notif-message { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }
.notif-time { font-size: 0.68rem; color: #A9A6BE; margin-top: 3px; }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: var(--space-md); }
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-app);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}
.input-wrap i { color: var(--text-muted); }
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.87rem;
  color: var(--text-main);
  font-family: inherit;
}
.input-wrap textarea { resize: vertical; }

/* ---------- Onglets ---------- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-soft);
  overflow-x: auto;
}
.tab-item {
  padding: 9px 14px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.2s;
}
.tab-item:hover { color: var(--text-main); }
.tab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* ---------- Modales ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 30, 0.55);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.25s var(--ease-smooth);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.modal-header h3 { font-size: 1rem; }
.modal-header button { font-size: 1.3rem; color: var(--text-muted); }

/* ---------- Placeholder "à venir" ---------- */
.coming-soon {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.coming-soon .cs-icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  margin: 0 auto var(--space-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-violet);
  color: #fff;
  font-size: 2.2rem;
}
.coming-soon h2 { margin-bottom: 8px; }
.coming-soon p { color: var(--text-muted); max-width: 420px; margin: 0 auto; }
