﻿/* ============================================================ */
/*   DyroBot Dashboard — Main Stylesheet                        */
/*   Système de thème personnalisable par streamer              */
/* ============================================================ */

/* ---- Sidebar index helpers ---- */
.sidebar-index-1  { --sidebar-index: 1; }
.sidebar-index-2  { --sidebar-index: 2; }
.sidebar-index-4  { --sidebar-index: 4; }
.sidebar-index-5  { --sidebar-index: 5; }
.sidebar-index-6  { --sidebar-index: 6; }
.sidebar-index-7  { --sidebar-index: 7; }
.sidebar-index-8  { --sidebar-index: 8; }
.sidebar-index-9  { --sidebar-index: 9; }
.sidebar-index-10 { --sidebar-index: 10; }
.sidebar-index-11 { --sidebar-index: 11; }
.sidebar-index-12 { --sidebar-index: 12; }
.sidebar-index-13 { --sidebar-index: 13; }
.sidebar-index-14 { --sidebar-index: 14; }
.sidebar-index-15 { --sidebar-index: 15; }
.sidebar-index-16 { --sidebar-index: 16; }

/* ============================================================ */
/*   VARIABLES DE THÈME (overridables par streamer / preset)    */
/* ============================================================ */
:root {
  /* Couleur d'accent principale */
  --accent:        #00b8ff;
  --accent-dark:   #0099cc;
  --accent-glow:   rgba(0, 184, 255, 0.25);
  --accent-ring:   rgba(0, 184, 255, 0.7);

  /* Fond body */
  --bg-from:       #0b0b0c;
  --bg-to:         #001d3a;
  --bg-angle:      180deg;

  /* Surfaces */
  --surface-0:     #0e0e10;
  --surface-1:     #141517;
  --surface-2:     #1e1e226e;
  --surface-3:     #23232a;

  /* Bordures */
  --border:        #2f2f2f;
  --border-soft:   #333;

  /* Texte */
  --text-primary:  #f0f0f0;
  --text-muted:    #888;
  --text-link:     var(--accent);

  /* Header */
  --header-height: 64px;
  --header-bg:     rgba(14, 14, 16, 0.72);
  --header-blur:   12px;
  --header-border: rgba(255,255,255,0.06);

  /* Sidebar */
  --sidebar-width: 224px;
  --sidebar-bg:    rgba(14, 14, 16, 0.6);
  --sidebar-blur:  8px;
  --sidebar-items: 20;
  --sidebar-delay-step: 0.025s;

  /* Scrollbar */
  --scrollbar-thumb: var(--accent);
  --scrollbar-track: rgba(20, 21, 23, 0.65);

  /* Divers */
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --transition:    background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

/* ============================================================ */
/*   5 THÈMES PRÉDÉFINIS                                        */
/* ============================================================ */

/* 1. Ocean (défaut bleu) — identique aux valeurs :root */

/* 2. Crimson (rouge) — thème Dyro */
.theme-crimson, .theme-dyro {
  --accent:       #ff3b3b;
  --accent-dark:  #c62828;
  --accent-glow:  rgba(255, 59, 59, 0.22);
  --accent-ring:  rgba(255, 59, 59, 0.75);
  --bg-from:      #1a0000;
  --bg-to:        #2a0808;
  --bg-angle:     160deg;
  --surface-1:    #1f0808;
  --surface-2:    #2a1313;
  --scrollbar-thumb: #ff3b3b;
  --scrollbar-track: #2a1313;
}

/* 3. Emerald (vert) */
.theme-emerald {
  --accent:       #00e676;
  --accent-dark:  #00b248;
  --accent-glow:  rgba(0, 230, 118, 0.2);
  --accent-ring:  rgba(0, 230, 118, 0.7);
  --bg-from:      #010d07;
  --bg-to:        #00261a;
  --bg-angle:     160deg;
  --surface-1:    #091a10;
  --surface-2:    #112217;
  --scrollbar-thumb: #00e676;
  --scrollbar-track: #091a10;
}

/* 4. Violet */
.theme-violet {
  --accent:       #b47cff;
  --accent-dark:  #7c3fcc;
  --accent-glow:  rgba(180, 124, 255, 0.2);
  --accent-ring:  rgba(180, 124, 255, 0.7);
  --bg-from:      #0b010d;
  --bg-to:        #1a0026;
  --bg-angle:     160deg;
  --surface-1:    #140920;
  --surface-2:    #1e1130;
  --scrollbar-thumb: #b47cff;
  --scrollbar-track: #140920;
}

/* 5. Sunset (orange/doré) */
.theme-sunset {
  --accent:       #ff8c00;
  --accent-dark:  #c26200;
  --accent-glow:  rgba(255, 140, 0, 0.2);
  --accent-ring:  rgba(255, 140, 0, 0.7);
  --bg-from:      #0d0700;
  --bg-to:        #1f1000;
  --bg-angle:     160deg;
  --surface-1:    #1a0d00;
  --surface-2:    #261500;
  --scrollbar-thumb: #ff8c00;
  --scrollbar-track: #1a0d00;
}

/* ============================================================ */
/*   RESET & BASE                                               */
/* ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  transition: var(--transition);
}

::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

body {
  font-family: "Roboto", "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  margin: 0;
  color: var(--text-primary);
  background-color: var(--bg-from);
  background-image: linear-gradient(var(--bg-angle), var(--bg-from) 0%, var(--bg-to) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ============================================================ */
/*   HEADER MODERNE (glassmorphism)                             */
/* ============================================================ */
header {
  position: sticky;
  top: 0;
  z-index: 1100;
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--header-blur)) saturate(1.4);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 2px 24px rgba(0,0,0,0.35);
}

