:root {
  --bg-base: #0a0b10;
  --bg-surface: rgba(255, 255, 255, 0.045);
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.10);
  --accent: #f08119;
  --accent-hover: #ff9533;
  --accent-glow: rgba(240, 129, 25, 0.30);
  --text: #e8eaf0;
  --text-secondary: #a8aec0;
  --text-muted: #8b91a6;
  --green: #4ade80;
  --red: #f87171;
  --orange: #faa61a;
  --purple: #c084fc;
  --border: rgba(255, 255, 255, 0.09);
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 40px rgba(0,0,0,0.40);
  --glass-blur: blur(16px);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 580px at 82% -8%, rgba(240,129,25,0.16), transparent 60%),
    radial-gradient(900px 520px at -8% 108%, rgba(88,101,242,0.14), transparent 55%),
    var(--bg-base);
  background-attachment: fixed;
}

/* ========== LOGIN ========== */
.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base);
  z-index: 1000;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}

.login-card h2 {
  font-size: 22px; font-weight: 600; margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-secondary); font-size: 14px; margin-bottom: 28px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group input {
  width: 100%; padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.login-error {
  color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #5865F2;
  color: #fff;
  text-decoration: none;
}

.btn-discord:hover {
  background: #4752C4;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.3);
}

.btn-full { width: 100%; }

.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard {
  display: none;
  min-height: 100vh;
}

.dashboard.visible {
  display: block;
}

/* ========== SIDEBAR ========== */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 0;
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 260px;
  z-index: 100;
}

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

.bot-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  object-fit: cover;
}

.bot-info h2 {
  font-size: 16px; font-weight: 600;
  line-height: 1.2;
}

.status-badge {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
}

.status-badge.online {
  background: rgba(67, 181, 129, 0.15);
  color: var(--green);
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}

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

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}

.guild-info {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
}

.guild-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  object-fit: cover;
}

/* ========== CONTENT ========== */
.content {
  margin-left: 260px;
  padding: 32px 48px;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 26px; font-weight: 700; margin-bottom: 4px;
}

.page-header p {
  color: var(--text-secondary); font-size: 14px;
}

/* ========== STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(88,101,242,0.15); color: var(--accent); }
.stat-icon.green  { background: rgba(67,181,129,0.15); color: var(--green); }
.stat-icon.purple { background: rgba(155,89,182,0.15); color: var(--purple); }
.stat-icon.orange { background: rgba(250,166,26,0.15); color: var(--orange); }
.stat-icon.red    { background: rgba(240,71,71,0.15); color: var(--red); }

.stat-value {
  display: block; font-size: 22px; font-weight: 700; line-height: 1;
}

.stat-label {
  display: block; font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}

/* ========== CARDS ==========
   Les cartes encadrees ont ete remplacees par les sections a plat (.dx-sec)
   le 09/08/2026. Seul .card-desc survit : il sert encore de sous-titre a
   l'interieur des .dx-sec-h sur les pages converties automatiquement. */
.card-desc {
  font-size: 12px; color: var(--text-muted);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239494b0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Options du menu déroulant (repli natif : fond sombre + aération, au lieu du blanc système) */
.form-select option {
  background: #1c1e26;
  color: var(--text);
  padding: 10px 12px;
}
.form-select option:disabled { color: var(--text-muted); }

/* Menu déroulant ENTIÈREMENT personnalisé (navigateurs récents supportant appearance: base-select) :
   panneau sombre arrondi, options aérées avec surbrillance à l'accent, scrollbar accent.
   Repli automatique sur le select natif ci-dessus si non supporté (@supports). */
@supports (appearance: base-select) {
  .form-select,
  .form-select::picker(select) {
    appearance: base-select;
  }
  .form-select {
    display: flex;
    align-items: center;
    background-image: none;
    padding-right: 36px;
  }
  .form-select::picker-icon {
    color: var(--text-secondary);
    transition: transform var(--transition);
  }
  .form-select:open::picker-icon { transform: rotate(180deg); }
  .form-select::picker(select) {
    background: #1c1e26;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    margin-top: 6px;
    max-height: 340px;
  }
  .form-select option {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    padding: 10px 12px;
    background: transparent;
    cursor: pointer;
    transition: background var(--transition);
  }
  .form-select option:hover,
  .form-select option:focus {
    background: var(--bg-hover);
  }
  .form-select option:checked {
    background: var(--accent);
    color: #fff;
  }
  .form-select option::checkmark { display: none; }
  .form-select::picker(select)::-webkit-scrollbar { width: 8px; }
  .form-select::picker(select)::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 8px;
  }
  .form-select::picker(select)::-webkit-scrollbar-track { background: transparent; }
}

