/* ============================================================
   DOCTO — Composants réutilisables : boutons, cards, modals, tables
   ============================================================ */

/* ── BOUTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-lg { padding: 15px 32px; font-size: 15px; }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--red); color: white; border-color: var(--red);
  box-shadow: 0 8px 24px rgba(212,43,43,.28);
}
.btn-primary:hover { background: #b52323; border-color: #b52323; transform: translateY(-2px); }

.btn-navy { background: var(--navy); color: white; border-color: var(--navy); }
.btn-navy:hover { background: #142153; transform: translateY(-2px); }

.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: white; }

.btn-teal { background: var(--teal); color: white; border-color: var(--teal); }
.btn-teal:hover { background: #086482; }

.btn-white { background: white; color: var(--red); border-color: white; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.btn-white:hover { transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--gray); border-color: transparent; }
.btn-ghost:hover { background: var(--off); color: var(--dark); }

.btn-danger { background: rgba(212,43,43,.1); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red); color: white; }

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

/* ── CARTES ── */
.card {
  background: white;
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(26,44,107,0.06);
}
.card-hover { transition: var(--transition); }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(0,0,0,.1); }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(13,27,62,.55);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: white;
  border-radius: 20px;
  padding: 32px;
  max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--gray); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--red); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); box-shadow: var(--shadow-soft); }
table.data-table { width: 100%; border-collapse: collapse; background: white; font-size: 13.5px; }
.data-table th {
  text-align: left; padding: 14px 16px;
  background: var(--off); color: var(--gray);
  font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .5px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(0,0,0,.05); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(10,126,164,.03); }

/* ── AVATARS ── */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; flex-shrink: 0;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── TABS ── */
.tabs { display: flex; gap: 8px; border-bottom: 2px solid rgba(0,0,0,.06); margin-bottom: 24px; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 18px; background: none; border: none;
  font-size: 13.5px; font-weight: 700; color: var(--gray);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--red); }

/* ── TOGGLE SWITCH ── */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; cursor: pointer; inset: 0;
  background: #D1D5DB; border-radius: 100px; transition: var(--transition);
}
.switch-track::before {
  content: ''; position: absolute; height: 20px; width: 20px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.switch input:checked + .switch-track { background: #22C55E; }
.switch input:checked + .switch-track::before { transform: translateX(20px); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 24px; color: var(--gray); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h4 { color: var(--dark); margin-bottom: 8px; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600;
  color: var(--dark); border: 1.5px solid rgba(0,0,0,.08);
}
.pagination a:hover { border-color: var(--teal); color: var(--teal); }
.pagination .active { background: var(--navy); color: white; border-color: var(--navy); }

/* ── TOAST (fallback si Toastify indispo) ── */
.toast-fallback {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--dark); color: white; padding: 14px 20px;
  border-radius: 10px; font-size: 13.5px; box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
