/* =====================================================================
   Club Bahamas — Theme global (refonte visuelle)
   Charge apres le <style> de chaque page : surcharge l'ancien habillage
   sans toucher au HTML existant.
   ===================================================================== */

:root,
html body {
  /* Palette retravaillee : nuit violette plus profonde, rose plus chaud */
  --bg:         #07040d;
  --bg2:        #0c0717;
  --card:       rgba(23, 15, 38, 0.72);
  --card-solid: #170f26;
  --card2:      rgba(32, 21, 52, 0.75);
  --pink:       #ff3d86;
  --pink-soft:  #ff7ab0;
  --pink-glow:  rgba(255, 61, 134, 0.38);
  --gold:       #ffd166;
  --gold2:      #f0a930;
  --purple:     #8b4dff;
  --cyan:       #35d6d6;
  --green:      #2ee88f;
  --red:        #ff5470;
  --orange:     #ff9f43;
  --text:       #f4ecff;
  --text-muted: #a793c9;
  --border:     rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 61, 134, 0.28);
  --border-gold:   rgba(255, 209, 102, 0.28);
  --radius:     18px;
  --radius-sm:  12px;
  --shadow:     0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-sm:  0 8px 24px rgba(0, 0, 0, 0.35);
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------------------------------------------------------------- fond */
html body {
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 620px at 12% -8%,  rgba(139, 77, 255, 0.20), transparent 62%),
    radial-gradient(760px 560px at 98% 4%,   rgba(255, 61, 134, 0.16), transparent 60%),
    radial-gradient(900px 700px at 60% 108%, rgba(53, 214, 214, 0.08), transparent 62%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html body::before {
  background: radial-gradient(circle, rgba(139, 77, 255, 0.16) 0%, transparent 70%) !important;
  animation: bhFloat 18s var(--ease) infinite alternate;
}
html body::after {
  animation: bhFloat 22s var(--ease) infinite alternate-reverse;
}

@keyframes bhFloat {
  from { transform: translate3d(0, 0, 0)       scale(1);    }
  to   { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

/* barre de defilement */
html body ::-webkit-scrollbar { width: 10px; height: 10px; }
html body ::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); }
html body ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--pink), var(--purple));
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
html body ::-webkit-scrollbar-thumb:hover { background: var(--pink); }

/* ------------------------------------------------------------ sidebar */
html body .sidebar {
  background: linear-gradient(185deg, rgba(20, 12, 34, 0.96) 0%, rgba(8, 4, 15, 0.98) 100%);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.03), 18px 0 50px rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
}

html body .sidebar-logo { border-bottom: 1px solid var(--border); padding-bottom: 20px; }

html body .sidebar-logo .logo-icon {
  filter: drop-shadow(0 0 22px rgba(255, 61, 134, 0.55));
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
}
html body .sidebar-logo:hover .logo-icon {
  transform: scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 0 32px rgba(255, 209, 102, 0.6));
}

html body .sidebar-logo h2 {
  background: linear-gradient(120deg, var(--gold) 0%, var(--pink) 55%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 3.5px;
}

html body .sidebar-greeting {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  display: inline-block;
}

html body .menu { padding: 14px 12px 24px; }

html body .menu li a {
  position: relative;
  margin: 2px 0;
  padding: 10px 14px;
  border-left: none;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  text-transform: none;
  font-weight: 600;
  overflow: hidden;
  transition: color 0.25s var(--ease), background 0.25s var(--ease), transform 0.25s var(--ease);
}
html body .menu li a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--gold), var(--pink));
  transform: translateY(-50%);
  transition: height 0.3s var(--ease);
}
html body .menu li a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(3px);
  border-left-color: transparent;
}
html body .menu li a:hover::before { height: 55%; }
html body .menu li a.active {
  background: linear-gradient(90deg, rgba(255, 61, 134, 0.20), rgba(139, 77, 255, 0.08));
  color: #fff;
  border-left-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 61, 134, 0.25);
}
html body .menu li a.active::before { height: 62%; }

html body .menu-section {
  color: rgba(255, 209, 102, 0.55);
  font-size: 0.6rem;
  letter-spacing: 2.4px;
  padding: 20px 16px 8px;
}

/* --------------------------------------------------------------- main */
html body .main { padding: 36px 34px 60px; }

html body .page-header { margin-bottom: 26px; }