/* Logo + titre */
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.header-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Support de l'ancien h1 direct dans header */
header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  white-space: nowrap;
}

.header-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

/* Bouton hamburger mobile */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  z-index: 2100;
  transition: color 0.2s, background 0.2s;
}
.mobile-nav-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: var(--accent);
}

/* ============================================================ */
/*   AVATAR & RING D'ACCENTUATION                               */
/* ============================================================ */

/* Wrapper pour appliquer le ring via un pseudo-élément */
.avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-wrapper::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0%, var(--accent-glow) 60%, transparent 100%);
  animation: ring-spin 4s linear infinite;
  z-index: 0;
}

.avatar-wrapper::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: var(--surface-0);
  z-index: 0;
}

.avatar-wrapper .avatar,
.avatar-wrapper .avatar-large {
  position: relative;
  z-index: 1;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* Avatar simple (header) */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}

/* Avatar grand (dropdown) */
.avatar-large {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-3);
  display: block;
}

/* ============================================================ */
/*   USER MENU / DROPDOWN                                       */
/* ============================================================ */
.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: rgba(20, 21, 23, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-glow);
  z-index: 1200;
  overflow: hidden;
  animation: dropdown-in 0.18s cubic-bezier(.4,1.4,.6,1) both;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

.user-menu.open .dropdown-menu { display: block; }

/* En-tête du dropdown */
.menu-header {
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-3) 100%);
  border-bottom: 1px solid var(--border);
}

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

.user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-text strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.user-text p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Badge rang */
.user-rank-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid var(--accent);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Liste items */
.dropdown-menu-list {
  list-style: none;
  margin: 0;
  padding: 8px 6px;
}

.dropdown-menu-list li {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: background 0.15s, color 0.15s;
}

.dropdown-menu-list li:hover {
  background: rgba(255,255,255,0.07);
  color: var(--accent);
}

.dropdown-menu-list i {
  min-width: 18px;
  text-align: center;
  font-size: 1em;
  opacity: 0.75;
}

.dropdown-menu-list .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
  padding: 0;
  pointer-events: none;
}

/* ============================================================ */
/*   LAYOUT PRINCIPAL                                           */
/* ============================================================ */
.main-layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* ============================================================ */
/*   SIDEBAR MODERNE                                            */
/* ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  color: var(--text-primary);
  padding: 1rem 0 2rem;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  will-change: transform;
  transition: width 0.3s ease;
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--sidebar-blur));
  -webkit-backdrop-filter: blur(var(--sidebar-blur));
  border-right: 1px solid var(--header-border);

  /* scrollbar à gauche */
  direction: rtl;
}

.sidebar > ul,
.sidebar .sidebar-title,
.sidebar a,
.sidebar li,
.sidebar .sidebar-divider {
  direction: ltr;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar li {
  margin-bottom: 2px;
  opacity: 0;
  transform: translateX(-20px);
  animation: sidebar-slide-in 0.4s cubic-bezier(.4,1.4,.6,1) forwards;
  will-change: transform, opacity;
  animation-delay: calc(var(--sidebar-delay-step) * (var(--sidebar-index, 1) - 1));
  animation-fill-mode: forwards;
}

@keyframes sidebar-slide-in {
  to { opacity: 1; transform: translateX(0); }
}

.sidebar a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.93rem;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0.65rem 1.4rem;
  margin: 0 8px;
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  position: relative;
}

.sidebar a i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.18s, color 0.18s;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255,255,255,0.07);
  border-left-color: var(--accent);
  color: var(--accent);
}

.sidebar a:hover i,
.sidebar a.active i {
  opacity: 1;
  color: var(--accent);
}

/* Indicateur point actif */
.sidebar a.active::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.sidebar .sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 18px 1.5rem 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  margin: 14px 1.5rem;
  border: none;
  opacity: 0.3;
}