.form-row {
  display: flex; align-items: center; justify-content: space-between;
}

.color-input-wrap {
  display: flex; align-items: center; gap: 10px;
}

.form-color {
  width: 44px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

.form-color::-webkit-color-swatch-wrapper { padding: 0; }
.form-color::-webkit-color-swatch { border: none; border-radius: 6px; }

.color-hex {
  width: 100px;
}

/* ========== TOGGLE ========== */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px; height: 26px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0; width: 0; height: 0;
}

.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text-secondary);
  top: 2px; left: 3px;
  transition: all 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(19px);
  background: #fff;
}

/* ========== ACTIVITIES ========== */
.activities-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 14px;
}

.activity-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.activity-row .form-input,
.activity-row .form-select {
  background: var(--bg-surface);
}

.activity-row .form-input {
  flex: 1;
}

.activity-row .form-select {
  width: 140px; flex-shrink: 0;
}

/* ========== ITEMS LIST (addons/commands) ========== */
.items-list {
  display: flex; flex-direction: column; gap: 10px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  transition: border-color var(--transition);
}

.item-card:hover {
  border-color: var(--accent-glow);
}

.item-info {
  flex: 1; min-width: 0;
}

.item-name {
  font-size: 15px; font-weight: 600;
  margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px;
}

.item-version {
  font-size: 11px; font-weight: 500;
  background: var(--bg-input);
  padding: 1px 7px;
  border-radius: 6px;
  color: var(--text-muted);
}

.item-desc {
  font-size: 13px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.item-authors {
  font-size: 12px; color: var(--text-muted);
}

.item-badges {
  display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap;
}

.item-badge {
  font-size: 11px; font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-muted);
}

.item-badge.active {
  background: rgba(67,181,129,0.15);
  color: var(--green);
}

.item-emoji {
  font-size: 20px; margin-right: 4px;
}

/* ========== ACTIONS BAR ========== */
.actions-bar {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.save-hint {
  font-size: 13px; color: var(--text-muted);
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 30px; right: 30px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--green);
  color: #fff;
}

.toast.error {
  background: var(--red);
  color: #fff;
}

.toast.info {
  background: var(--accent);
  color: #fff;
}

/* ========== SECTION HEADER ========== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 16px;
}

.section-header h2 {
  font-size: 20px; font-weight: 700; margin-bottom: 2px;
}

.section-header p {
  color: var(--text-secondary); font-size: 14px;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 720px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 { font-size: 18px; font-weight: 600; }

.modal-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 24px; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body {
  flex: 1; overflow-y: auto;
  padding: 0 24px 24px;
}

.modal-tabs {
  display: flex; gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  position: sticky; top: 0;
  background: var(--bg-surface);
  z-index: 1;
}

.modal-tab {
  padding: 8px 16px;
  border: none; border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.modal-tab:hover { background: var(--bg-hover); color: var(--text); }

.modal-tab.active {
  background: var(--accent-glow);
  color: var(--accent);
}

.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ========== FORM EXTRAS ========== */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: 'Consolas', 'Monaco', monospace;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
  line-height: 1.5;
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-hint {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; display: block;
}

.form-hint code {
  background: var(--bg-input);
  padding: 1px 6px; border-radius: 4px;
  font-size: 11px; color: var(--accent);
}

.placeholders-ref {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 14px;
}

.placeholders-ref h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.placeholders-ref p {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 4px;
}

.placeholders-ref code {
  background: var(--bg-input);
  padding: 1px 6px; border-radius: 4px;
  font-size: 11px; color: var(--accent);
}

/* ========== FORM FIELD BUILDER ========== */
.form-fields-list {
  display: flex; flex-direction: column; gap: 12px;
  margin-bottom: 14px;
}

.form-field-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

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

.form-field-num { font-size: 13px; font-weight: 600; color: var(--accent); }

.form-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-field-grid .form-group { margin-bottom: 0; }

.staff-help-sec { margin-bottom: 16px; }

/* Largeur bornée : au-delà d'environ 90 caractères par ligne, l'œil perd le début
   de la ligne suivante. C'est ce qui rendait la légende pénible en pleine largeur. */
