﻿/* ========== RESET & GLOBAL ========== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #020617;
  color: #e5e7eb;
}

/* Scrollbar légère */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 999px;
}

/* ========== LAYOUT ========== */

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  background: #020617;
  border-right: 1px solid #111827;
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
}

.admin-wrapper {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: 70px;
  border-bottom: 1px solid #111827;
  background: radial-gradient(circle at top left, #1f2937 0, #020617 55%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.admin-main {
  padding: 20px 24px 24px;
  flex: 1;
  overflow-y: auto;
}

/* ========== SIDEBAR ========== */

.admin-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  padding: 6px 8px;
}

.admin-logo-main {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #020617;
}

.admin-logo-sub {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  color: #9ca3af;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: auto;
}

.admin-nav-link {
  border: none;
  background: transparent;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.admin-nav-link .nav-icon {
  width: 22px;
  text-align: center;
}

.admin-nav-link:hover {
  background: #111827;
  color: #e5e7eb;
}

.admin-nav-link.active {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #020617;
}

.admin-sidebar-footer {
  border-top: 1px solid #111827;
  padding-top: 12px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #111827;
  font-size: 12px;
  color: #9ca3af;
}

.env-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.logout-btn {
  border: none;
  border-radius: 10px;
  padding: 7px 10px;
  background: #111827;
  color: #f97316;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ========== TOPBAR ========== */

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.topbar-subtitle {
  margin: 0;
  font-size: 13px;
  color: #9ca3af;
}

.topbar-subtitle.api-status-error {
  color: #f59e0b;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-search input {
  background: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 7px 12px;
  color: #e5e7eb;
  font-size: 13px;
  min-width: 230px;
}

.topbar-search input::placeholder {
  color: #6b7280;
}

.topbar-search input:focus {
  outline: none;
  border-color: #0ea5e9;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-name {
  font-size: 13px;
  font-weight: 500;
}

.admin-email {
  font-size: 11px;
  color: #9ca3af;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #020617;
  font-weight: 700;
}

/* ========== VUES & PANELS ========== */

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: radial-gradient(circle at top left, #111827 0, #020617 55%);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #111827;
}

.kpi-label {
  font-size: 12px;
  color: #9ca3af;
}

.kpi-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 600;
}

.kpi-footer {
  margin-top: 8px;
  font-size: 11px;
  color: #6b7280;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
}

.panel {
  background: #020617;
  border-radius: 14px;
  border: 1px solid #111827;
  padding: 14px 14px 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.panel-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-search-input {
  background: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  color: #e5e7eb;
  font-size: 13px;
}

.panel-search-input::placeholder {
  color: #6b7280;
}

.panel-search-input:focus {
  outline: none;
  border-color: #0ea5e9;
}

.panel-select {
  background: #020617;
  border-radius: 999px;
  border: 1px solid #1f2937;
  padding: 6px 10px;
  color: #e5e7eb;
  font-size: 13px;
}

.panel-select:focus {
  outline: none;
  border-color: #0ea5e9;
}

/* petit message "aucun utilisateur" */

.admin-empty {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
}

/* ========== TABLES ========== */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead {
  background: #020617;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #111827;
  white-space: nowrap;
}

.admin-table th {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.admin-table tbody tr:hover {
  background: #020617;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid transparent;
}

.badge-success {
  background: rgba(22, 163, 74, 0.12);
  color: #4ade80;
  border-color: rgba(22, 163, 74, 0.5);
}

.badge-danger {
  background: rgba(220, 38, 38, 0.12);
  color: #f97373;
  border-color: rgba(220, 38, 38, 0.4);
}

.badge-warning {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.4);
}

.badge-neutral {
  background: #020617;
  color: #9ca3af;
  border-color: #111827;
}

/* ======== BOUTONS TABLE (DÉTAILS / ACCEPT / REFUSE) ======== */

.table-btn {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #020617;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 0 1px #0f172a;
  transition: transform 0.1s ease-out, box-shadow 0.1s ease-out,
    filter 0.1s ease-out;
}

.table-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 118, 110, 0.5);
}

.table-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.8);
}

.admin-table td:last-child {
  text-align: right;
}

/* ========== SETTINGS ========== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.settings-block {
  background: #020617;
  border-radius: 12px;
  border: 1px solid #111827;
  padding: 10px 12px 12px;
}

.settings-block h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.settings-block p {
  margin: 2px 0;
  font-size: 12px;
  color: #9ca3af;
}

.settings-status {
  margin-top: 6px;
  font-size: 12px;
  color: #e5e7eb;
}

/* switch */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  margin-top: 6px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #111827;
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  top: 3px;
  background-color: #6b7280;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: #22c55e;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #020617;
}

/* ========== MODALE DETAILS ========== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 30;
}

.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.details-modal {
  position: fixed;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 360px;
  max-width: calc(100% - 32px);
  background: #020617;
  border-radius: 16px;
  border: 1px solid #111827;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85);
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease-out, opacity 0.2s;
  z-index: 31;
  display: flex;
  flex-direction: column;
}

.details-modal.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.details-header {
  padding: 12px 14px;
  border-bottom: 1px solid #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.details-header h2 {
  margin: 0;
  font-size: 15px;
}

.details-close-btn {
  border-radius: 999px;
  border: 1px solid #111827;
  background: #020617;
  color: #9ca3af;
  font-size: 13px;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.details-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  font-size: 13px;
}

.details-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin: 10px 0 4px;
}

.details-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}

.details-item-label {
  color: #9ca3af;
}

.details-item-value {
  font-weight: 500;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 980px) {
  .admin-sidebar {
    width: 220px;
  }
  .admin-wrapper {
    margin-left: 220px;
  }
}

@media (max-width: 800px) {
  .admin-sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 40;
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-wrapper {
    margin-left: 0;
  }

  .admin-topbar {
    padding-inline: 14px;
  }

  .cards-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .cards-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-search input {
    min-width: 160px;
  }
}
/* === Boutons actions vérification (panel admin) === */

.verification-action-btn {
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 6px;
}

.verification-action-btn.approve {
  border-color: #22c55e;
  color: #22c55e;
}

.verification-action-btn.reject {
  border-color: #f97373;
  color: #f97373;
}

.verification-action-btn:hover {
  background: #111827;
}