/* ============================================================ */
/*   CONTENT                                                    */
/* ============================================================ */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 1060px;
  margin: 0 auto;
  min-width: 0;
}

.content.content-main {
  box-sizing: border-box;
}

hr {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  margin: 20px 0;
  border: none;
  opacity: 0.35;
}

/* ============================================================ */
/*   CARDS                                                      */
/* ============================================================ */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s, border-color 0.2s;
  overflow-x: auto;
}

.card:hover {
  box-shadow: 0 4px 28px rgba(0,0,0,0.45), 0 0 0 1px var(--accent-glow);
}

.card h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-cards-row > * {
  flex: 1;
  min-width: 300px;
}

.card-bot-logs {
  flex: 1 1 100%;
  width: 100%;
}

.card-bot-control {
  flex: 1 1 100%;
  width: 100%;
}

/* ============================================================ */
/*   TABLEAUX                                                   */
/* ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

thead { text-align: left; }

th, td {
  padding: 11px 15px;
  border-bottom: 1px solid #2a2a2e;
}

tr { background-color: #1313136e; }

th {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

tbody tr {
  background-color: #16161860;
  transition: background-color 0.18s;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: #1f1f23; }

table button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  margin: 0 4px;
  color: var(--accent);
  padding: 0;
}

/* ============================================================ */
/*   FORMULAIRES & BOUTONS                                      */
/* ============================================================ */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, select, textarea {
  background-color: var(--surface-1) !important;
  border: 1px solid var(--border-soft) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 1rem !important;
  padding: 0.75rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.button, .buttonModal, .cancel {
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
  text-align: center;
}

.button.button-xs {
  font-size: 0.88rem;
  padding: 7px 11px;
}

.button, .buttonModal {
  background-color: var(--accent);
  color: #fff;
}

.button:hover, .buttonModal:hover {
  background-color: var(--accent-dark);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.button:active, .buttonModal:active { transform: translateY(0); }

.cancel {
  background-color: #e53935;
  color: #fff;
}
.cancel:hover { background-color: #b71c1c; }

/* ============================================================ */
/*   POPUPS / MODALES                                           */
/* ============================================================ */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.popup-content {
  position: relative;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--border);
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
  animation: popup-fade-in 0.22s cubic-bezier(.4,1.4,.6,1) both;
  box-sizing: border-box;
  overflow-y: auto;
  font-size: 0.93em;
  padding: 1.4rem 1rem;
  max-width: 420px;
  width: 100%;
  margin: auto;
}

.popup-content-wide {
  max-width: 700px;
  padding: 1.6rem 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.popup-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: -1.2rem;
}

.popup-content h3 {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.15rem;
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  z-index: 1;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.popup-close:hover { color: #ff3b3b; background: rgba(255,59,59,0.1); }

.popup-content label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  gap: 0.25em;
}

.popup-content input, .popup-content select {
  width: 100%;
}

.popup-content form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 12px;
}

@keyframes popup-fade-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.\31 00pourcent { width: 100%; }

/* ============================================================ */
/*   SLIDER SWITCH                                              */
/* ============================================================ */
.switch {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  background: #444;
  border-radius: 24px;
  transition: background 0.2s;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.switch:checked + .slider { background: var(--accent-dark); }
.switch:checked + .slider::before { transform: translateX(22px); }

.switch-label {
  display: inline-block;
  min-width: 46px;
  height: 24px;
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}

/* ============================================================ */
/*   PANEL PARAMÈTRES (SETTINGS)                                */
/* ============================================================ */
.settings-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 300px;
  background: rgba(20, 21, 23, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--accent-glow);
  z-index: 1200;
  overflow: hidden;
  animation: dropdown-in 0.18s cubic-bezier(.4,1.4,.6,1) both;
  padding: 16px;
}

.settings-panel.open { display: block; }

.settings-panel h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

/* Thèmes prédéfinis */
.theme-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.theme-preset-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.theme-preset-btn:hover { transform: scale(1.12); }

.theme-preset-btn.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--accent);
}