.dx-table {
  border-collapse: collapse;
  max-width: 900px;
  width: 100%;
}

.dx-table thead th {
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0 0 10px;
  text-align: left;
  text-transform: uppercase;
}

.dx-table tbody tr { border-bottom: 1px solid var(--border); }
.dx-table tbody tr:last-child { border-bottom: none; }
.dx-table tbody tr:hover { background: var(--bg-hover); }

.dx-table th[scope="row"] {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 24px 12px 10px;
  text-align: left;
  vertical-align: top;
  width: 210px;
}

.dx-table td {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 10px 12px 0;
  vertical-align: top;
}

@media (max-width: 720px) {
  .dx-table thead { display: none; }
  .dx-table tbody tr,
  .dx-table th[scope="row"],
  .dx-table td { display: block; width: auto; }
  .dx-table th[scope="row"] { padding: 12px 0 2px; }
  .dx-table td { padding: 0 0 12px; }
}

.cov-chart {
  align-items: flex-end;
  display: flex;
  gap: 4px;
  height: 120px;
  margin-bottom: 12px;
}

.cov-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
}

.cov-bar {
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  width: 100%;
}

.cov-bar-empty { background: var(--border); }

.cov-hour {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.form-checkbox {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 8px;
  min-height: 38px;
}

.form-checkbox input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  height: 16px;
  margin: 0;
  width: 16px;
}

.form-checkbox span {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ========== CLICKABLE ITEM CARD ========== */
.item-card-clickable { cursor: pointer; }
.item-card-clickable:hover { border-color: var(--accent); }

.edit-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}

.item-card-clickable:hover .edit-icon { color: var(--accent); }

/* ========== MODAL NARROW ========== */
.modal-narrow { max-width: 560px; }

/* ========== TAG INPUT ========== */
.tag-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  transition: border-color var(--transition);
  position: relative;
}

.tag-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  z-index: 20;
}

.tag-list {
  display: contents;
}

.tag-item {
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 8px 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.tag-item .tag-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.tag-remove:hover { opacity: 1; }

.tag-add-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  font-size: 13px;
  min-width: 120px;
  padding: 4px;
  font-family: inherit;
}

.tag-add-input::placeholder {
  color: var(--text-muted);
}

/* ===== Autocomplétion rôles / salons ===== */
.entity-suggestions {
  display: none;
  position: fixed;
  z-index: 3000;
  background: #1c1d26;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.ent-option {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ent-option:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.ent-prefix {
  color: var(--text-muted);
  font-weight: 600;
}

.ent-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ========== SLIDER ========== */
.slider-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.slider-value {
  font-size: 13px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-input);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
}

/* ========== AUTOMOD ========== */
.automod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.automod-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  transition: border-color var(--transition);
}

.automod-card:hover {
  border-color: var(--accent-glow);
}

.automod-info {
  flex: 1; min-width: 0;
}

.automod-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 2px;
}

.automod-desc {
  font-size: 12px; color: var(--text-secondary);
}

.automod-actions {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}

.automod-gear {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.automod-gear:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .form-row-4 { grid-template-columns: 1fr 1fr; }
}

