/* ==============================================================================
   IVOIRE COUPLE ADMIN CONSOLE — DESIGN SYSTEM OBSIDIAN & GOLD DATA-DRIVEN
   Palette: #101010 (Obsidian), #F7F2E8 (Ivoire), #C7A66A (Or), #481B28 (Burgundy)
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400&display=swap');

:root {
  --bg-dark: #0D0D0D;
  --bg-sidebar: #131313;
  --bg-card: #181818;
  --bg-surface: #202020;
  --bg-hover: #262626;
  
  --gold: #C7A66A;
  --gold-light: #E3C88B;
  --gold-dark: #9A783E;
  --gold-glow: rgba(199, 166, 106, 0.2);
  
  --burgundy: #481B28;
  --burgundy-light: #7A2E44;
  
  --text-main: #FFFFFF;
  --text-cream: #F7F2E8;
  --text-muted: #8E8A85;
  --text-dim: #605C57;
  
  --border-subtle: #242424;
  --border-gold: rgba(199, 166, 106, 0.35);
  
  --status-success: #2ECC71;
  --status-warning: #F39C12;
  --status-danger: #E74C3C;
  --status-info: #3498DB;
  
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --sidebar-width: 270px;
  --topbar-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-cream);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Scrollbar personnalisée dorée */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Layout général */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: var(--bg-dark);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--gold-glow);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.5px;
}

.logo-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.sidebar-profile {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.profile-name {
  font-weight: 700;
  font-size: 13px;
  color: #FFF;
}

.profile-role {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}

.admin-logout-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.admin-logout-btn:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: var(--status-danger);
  color: #ff6b6b;
  transform: scale(1.05);
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 14px 10px 6px 10px;
  font-weight: 700;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  font-size: 13px;
}

.menu-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-cream);
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(199, 166, 106, 0.15), rgba(72, 27, 40, 0.2));
  color: var(--gold-light);
  font-weight: 700;
  border-left: 3px solid var(--gold);
}

.menu-icon {
  font-size: 16px;
}

.counter-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background-color: rgba(199, 166, 106, 0.2);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
}

.counter-badge.danger {
  background-color: rgba(231, 76, 60, 0.2);
  color: var(--status-danger);
  border-color: rgba(231, 76, 60, 0.4);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
}

.version-tag {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* Zone principale */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  background-color: rgba(19, 19, 19, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 5px 12px;
  border-radius: 20px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.role-switcher {
  display: flex;
  align-items: center;
}

.content-body {
  padding: 28px;
  flex: 1;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.kpi-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-sidebar));
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
}

.kpi-card.highlight-gold {
  border: 1px solid var(--border-gold);
  background: linear-gradient(145deg, rgba(199, 166, 106, 0.08), var(--bg-card));
}

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

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi-icon {
  font-size: 18px;
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 6px;
}

.kpi-trend {
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 600;
}

.kpi-trend.positive {
  color: var(--status-success);
}

.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cards & Conteneurs */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text-cream);
  font-weight: 700;
}

.card-body {
  padding: 20px;
}

/* Priority list */
.priority-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}

.priority-item:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-gold);
}

.priority-icon {
  font-size: 24px;
}

.priority-info {
  flex: 1;
}

.priority-title {
  font-weight: 700;
  color: #FFF;
  font-size: 14px;
}

.priority-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Status list */
.status-indicator-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--status-success);
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-success);
}

/* Filtres & Recherche */
.page-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
}

.filter-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover, .filter-tab.active {
  background-color: var(--burgundy);
  color: var(--gold-light);
  border-color: var(--gold);
}

.search-box input, .admin-input {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 14px;
  color: #FFF;
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.search-box input:focus, .admin-input:focus {
  border-color: var(--gold);
}

.admin-select {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 14px;
  color: #FFF;
  font-size: 13px;
  outline: none;
}

/* Tableaux de données */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 14px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  background: rgba(0,0,0,0.15);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  color: var(--text-cream);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: var(--bg-hover);
}

.table-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-gold);
}

.table-user-name {
  font-weight: 700;
  color: #FFF;
}

.table-user-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badges & Pills */
.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-gold {
  background: rgba(199, 166, 106, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.badge-subtle {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.badge-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--status-danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-success {
  background: rgba(46, 204, 113, 0.15);
  color: var(--status-success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.active {
  background: rgba(46, 204, 113, 0.15);
  color: var(--status-success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-pill.pending {
  background: rgba(243, 156, 18, 0.15);
  color: var(--status-warning);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.status-pill.rejected {
  background: rgba(231, 76, 60, 0.15);
  color: var(--status-danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Boutons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: var(--bg-dark);
  box-shadow: 0 4px 12px var(--gold-glow);
}

.btn-gold:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-cream);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-gold);
}

.btn-warning {
  background: rgba(243, 156, 18, 0.15);
  color: var(--status-warning);
  border: 1px solid rgba(243, 156, 18, 0.4);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--status-danger);
  border: 1px solid rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
  background: var(--status-danger);
  color: #FFF;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

.btn-block {
  width: 100%;
}

/* Modale */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  z-index: 210;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 24px var(--gold-glow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--gold-light);
  font-weight: 700;
}

.modal-close {
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #FFF;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.modal-form-group {
  margin-bottom: 14px;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 300;
}

.toast {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px 18px;
  border-left: 4px solid var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #FFF;
  font-size: 13px;
  transition: opacity 0.3s;
}

.toast.success {
  border-left-color: var(--status-success);
}

.toast.warning {
  border-left-color: var(--status-warning);
}

.toast.danger {
  border-left-color: var(--status-danger);
}

.toast.info {
  border-left-color: var(--gold);
}

/* ==============================================================================
   COMPOSANTS SPÉCIFIQUES V2 P0 — SWITCHES, PULSE, COUNTDOWN, FUNNELS
   ============================================================================== */

/* Interrupteur Bascule (Toggle Switch) */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #333333;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 26px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}
input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #101010;
}

/* Pulsation Live Ops */
.pulse-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse-green 1.8s infinite;
}
@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Compte à rebours 5s bloquant preview */
.countdown-banner {
  background: linear-gradient(135deg, rgba(72, 27, 40, 0.8), rgba(24, 24, 24, 0.95));
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.countdown-badge-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(199, 166, 106, 0.15);
  color: var(--gold);
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
}

/* Funnel d'entonnoir */
.funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid var(--gold);
}
.funnel-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--gold);
  margin-top: 6px;
  transition: width 0.6s ease;
}

/* Cartes Feature Flags & Passerelles */
.flag-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}
.flag-card:hover {
  border-color: var(--border-gold);
}

.gateway-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s;
}
.gateway-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