.theme-preset-btn[data-theme="ocean"]   { background: linear-gradient(135deg, #00b8ff, #003a5c); }
.theme-preset-btn[data-theme="crimson"] { background: linear-gradient(135deg, #ff3b3b, #5c0000); }
.theme-preset-btn[data-theme="emerald"] { background: linear-gradient(135deg, #00e676, #003d1a); }
.theme-preset-btn[data-theme="violet"]  { background: linear-gradient(135deg, #b47cff, #2e0052); }
.theme-preset-btn[data-theme="sunset"]  { background: linear-gradient(135deg, #ff8c00, #3d2000); }

/* Sélecteur couleur personnalisée */
.custom-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.custom-color-row label {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
}

#customAccentColor {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  overflow: hidden;
}

#customAccentColor::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
#customAccentColor::-webkit-color-swatch { border: none; border-radius: 50%; }

/* ============================================================ */
/*   MISC UTILS                                                 */
/* ============================================================ */
.collab-switcher-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.tips-list { margin: 0; padding-left: 1.2em; color: #b8eaff; }
.tips-link { color: var(--accent); text-decoration: underline; }
.stats-list { margin: 0; padding-left: 1.2em; }

.input-group-collab { display: flex; }
.input-group-collab input { flex-grow: 1; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.input-group-collab .button { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }

/* ============================================================ */
/*   GIVEAWAY                                                   */
/* ============================================================ */
.giveaway-search-bar {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.giveaway-search-input {
  max-width: 220px;
  font-size: 0.95em;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft) !important;
  background: var(--surface-1) !important;
  color: var(--text-primary) !important;
}
.giveaway-search-icon { color: var(--accent); }
.giveaway-filters-bar { margin-bottom: 1em; }
.giveaway-counter { margin-left: 14px; color: var(--accent); font-weight: bold; }

/* ============================================================ */
/*   FAKE SELECT                                                */
/* ============================================================ */
.fake-select-selected {
  background-color: var(--surface-1) !important;
  border: 1px solid var(--border-soft) !important;
  color: var(--text-primary) !important;
}

/* ============================================================ */
/*   TOASTS                                                     */
/* ============================================================ */
#alertToastContainer {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.alert-toast {
  min-width: 280px;
  max-width: 90vw;
  width: 320px;
  background: var(--surface-3);
  color: var(--text-primary);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  padding: 0.85rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  transform: translateX(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  position: static;
  margin: 0;
}

.alert-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.alert-toast .alert-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2em;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  margin-left: auto;
  flex-shrink: 0;
}
.alert-toast .alert-close:hover { opacity: 1; }

.alert-toast.info    { border-left-color: var(--accent); }
.alert-toast.success { border-left-color: #2ecc40; background: #1e2e1e; color: #eaffea; }
.alert-toast.warning { border-left-color: #ffcc00; background: #2a260f; color: #fffbe6; }
.alert-toast.error   { border-left-color: #ff3b3b; background: #2a1818; color: #ffeaea; }
.alert-toast.disabled{ border-left-color: #6c757d; background: #343a40; color: #adb5bd; }

/* ============================================================ */
/*   SHOP HISTORY (CSS dédié conservé inline ici)              */
/* ============================================================ */
.shop-history-filters-group label { color: var(--accent) !important; }

/* ============================================================ */
/*   RESPONSIVE — MOBILE & TABLETTE                             */
/* ============================================================ */
@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0 0.75rem;
  }

  .mobile-nav-toggle { display: flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 260px;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(14,14,16,0.98);
    backdrop-filter: blur(20px);
  }

  .sidebar.is-open { transform: translateX(0); }

  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1999;
    backdrop-filter: blur(2px);
  }

  .content {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
    padding-top: calc(var(--header-height) + 1rem);
  }

  .dashboard-cards-row {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .dashboard-cards-row > * { min-width: unset; }

  table { border: 0; }

  tr {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    background-color: var(--surface-2);
    border: 1px solid var(--border-soft);
    overflow: hidden;
    text-align: left;
  }

  td {
    text-align: left !important;
    position: relative;
    border: none;
    border-bottom: 1px solid #2a2a2e;
    box-sizing: border-box;
    background: none;
  }

  td:last-child { border-bottom: 0; }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 1rem;
    top: 0;
    width: 6rem;
    text-align: left;
    font-weight: bold;
    color: var(--accent);
    white-space: nowrap;
    padding-right: 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    pointer-events: none;
    background: none;
  }

  td:last-child, td:last-child button { position: relative; z-index: 2; }

  .card, .popup-content { padding: 1rem; }

  .input-group-collab { flex-direction: column; gap: 0.5rem; }
  .input-group-collab input,
  .input-group-collab .button { border-radius: var(--radius-sm) !important; }

  .actions { flex-direction: column; gap: 0.5rem; }
  .actions .button, .actions .cancel { width: 100%; }

  .popup { padding: 0.5rem; overflow-y: auto; align-items: flex-start; }
  .popup-content {
    overflow-y: auto;
    padding: 1.2rem 0.8rem;
    max-height: 95vh;
    max-width: 98vw;
    margin: 0;
  }

  .buttonModal { min-width: 90px; font-size: 0.97em; padding: 0.5rem 0.7rem; }

  #alertToastContainer .alert-toast {
    width: 96vw;
    min-width: 0;
    right: 0;
  }

  .settings-panel {
    position: fixed;
    top: calc(var(--header-height) + 6px);
    right: 8px;
    left: 8px;
    width: auto;
    min-width: unset;
  }
}