/* ========== ANALYTICS ========== */
.period-selector {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.period-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.period-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.period-btn.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

/* ========== LEADERBOARD ========== */
.leaderboard-row {
  gap: 14px;
}

.leaderboard-rank {
  font-size: 18px; font-weight: 700;
  color: var(--text-muted);
  min-width: 40px; text-align: center;
  flex-shrink: 0;
}

.leaderboard-rank.rank-gold   { color: #ffd700; }
.leaderboard-rank.rank-silver { color: #c0c0c0; }
.leaderboard-rank.rank-bronze { color: #cd7f32; }

.leaderboard-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  object-fit: cover;
  flex-shrink: 0;
}

.leaderboard-total {
  font-size: 22px; font-weight: 700;
  color: var(--accent);
  min-width: 60px; text-align: right;
  flex-shrink: 0;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .dashboard.visible {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative; width: 100%;
    flex-direction: row; flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }
  .sidebar-nav {
    flex-direction: row; padding: 0;
    overflow-x: auto;
  }
  .sidebar-footer { display: none; }
  .content { margin-left: 0; padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* KPI */
.heatmap-grid {
  display: grid;
  grid-template-columns: 50px repeat(24, 1fr);
  gap: 2px;
  font-size: 11px;
}
.heatmap-cell {
  padding: 6px 2px;
  text-align: center;
  border-radius: 3px;
  color: #fff;
  background: #2a2d31;
}
.heatmap-cell.heatmap-label {
  background: transparent;
  color: #888;
  font-weight: 600;
}
.top-list { display: flex; flex-direction: column; gap: 8px; }
.top-row {
  display: grid;
  grid-template-columns: 40px 32px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #2a2d31;
  border-radius: 6px;
  font-size: 14px;
}
.top-rank { font-weight: 700; color: #f08119; }
.top-avatar { width: 32px; height: 32px; border-radius: 50%; }
.top-name { font-weight: 600; }
.top-score { font-weight: 600; color: #57f287; }
.top-breakdown { font-size: 12px; }
.muted { color: #888; }
.kpi-up { color: #57f287; font-size: 12px; margin-left: 6px; }
.kpi-down { color: #ed4245; font-size: 12px; margin-left: 6px; }
.period-selector { display: flex; gap: 8px; margin-top: 12px; }

/* KPI badges */
.badge-live { background: #57f287; color: #000; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.badge-static { background: #4f545c; color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 700; }
.mod-row { grid-template-columns: auto 1fr 1fr; }
.mod-type { font-weight: 600; color: #ed4245; }

/* MODÉRATION */
.mod-search { position: relative; }
.mod-search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.mod-search-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #2a2d31; border-radius: 6px; cursor: pointer; transition: background .15s; }
.mod-search-item:hover { background: #34373c; }
.mod-search-empty { padding: 10px; color: #888; }
.mod-identity { display: flex; gap: 20px; align-items: flex-start; }
.mod-avatar { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; }
.mod-id-info h2 { margin: 0 0 4px; }
.mod-id-sub { color: #949ba4; font-size: 13px; margin-bottom: 8px; }
.mod-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mod-badge { font-size: 12px; padding: 3px 9px; border-radius: 12px; font-weight: 600; background: #4f545c; color: #fff; }
.mod-badge.pink { background: #f47fff33; color: #f8b9ff; }
.mod-badge.orange { background: #f0811933; color: #ffc187; }
.mod-badge.purple { background: #9b59b633; color: #d2a8e8; }
.mod-badge.gray { background: #4f545c; color: #ccc; }
.mod-meta { font-size: 13px; color: #b5bac1; line-height: 1.8; }
.mod-role { display: inline-block; border: 1px solid #4f545c; border-left-width: 3px; border-radius: 4px; padding: 1px 7px; font-size: 12px; margin: 2px; }
.mod-row { grid-template-columns: auto 1fr auto; }
.mod-clickable { cursor: pointer; }
.mod-clickable:hover { background: #34373c; }
.mod-sanction-type { font-weight: 700; text-transform: uppercase; font-size: 11px; padding: 2px 8px; border-radius: 4px; background: #4f545c; color: #fff; }
.sanction-warn { background: #faa61a; color: #000; }
.sanction-timeout, .sanction-tempban { background: #f0811933; color: #ffc187; }
.sanction-kick { background: #ed454533; color: #ff9a9a; }
.sanction-ban { background: #ed4245; color: #fff; }
.sanction-unban, .sanction-untimeout { background: #57f28733; color: #9af2bb; }
.mod-automod-content { font-family: monospace; font-size: 13px; color: #ed9999; }
.stat-value.red { color: #ed4245; }

/* Toggle aperçu Coach */
.btn-coach-preview { width: 100%; padding: 8px 12px; margin-bottom: 10px; background: #4f545c; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .15s; }
.btn-coach-preview:hover { background: #5d6269; }
.btn-coach-preview.active { background: #f08119; color: #000; }

/* Lignes liste modération (flex robuste) */
.mod-list-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #2a2d31; border-radius: 6px; overflow: hidden; }
.mod-list-row .top-avatar { flex-shrink: 0; }
.mod-list-row .top-name { flex-shrink: 0; font-weight: 600; white-space: nowrap; }
.mod-list-row .mod-sanction-type { flex-shrink: 0; }
.mod-list-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-list-meta { margin-left: auto; flex-shrink: 0; white-space: nowrap; font-size: 12px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }

/* Reaction Roles */
.form-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Triplets d'inputs fluides (ex. config éco) */
.form-row-inputs { display: flex; gap: 8px; }
.form-row-inputs .form-input { flex: 1; min-width: 0; }
.rr-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rr-opts { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.rr-opt { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; background: #2a2d31; border-radius: 6px; }
.btn-icon-del { background: none; border: none; color: #ed4245; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.btn-icon-del:hover { background: #ed424522; }
.btn-danger-sm { background: #ed4245; color: #fff; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-danger-sm:hover { background: #c93b3e; }

/* ============================================================
   THÈME GLASSMORPHISM (couche finale — override visuel)
   ============================================================ */

/* Surfaces principales : verre dépoli */
.sidebar,
.stat-card,
.login-card,
.item-card,
.automod-card,
.chart-container,
.form-field-card,
.modal {
  background: rgba(255,255,255,0.05) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}

/* Sidebar : bord droit subtil */
.sidebar {
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
  background: rgba(255,255,255,0.035) !important;
}

/* Hover des cartes cliquables */
.stat-card:hover,
.item-card-clickable:hover {
  border-color: rgba(240,129,25,0.35) !important;
  box-shadow: 0 12px 44px rgba(240,129,25,0.12);
  transform: translateY(-1px);
  transition: all .18s ease;
}

/* Nav active : glow orange */
.nav-item.active {
  background: rgba(240,129,25,0.16) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(240,129,25,0.25);
}
.nav-item:hover:not(.active) { background: rgba(255,255,255,0.05) !important; }

/* Champs de formulaire : verre clair */
.form-input, .form-select, .form-textarea, .input-group input, .form-color {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: var(--radius) !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .input-group input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

/* Boutons primaires : dégradé orange */
.btn-primary {
  background: linear-gradient(135deg, #f08119, #ff5e62) !important;
  box-shadow: 0 6px 20px rgba(240,129,25,0.30);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(240,129,25,0.45) !important; transform: translateY(-1px); }
.btn-secondary {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: var(--text) !important;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12) !important; }

/* Lignes / éléments compacts (KPI, modo, rôles) — anciens #2a2d31 */
.top-row, .mod-list-row, .mod-search-item, .rr-opt {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.top-row, .mod-list-row { backdrop-filter: blur(6px); }
.mod-search-item:hover, .mod-clickable:hover { background: rgba(255,255,255,0.09) !important; }
.rr-opt { background: rgba(255,255,255,0.04) !important; }

/* Period selector glass */
.period-btn {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
}
.period-btn.active {
  background: linear-gradient(135deg, #f08119, #ff5e62) !important;
  color: #000 !important; border-color: transparent !important;
}

/* Modal overlay : dim sombre, panel verre */
.modal-overlay { background: rgba(5,6,12,0.65) !important; backdrop-filter: blur(4px); }

/* Login overlay garde un fond dégradé */
.login-overlay {
  background:
    radial-gradient(800px 500px at 70% 0%, rgba(240,129,25,0.18), transparent 60%),
    var(--bg-base) !important;
}

/* Toast / badges live gardent leurs couleurs sémantiques */
.badge-static { background: rgba(255,255,255,0.10) !important; }

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   UX — navigation groupée, mobile, onglets éco, accessibilité
   (couche finale — ordonnée après le thème glass)
   ============================================================ */

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Regroupement de la navigation */
.nav-section { display: block; }
.nav-section-title {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 14px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.nav-section-title:hover { color: var(--text-secondary); background: var(--bg-hover); }
/* Chevron de repli (caret bas -> droite quand replié) */
.nav-section-title::after {
  content: '▾';
  font-size: 10px;
  line-height: 1;
  opacity: 0.7;
  transition: transform var(--transition);
}
.nav-section.collapsed .nav-section-title::after { transform: rotate(-90deg); }
.nav-section.collapsed .nav-item { display: none; }
.nav-section:first-child .nav-section-title { margin-top: 0; }

/* Skeleton de chargement (bloc gris animé) */
.skeleton {
  border-radius: var(--radius);
  min-height: 16px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.12) 37%,
    rgba(255,255,255,0.05) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Bouton hamburger (mobile uniquement) */
.nav-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  width: 44px; height: 44px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.nav-toggle:hover { background: var(--bg-hover); }

/* Voile derrière la sidebar ouverte (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5,6,12,0.55);
  z-index: 99;
}

/* Onglets page Économie */
.eco-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 20px;
}
.eco-tab-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  padding: 8px 18px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.eco-tab-btn:hover { background: var(--bg-hover); color: var(--text); }
.eco-tab-btn.active {
  background: rgba(240,129,25,0.16);
  color: var(--accent);
  border-color: rgba(240,129,25,0.35);
}
.eco-tab { display: none; }
.eco-tab.active { display: block; }

/* Grilles fluides : heatmap KPI scrollable sous petit écran */
.heatmap-grid {
  min-width: 560px;
}
.heatmap-scroll,
.heatmap-wrap {
  overflow-x: auto;
}

/* Repli fond opaque si backdrop-filter non supporté */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .stat-card, .login-card, .item-card,
  .automod-card, .chart-container, .form-field-card, .modal {
    background: #35373c !important;
  }
  .sidebar { background: #232428 !important; }
  .modal-overlay { background: rgba(0,0,0,0.72) !important; }
}

/* ===== TABLETTE (701–900px) : sidebar réduite ===== */
@media (min-width: 701px) and (max-width: 900px) {
  .sidebar { width: 210px; }
  .content { margin-left: 210px; padding: 28px 28px; }
}

/* ===== MOBILE (<=700px) : sidebar off-canvas ===== */
@media (max-width: 700px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    flex-wrap: nowrap;
    padding: 24px 0;
    gap: 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    overflow-y: auto;
  }
  .sidebar.open { transform: none; }
  .sidebar-nav {
    flex-direction: column;
    padding: 16px 12px;
    overflow-x: visible;
  }
  .sidebar-footer { display: block; }

  .content { margin-left: 0; padding: 20px; }

  .nav-toggle { display: inline-flex; }
  .sidebar.open ~ .sidebar-backdrop,
  .sidebar-backdrop.visible { display: block; }

  /* Cibles tactiles : min 44x44 sur boutons icône */
  .btn-icon-del,
  .automod-gear,
  .gear,
  .modal-tab,
  .tag-remove,
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }
  .modal-tab { display: inline-flex; align-items: center; justify-content: center; }
  .tag-remove { padding: 0 8px; }

  /* Grilles d'inputs éco fluides en pile */
  .form-row-inputs { flex-wrap: wrap; }
}

/* =========================================================================
   DX — mise en page « sections à plat » (09/08/2026)
   Additif : ne remplace aucune classe existante. .form-group subsiste dans
   les fenetres modales, qui n'ont pas ete converties.
   ========================================================================= */

/* En-tête de page : titre + description + interrupteur du module */
.dx-head { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 22px; }
.dx-head-txt h1 { font-size: 28px; letter-spacing: -0.4px; margin-bottom: 6px; }
.dx-head-txt p { color: var(--text-muted); font-size: 14px; max-width: 70ch; line-height: 1.5; }
.dx-head-sp { flex: 1; }

/* Section : bloc pleine largeur séparé par un filet */
.dx-sec { border-top: 1px solid var(--border); padding: 26px 0; }
.dx-sec:first-of-type { border-top: 0; padding-top: 6px; }
.dx-sec-h { margin-bottom: 20px; }
.dx-sec-h h3 { font-size: 17px; letter-spacing: -0.2px; margin-bottom: 5px; }
.dx-sec-h p { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; max-width: 80ch; }

/* Grille de champs, 2 colonnes */
.dx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.dx-grid .dx-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .dx-grid { grid-template-columns: 1fr; } }

/* Champ : micro-label au-dessus du contrôle */
.dx-f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dx-f > label,
.dx-lab {
  font-size: 11px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-muted);
}
.dx-grid .form-input { padding: 12px 15px; font-size: 14px; border-radius: 10px; }
.dx-f .form-hint { font-size: 12.5px; color: var(--text-muted); }

/* Plusieurs contrôles sur une même ligne (min / max / cooldown) */
.dx-multi { display: flex; gap: 9px; }
.dx-multi .form-input { flex: 1; min-width: 0; }

/* Ligne d'interrupteur avec sa phrase d'explication */
.dx-tg {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 15px;
}
.dx-tg-txt { flex: 1; font-size: 13.5px; color: var(--text-secondary); line-height: 1.45; }

/* Rangée de boutons dans une section */
.dx-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Zone de liste rendue par app.js (classement, boutiques, quêtes) */
.dx-list { margin-top: 4px; }

/* ---- DX : réglage affiché en phrase + panneau d'édition dépliant ---- */
.dx-sum { display: flex; gap: 10px; align-items: stretch; }
.dx-sum-t {
  flex: 1; min-width: 0;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 15px; font-size: 14px; color: var(--text);
  display: flex; align-items: center;
}
.dx-sum-t.off { color: var(--text-muted); }
.dx-sum-b {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 13.5px; padding: 0 20px; border-radius: 10px;
  cursor: pointer; white-space: nowrap; transition: var(--transition);
}
.dx-sum-b:hover { background: var(--bg-hover); border-color: var(--accent); }
.dx-sum-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.dx-edit { display: none; margin-top: 10px; padding: 15px; border-radius: 10px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--border); }
.dx-f.open .dx-edit { display: block; }
.dx-f.open .dx-sum-t { border-color: var(--accent); }

.dx-edit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.dx-sub { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dx-sub > label {
  font-size: 12px; font-weight: 500; letter-spacing: 0;
  text-transform: none; color: var(--text-secondary);
}
.dx-edit .form-input { padding: 10px 12px; font-size: 13.5px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) { .dx-sum-b { transition: none; } }

/* =========================================================================
   DX — palette « gris neutre » (09/08/2026)
   Remplace le fond presque noir + les deux halos en dégradé par un gris plat,
   dans l'esprit du dashboard DraftBot. Bloc placé en fin de fichier : il
   redéfinit les variables de :root, donc il gagne sur les valeurs d'origine.
   Pour revenir en arrière : supprimer ce bloc.
   ========================================================================= */
:root {
  --bg-base: #2b2d31;                        /* fond de page, gris neutre */
  --bg-surface: rgba(0, 0, 0, 0.22);         /* barre latérale */
  --bg-card: rgba(255, 255, 255, 0.038);     /* surfaces surélevées */
  --bg-input: rgba(0, 0, 0, 0.24);           /* champs de saisie */
  --bg-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.075);
  --text: #dbdee1;
  --text-secondary: #b5bac1;
  --text-muted: #949ba4;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  --accent-glow: rgba(240, 129, 25, 0.22);
}

/* Fond plat : plus de halos radiaux orange et violet */
body {
  background: var(--bg-base);
  background-attachment: initial;
}


/* ---- DX : support des pages converties par renommage de classes ---- */

/* L'ancienne grille de cartes devient un simple empilement vertical */
.dx-stack { display: block; }
.dx-stack > .dx-sec:first-child { border-top: 0; padding-top: 6px; }

/* Le descriptif de l'ancienne carte devient le sous-titre de la section */
.dx-sec-h .card-desc {
  display: block; margin-top: 5px;
  color: var(--text-muted); font-size: 13.5px; line-height: 1.5; max-width: 80ch;
}
.dx-sec-h h3 { font-size: 17px; letter-spacing: -0.2px; }

/* Tout ce qui n'est pas un champ occupe la largeur entière de la grille :
   listes rendues par app.js, rangées de boutons, tableaux, graphiques... */
.dx-grid > :not(.dx-f) { grid-column: 1 / -1; }

/* Une section sans en-tête ne doit pas coller à la précédente */
.dx-sec > .dx-grid:first-child { padding-top: 2px; }

/* ---- DX : finitions (09/08/2026) ---- */

/* Les rangees d'interrupteur des pages converties automatiquement prennent
   l'allure des .dx-tg ecrites a la main. :has() n'est pas supporte partout :
   si le navigateur l'ignore, la rangee garde simplement son ancien aspect. */
.dx-grid > .form-row:has(.toggle) {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 15px;
  gap: 14px;
  justify-content: flex-start;
  flex-direction: row-reverse;   /* l'interrupteur passe a gauche, comme .dx-tg */
}
.dx-grid > .form-row:has(.toggle) > span {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Fenetres modales : memes micro-labels et memes champs que les pages */
.modal .form-group { margin-bottom: 18px; }
.modal .form-group > label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.7px;
  text-transform: uppercase; color: var(--text-muted);
}
.modal .form-input,
.modal select.form-input,
.modal textarea.form-input {
  padding: 12px 15px; font-size: 14px; border-radius: 10px;
}
.modal .form-hint { font-size: 12.5px; color: var(--text-muted); }

/* Un peu d'air en bas de page pour que la barre d'enregistrement ne colle pas */
.dx-sec:last-of-type { padding-bottom: 30px; }