html body .page-header h1 {
  background: linear-gradient(110deg, #ffffff 20%, var(--pink-soft) 70%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

html body .subtitle { color: var(--gold); opacity: 0.85; }

/* -------------------------------------------------------------- cartes */
html body .card,
html body .table-card,
html body .stat-card,
html body .form-card,
html body .glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  animation: bhRise 0.5s var(--ease) both;
}

@keyframes bhRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

html body .card:hover,
html body .table-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

html body .card::before,
html body .table-card::before {
  background: linear-gradient(90deg, transparent, var(--pink), var(--gold), transparent);
  opacity: 0.85;
}

html body .card-title {
  color: var(--gold);
  letter-spacing: 0.6px;
}

/* --------------------------------------------------------- stat cards */
html body .stat-card:hover { transform: translateY(-4px); }

html body .stat-icon {
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

html body .stat-label {
  color: var(--text-muted);
  letter-spacing: 1.4px;
  font-size: 0.66rem;
  text-transform: uppercase;
  font-weight: 700;
}

html body .stat-value {
  font-family: 'Playfair Display', serif;
  letter-spacing: -0.5px;
}

/* ------------------------------------------------------------ boutons */
html body .btn,
html body button.btn,
html body a.btn,
html body .btn-save,
html body .btn-spin {
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.9px;
  border: 1px solid transparent;
  background-image: linear-gradient(135deg, var(--pink) 0%, #c81f63 100%);
  box-shadow: 0 6px 20px rgba(255, 61, 134, 0.28);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
}
html body .btn:hover,
html body .btn-save:hover,
html body .btn-spin:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(255, 61, 134, 0.42);
  filter: brightness(1.08);
}
html body .btn:active { transform: translateY(0); }

html body .btn.secondary,
html body .btn.gray {
  background-image: none;
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}
html body .btn.secondary:hover,
html body .btn.gray:hover {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: var(--border-strong);
}

html body .btn.green  { background-image: linear-gradient(135deg, #2ee88f, #0f9d58); box-shadow: 0 6px 20px rgba(46, 232, 143, 0.26); }
html body .btn.red    { background-image: linear-gradient(135deg, #ff5470, #b31537); box-shadow: 0 6px 20px rgba(255, 84, 112, 0.26); }
html body .btn.purple { background-image: linear-gradient(135deg, #8b4dff, #5a1fc0); box-shadow: 0 6px 20px rgba(139, 77, 255, 0.26); }
html body .btn.gold   { background-image: linear-gradient(135deg, var(--gold), var(--gold2)); color: #2a1a00; box-shadow: 0 6px 20px rgba(255, 209, 102, 0.26); }

/* ------------------------------------------------------ champs de saisie */
html body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html body select,
html body textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
html body input:not([type="checkbox"]):not([type="radio"]):focus,
html body select:focus,
html body textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 61, 134, 0.16);
}
html body input::placeholder,
html body textarea::placeholder { color: rgba(167, 147, 201, 0.55); }

html body select option { background: #150e24; color: var(--text); }

html body input[type="checkbox"],
html body input[type="radio"] { accent-color: var(--pink); }

html body label { color: var(--pink-soft); }

/* -------------------------------------------------------------- tables */
html body table { border-collapse: separate; border-spacing: 0; }

html body thead th {
  background: rgba(14, 8, 24, 0.92);
  color: var(--pink-soft);
  letter-spacing: 1.6px;
  border-bottom: 1px solid var(--border-strong);
}

html body tbody tr { transition: background 0.2s var(--ease); }
html body tbody tr:hover { background: rgba(255, 61, 134, 0.06); }
html body tbody td { border-bottom: 1px solid rgba(255, 255, 255, 0.05); }

/* -------------------------------------------------------------- badges */
html body .badge {
  border-radius: 99px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 5px 11px;
  border: 1px solid transparent;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
html body .badge-green { background: rgba(46, 232, 143, 0.12);  border-color: rgba(46, 232, 143, 0.32);  color: #6ff5b8; }
html body .badge-red   { background: rgba(255, 84, 112, 0.12);  border-color: rgba(255, 84, 112, 0.32);  color: #ff92a6; }
html body .badge-gray  { background: rgba(255, 255, 255, 0.06); border-color: var(--border);             color: var(--text-muted); }
html body .badge-gold  { background: rgba(255, 209, 102, 0.12); border-color: var(--border-gold);        color: var(--gold); }

/* -------------------------------------------------------------- onglets */
html body .tab {
  border-radius: 99px;
  transition: all 0.25s var(--ease);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
html body .tab:hover { border-color: var(--border-strong); color: var(--text); }
html body .tab.active {
  background: linear-gradient(135deg, var(--pink), #c81f63);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 61, 134, 0.3);
}

/* --------------------------------------------------------------- modales */
html body .modal-overlay,
html body .modal-bg {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(4, 2, 9, 0.72);
}
html body .modal {
  background: linear-gradient(180deg, rgba(30, 20, 48, 0.96), rgba(16, 10, 28, 0.98));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------- flashs */
html body .flash {
  border-radius: var(--radius-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: bhRise 0.4s var(--ease) both;
}

/* ------------------------------------------------------ accessibilite */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html body *,
  html body *::before,
  html body *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------- mobile */
@media (max-width: 768px) {
  html body .main { padding: 22px 14px 48px; }
  html body .page-header h1 { font-size: 1.6rem; }
  html body .menu li a { padding: 14px 10px; border-radius: 10px; }
  html body .menu li a::before { display: none; }
}
