/* ═══════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — Crypto Dashboard Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --bg-color: #0e0e10;
  --surface-color: #18181b;
  --surface-alt: #1e1e22;
  --surface-hover: #1a2a3a;
  --primary-color: #f0b90b;
  --primary-hover: #1e2a3a;
  --primary-text: #0e0e10;
  --text-color: #e4e4e7;
  --text-color-muted: #a1a1aa;
  --border-color: #27272a;
  --positive-color: #22c55e;
  --negative-color: #ef4444;
  --warning-color: #eab308;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --transition-fast: 0.15s ease;

  /* Backward-compat aliases for templates */
  --accent: var(--primary-color);
  --accent-hover: #d4a20a;
  --bg-main: var(--bg-color);
  --bg-card: var(--surface-alt);
  --bg-sidebar: var(--surface-color);
  --text-main: var(--text-color);
  --text-muted: var(--text-color-muted);
  --border: var(--border-color);
}

/* ── 1b. Light Theme ───────────────────────────────────────────────────────── */
body.light-theme {
  --bg-color: #f1f1f3;
  --surface-color: #ffffff;
  --surface-alt: #f4f4f6;
  --surface-hover: #e8f0fe;
  --primary-color: #f0b90b;
  --primary-hover: #e8f0fe;
  --primary-text: #0e0e10;
  --text-color: #18181b;
  --text-color-muted: #52525b;
  --border-color: #e4e4e7;
  --positive-color: #16a34a;
  --negative-color: #dc2626;
  --warning-color: #b45309;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --bg-main: #f1f1f3;
  --bg-card: #f4f4f6;
  --bg-sidebar: #ffffff;
  --text-main: #18181b;
  --text-muted: #52525b;
  --border: #e4e4e7;
}
body.light-theme .nav-link:hover { background: rgba(0,0,0,0.05); }
body.light-theme #mainNav::-webkit-scrollbar-thumb { background: #c4c4c8; }
body.light-theme .nav-hamburger span { background: #18181b; }
body.light-theme code { background: #e8e8ec; }

/* ── 2. Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-color); text-decoration: none; }
a:hover { color: var(--accent-hover); }
/* Page titles — large, white, bold */
h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-color); }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-color); }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--text-color); }
h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-color); }
h5 { font-size: 0.9rem;  font-weight: 600; color: var(--text-color); }
h6 { font-size: 0.85rem; font-weight: 600; color: var(--text-color); }
/* Section label — uppercase small muted (use class .section-label or label element) */
label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-muted); }
p { color: var(--text-color); margin-bottom: 0.25rem; }
strong, b { font-weight: 700; }
small, .small { font-size: 0.82rem; }
code, pre, .monospace {
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 0.78rem;
}
code { background: var(--surface-alt); padding: 0.1em 0.4em; border-radius: var(--radius-sm); color: var(--primary-color); }
hr { border: none; border-top: 1px solid var(--border-color); margin: 1rem 0; }

/* ── 3. Container & Page Frame ─────────────────────────────────────────────── */
.container {
  max-width: 1440px;
  margin: auto;
  padding: 0.75rem 1rem;
}
.container-fluid { width: 100%; padding: 0 1rem; }

/* The main content area sits in a lighter "frame" panel over the dark background */
.main-content {
  max-width: 1440px;
  margin: 1rem auto;
  padding: 2rem 2.5rem;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  min-height: calc(100vh - 120px);
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .main-content {
    margin: 0.5rem;
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
}

/* ── 4. Navigation principale ──────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: flex-end; /* Align to bottom so border-bottom lands at header edge */
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
  background-color: var(--surface-color);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  min-height: 56px;
}
.site-logo { height: 36px; width: auto; max-width: 140px; flex-shrink: 0; border-radius: var(--radius-sm); align-self: center; margin-bottom: 0.4rem; object-fit: contain; }
#mainNav {
  display: flex;
  flex-grow: 1;
  gap: 0.15rem;
  background-color: transparent;
  padding: 0;
  border: none;
  overflow-x: auto;
  white-space: nowrap;
}
#mainNav::-webkit-scrollbar { height: 3px; }
#mainNav::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.nav-link {
  color: var(--text-color-muted);
  text-decoration: none;
  padding: 0.85rem 1.1rem 0.6rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
  font-size: 0.88rem;
  font-weight: 500;
  flex-shrink: 0;
  display: inline-block;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 3px solid transparent; /* Reserve space so active border doesn't shift layout */
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--text-color); }

/* Active nav: thick yellow bottom border, bright text, no yellow background */
.nav-link.active {
  background: rgba(240,185,11,0.08) !important;
  color: var(--text-color) !important;
  font-weight: 700;
  border-bottom: 3px solid var(--primary-color) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}
#mainNav .nav-link.active,
.site-header #mainNav a.active {
  background: rgba(240,185,11,0.08) !important;
  color: var(--text-color) !important;
  font-weight: 700;
  border-bottom: 3px solid var(--primary-color) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
}
.nav-link.nav-admin {
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.4);
}
.nav-link.nav-admin:hover { background: rgba(251,191,36,0.15); color: #fbbf24; }
/* Old compat class */
.nav-link-admin {
  color: var(--primary-color) !important;
  border: 1px solid rgba(240,185,11,0.4) !important;
}
.nav-link-admin:hover { background: var(--primary-color) !important; color: var(--primary-text) !important; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 0.4rem;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  width: 40px; height: 40px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  align-self: center;
  margin-bottom: 0.4rem;
}
.nav-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text-color);
  transition: 0.2s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Badge plan (in nav) */
.badge-credits {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(240, 185, 11, 0.12);
  color: var(--accent, #f0b90b);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: monospace;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
  margin-right: 0.4rem;
}
.badge-credits i { font-size: 0.7rem; }

.badge-plan {
  display: inline-flex;
  align-items: center;
  background: var(--primary-color);
  color: var(--primary-text);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── 5. Sidebar (admin/sections) ───────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.admin-sidebar-nav {
  position: sticky;
  top: 5rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-color-muted);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.admin-nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text-color); }
.admin-nav-link.active { background: var(--primary-color); color: var(--primary-text); font-weight: 600; }
.nav-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--text-color-muted);
  flex-shrink: 0;
}
.admin-nav-link.active .nav-dot { background: var(--primary-text); }
.admin-content { min-width: 0; }

/* ── 6. Cartes / Panels ────────────────────────────────────────────────────── */
/* Cards sit on top of the page frame (surface-color), so they use surface-alt */
.card {
  background-color: var(--surface-alt);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
  color: var(--text-color);
}
.card:hover { border-color: #3f3f46; }
.card-lg {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}
.card-body { color: var(--text-color); padding: 0.5rem 0; }

/* ── 7. Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.2rem;
  background-color: var(--primary-color);
  color: var(--primary-text);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { background: var(--primary-hover); color: white; transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }

/* btn-accent = alias */
.btn-accent { background-color: var(--primary-color); color: var(--primary-text); border: none; }
.btn-accent:hover { background: var(--accent-hover); color: var(--primary-text); transform: translateY(-1px); }

/* Small */
.btn-sm {
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Outline variants */
.btn-outline-secondary {
  background: transparent;
  color: var(--text-color-muted);
  border: 1px solid var(--border-color);
}
.btn-outline-secondary:hover { border-color: var(--primary-color); color: var(--primary-color); background: transparent; transform: translateY(-1px); }

.btn-outline-danger {
  background: transparent;
  color: #f87171;
  border: 1px solid #f87171;
}
.btn-outline-danger:hover { background: rgba(239,68,68,0.1); color: #f87171; transform: translateY(-1px); }

.btn-outline-warning {
  background: transparent;
  color: var(--warning-color);
  border: 1px solid var(--warning-color);
}
.btn-outline-warning:hover { background: rgba(234,179,8,0.1); color: var(--warning-color); transform: translateY(-1px); }

.btn-outline-info {
  background: transparent;
  color: #60a5fa;
  border: 1px solid #60a5fa;
}
.btn-outline-info:hover { background: rgba(96,165,250,0.1); color: #60a5fa; transform: translateY(-1px); }

.btn-danger { background: var(--negative-color); color: white; border: none; }
.btn-danger:hover { background: #dc2626; color: white; transform: translateY(-1px); }
.btn-success { background: var(--positive-color); color: #0e0e10; border: none; }
.btn-success:hover { background: #16a34a; color: #0e0e10; transform: translateY(-1px); }

/* Button group */
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group-sm .btn { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* Close button */
.btn-close {
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  font-size: 1rem;
  color: var(--text-color);
  padding: 0.25rem;
  line-height: 1;
  transition: opacity var(--transition-fast);
}
.btn-close::before { content: "✕"; }
.btn-close:hover { opacity: 1; }
.btn-close-white { color: white; }

/* w-100 button */
.btn.w-100, button.w-100 { width: 100%; }

/* ── 8. Formulaires ────────────────────────────────────────────────────────── */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="datetime-local"], input[type="date"],
input[type="url"], input[type="search"], textarea, select,
.form-control, .form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--surface-alt);
  color: var(--text-color);
  font-size: 0.85rem;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
input:focus, textarea:focus, select:focus,
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(240,185,11,0.15);
}
input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-alt) inset !important;
  -webkit-text-fill-color: var(--text-color) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-color-muted); opacity: 1; }
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"] { accent-color: var(--primary-color); width: auto; }
input[type="radio"] { accent-color: var(--primary-color); width: auto; }
select option { background: var(--surface-color); color: var(--text-color); }

/* Small variant */
.form-control-sm, .form-select-sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}
.form-select { cursor: pointer; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-color-muted);
  margin-bottom: 0.4rem;
}
.form-text { font-size: 0.8rem; color: var(--text-color-muted); margin-top: 0.35rem; line-height: 1.5; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: auto !important; margin: 0; }
.form-check-label { font-size: 0.85rem; color: var(--text-color); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Toggle switch */
.form-switch .form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 2.5rem !important;
  height: 1.25rem;
  background: var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
  border: none;
}
.form-switch .form-check-input::before {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 0.9rem;
  height: 0.9rem;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.form-switch .form-check-input:checked { background: var(--primary-color); }
.form-switch .form-check-input:checked::before { transform: translateX(1.25rem); }

/* Input group */
.input-group { display: flex; gap: 0; }
.input-group .form-control { flex: 1; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-group-text {
  padding: 0.5rem 0.75rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-color-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* ── 9. Tableaux ───────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
.table { width: 100%; border-collapse: collapse; color: var(--text-color); }
thead th, .table thead th {
  background-color: var(--surface-alt);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-color-muted);
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 1;
  text-align: left;
}
tbody td, .table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
  color: var(--text-color);
}
tbody tr:hover, .table-hover tbody tr:hover { background-color: rgba(255,255,255,0.04); }
.table-responsive { overflow-x: auto; }

/* ── 10. Messages / Alertes ────────────────────────────────────────────────── */
.message, .alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-color);
}
.message.success, .alert-success {
  background: rgba(34,197,94,0.1); color: #86efac; border-color: var(--positive-color);
}
.message.error, .alert-danger {
  background: rgba(239,68,68,0.1); color: #fca5a5; border-color: var(--negative-color);
}
.message.info, .alert-info, .alert-primary {
  background: rgba(59,130,246,0.1); color: #93c5fd; border-color: #3b82f6;
}
.message.warning, .alert-warning {
  background: rgba(234,179,8,0.1); color: #fde047; border-color: var(--warning-color);
}
.alert-banner { border-radius: 0; border-left: 4px solid; border-top: none; border-right: none; border-bottom: none; margin-bottom: 0; }
.alert-dismissible { position: relative; padding-right: 2.5rem; }
.alert-dismissible .btn-close { position: absolute; top: 0.5rem; right: 0.5rem; }
.alert.d-none { display: none; }

/* ── 11. Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-free    { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-basic   { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.badge-pro     { background: rgba(52,211,153,0.15);  color: #34d399; }
.badge-premium { background: rgba(192,132,252,0.15); color: #c084fc; }
.badge-vip     { background: rgba(240,185,11,0.18);  color: #f0b90b; }

/* Bootstrap badge color compat */
.badge.bg-success  { background: rgba(34,197,94,0.15)  !important; color: #86efac; }
.badge.bg-danger   { background: rgba(239,68,68,0.15)  !important; color: #fca5a5; }
.badge.bg-warning  { background: rgba(234,179,8,0.15)  !important; color: #fde047; }
.badge.bg-secondary{ background: rgba(113,113,122,0.2) !important; color: #a1a1aa; }
.badge.bg-primary  { background: rgba(59,130,246,0.15) !important; color: #93c5fd; }
.badge.bg-info     { background: rgba(6,182,212,0.15)  !important; color: #67e8f9; }
.badge.text-dark   { color: var(--primary-text) !important; }

/* ── 12. Sélecteur de langue (drapeaux) ────────────────────────────────────── */
.locale-switcher { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.locale-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 0.3rem 0.25rem; border-radius: var(--radius-sm);
  opacity: 0.4; transition: opacity var(--transition-fast);
  display: flex; align-items: center;
}
.locale-btn:hover, .locale-btn.active { opacity: 1; }
.fi { width: 20px; height: 15px; border-radius: 2px; }

/* ── Theme toggle button ───────────────────────────────────────────────────── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-color-muted);
  font-size: 0.88rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--primary-color); border-color: var(--primary-color); background: rgba(240,185,11,0.08); }

/* ── 13. KPI Grid ──────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}
.kpi-card {
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.kpi-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-color-muted); }
.kpi-value { font-size: 1.1rem; font-weight: 700; margin-top: 0.25rem; color: var(--text-color); }
.kpi-value.positive { color: var(--positive-color); }
.kpi-value.negative { color: var(--negative-color); }

/* ── 14. Logs ──────────────────────────────────────────────────────────────── */
.logs-container {
  background-color: #09090b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
}

/* ── 15. Tab system ────────────────────────────────────────────────────────── */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
}
.nav-tabs .nav-item { display: inline-flex; }
.nav-tabs .nav-link {
  color: var(--text-color-muted);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 0.83rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-block;
  text-transform: none;
  letter-spacing: 0;
}
.nav-tabs .nav-link:hover { color: var(--text-color); background: var(--surface-alt); }
.nav-tabs .nav-link.active {
  background: var(--surface-alt);
  color: var(--text-color) !important;
  border-color: var(--border-color) var(--border-color) var(--surface-alt);
  font-weight: 600;
}
.tab-content { color: var(--text-color); }
.tab-pane { display: none; }
.tab-pane.show.active { display: block; }
.tab-pane.fade { opacity: 0; transition: opacity 0.15s ease; }
.tab-pane.fade.show { opacity: 1; }

/* ── 16. Modal ─────────────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.show { display: flex; }
.modal-dialog { width: 100%; max-width: 600px; }
.modal-dialog.modal-xl { max-width: 1100px; }
.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog-scrollable .modal-content { max-height: 90vh; display: flex; flex-direction: column; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-content {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-color);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-title { font-weight: 600; font-size: 1rem; }
.modal-body { padding: 1.25rem; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

/* ── 17. Spinner ────────────────────────────────────────────────────────────── */
.spinner-border {
  display: inline-block;
  width: 2rem; height: 2rem;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 2px; }
.text-warning .spinner-border, .spinner-border.text-warning { border-top-color: var(--warning-color); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 18. Animations ─────────────────────────────────────────────────────────── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}
.skeleton {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOOTSTRAP COMPATIBILITY LAYER
   Provides utility classes used in templates, without Bootstrap dependency
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0;
}
.row.g-1 { gap: 0.25rem; }
.row.g-2 { gap: 0.5rem; }
.row.g-3 { gap: 1rem; }
.row.g-4 { gap: 1.5rem; }
.row.g-5 { gap: 3rem; }

/* Non-responsive cols (always apply) */
.col-1  { grid-column: span 1;  }
.col-2  { grid-column: span 2;  }
.col-3  { grid-column: span 3;  }
.col-4  { grid-column: span 4;  }
.col-5  { grid-column: span 5;  }
.col-6  { grid-column: span 6;  }
.col-7  { grid-column: span 7;  }
.col-8  { grid-column: span 8;  }
.col-9  { grid-column: span 9;  }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Responsive cols — default: full width (mobile first) */
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,
.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,
.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,
.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,
.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,
.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12 {
  grid-column: span 12;
}

@media (min-width: 576px) {
  .col-sm-1  { grid-column: span 1;  }
  .col-sm-2  { grid-column: span 2;  }
  .col-sm-3  { grid-column: span 3;  }
  .col-sm-4  { grid-column: span 4;  }
  .col-sm-5  { grid-column: span 5;  }
  .col-sm-6  { grid-column: span 6;  }
  .col-sm-7  { grid-column: span 7;  }
  .col-sm-8  { grid-column: span 8;  }
  .col-sm-9  { grid-column: span 9;  }
  .col-sm-10 { grid-column: span 10; }
  .col-sm-11 { grid-column: span 11; }
  .col-sm-12 { grid-column: span 12; }
}

@media (min-width: 768px) {
  .col-md-1  { grid-column: span 1;  }
  .col-md-2  { grid-column: span 2;  }
  .col-md-3  { grid-column: span 3;  }
  .col-md-4  { grid-column: span 4;  }
  .col-md-5  { grid-column: span 5;  }
  .col-md-6  { grid-column: span 6;  }
  .col-md-7  { grid-column: span 7;  }
  .col-md-8  { grid-column: span 8;  }
  .col-md-9  { grid-column: span 9;  }
  .col-md-10 { grid-column: span 10; }
  .col-md-11 { grid-column: span 11; }
  .col-md-12 { grid-column: span 12; }
}

@media (min-width: 992px) {
  .col-lg-1  { grid-column: span 1;  }
  .col-lg-2  { grid-column: span 2;  }
  .col-lg-3  { grid-column: span 3;  }
  .col-lg-4  { grid-column: span 4;  }
  .col-lg-5  { grid-column: span 5;  }
  .col-lg-6  { grid-column: span 6;  }
  .col-lg-7  { grid-column: span 7;  }
  .col-lg-8  { grid-column: span 8;  }
  .col-lg-9  { grid-column: span 9;  }
  .col-lg-10 { grid-column: span 10; }
  .col-lg-11 { grid-column: span 11; }
  .col-lg-12 { grid-column: span 12; }
}

/* Row justify center — flex override for centering single cols */
.row.justify-content-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.row.justify-content-center [class*="col-"] {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
}
@media (min-width: 992px) {
  .row.justify-content-center .col-lg-6 { width: 50%; }
  .row.justify-content-center .col-lg-4 { width: 33.33%; }
  .row.justify-content-center .col-lg-8 { width: 66.66%; }
}
@media (min-width: 768px) {
  .row.justify-content-center .col-md-6 { width: 50%; }
  .row.justify-content-center .col-md-4 { width: 33.33%; }
  .row.justify-content-center .col-md-8 { width: 66.66%; }
}

/* h-100 inside grid needs special treatment */
.h-100 { height: 100%; }
.row > [class*="col-"] { min-width: 0; }

/* ── Flex utilities ─────────────────────────────────────────────────────────── */
.d-flex    { display: flex !important; }
.d-grid    { display: grid !important; }
.d-block   { display: block !important; }
.d-inline  { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-none    { display: none !important; }

.flex-row    { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap   { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-1      { flex: 1 !important; }

.align-items-start   { align-items: flex-start !important; }
.align-items-center  { align-items: center !important; }
.align-items-end     { align-items: flex-end !important; }
.align-self-start    { align-self: flex-start !important; }
.align-self-center   { align-self: center !important; }
.align-self-end      { align-self: flex-end !important; }

.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* ── Spacing utilities ──────────────────────────────────────────────────────── */
/* Margin */
.m-0  { margin: 0 !important; }
.m-1  { margin: 0.25rem !important; }
.m-2  { margin: 0.5rem !important; }
.m-3  { margin: 1rem !important; }
.m-4  { margin: 1.5rem !important; }
.m-5  { margin: 3rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mx-1  { margin-left: 0.25rem !important; margin-right: 0.25rem !important; }
.mx-2  { margin-left: 0.5rem !important; margin-right: 0.5rem !important; }
.my-2  { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3  { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4  { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

/* Padding */
.p-0  { padding: 0 !important; }
.p-1  { padding: 0.25rem !important; }
.p-2  { padding: 0.5rem !important; }
.p-3  { padding: 1rem !important; }
.p-4  { padding: 1.5rem !important; }
.p-5  { padding: 3rem !important; }
.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: 0.25rem !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.ps-0 { padding-left: 0 !important; }
.ps-2 { padding-left: 0.5rem !important; }
.ps-3 { padding-left: 1rem !important; }
.pe-0 { padding-right: 0 !important; }
.pe-2 { padding-right: 0.5rem !important; }
.pe-3 { padding-right: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }

/* ── Typography utilities ───────────────────────────────────────────────────── */
.text-muted   { color: var(--text-color-muted) !important; }
.text-center  { text-align: center !important; }
.text-start   { text-align: left !important; }
.text-end     { text-align: right !important; }
.text-dark    { color: #0e0e10 !important; }
.text-white   { color: #fff !important; }
.text-success { color: var(--positive-color) !important; }
.text-danger  { color: var(--negative-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info    { color: #60a5fa !important; }

.fw-normal   { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-bolder   { font-weight: 800 !important; }

.fs-1 { font-size: 2rem !important; }
.fs-2 { font-size: 1.5rem !important; }
.fs-3 { font-size: 1.25rem !important; }
.fs-4 { font-size: 1.1rem !important; }
.fs-5 { font-size: 0.95rem !important; }
.fs-6 { font-size: 0.85rem !important; }

.small, .small * { font-size: 0.82rem; }
.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-nowrap    { white-space: nowrap !important; }

/* ── Sizing ─────────────────────────────────────────────────────────────────── */
.w-25  { width: 25% !important; }
.w-50  { width: 50% !important; }
.w-75  { width: 75% !important; }
.w-100 { width: 100% !important; }
.w-auto{ width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100{ max-width: 100% !important; }
.vw-100{ width: 100vw !important; }
.min-vw-100 { min-width: 100vw !important; }

/* ── Border utilities ───────────────────────────────────────────────────────── */
.border         { border: 1px solid var(--border-color) !important; }
.border-0       { border: none !important; }
.border-top     { border-top: 1px solid var(--border-color) !important; }
.border-bottom  { border-bottom: 1px solid var(--border-color) !important; }
.border-warning { border-color: var(--warning-color) !important; }
.border-success { border-color: var(--positive-color) !important; }
.border-danger  { border-color: var(--negative-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.rounded    { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-0  { border-radius: 0 !important; }

/* ── List utilities ─────────────────────────────────────────────────────────── */
.list-unstyled { list-style: none; padding-left: 0; }

/* ── Position ───────────────────────────────────────────────────────────────── */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-sticky   { position: sticky !important; }

/* ── Overflow ───────────────────────────────────────────────────────────────── */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.overflow-x-auto { overflow-x: auto !important; }

/* ── Cursor ─────────────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer !important; }

/* ── ═══════════════════ RESPONSIVE ═══════════════════ ── */

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar-nav {
    position: static;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
  .admin-sidebar-nav::-webkit-scrollbar { height: 3px; }
  .admin-sidebar-nav::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
  .admin-nav-link { flex: 0 0 auto; scroll-snap-align: start; }
  .nav-dot { display: none; }
}

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  #mainNav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 199;
  }
  #mainNav.open { display: flex; }
  #mainNav .nav-link { flex: 1 1 calc(50% - 0.3rem); justify-content: center; text-align: center; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; }
  .admin-layout { grid-template-columns: 1fr; }

  /* Responsive table helper */
  .table-responsive-collapse td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-color-muted);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
  }

  /* hide ms-auto on mobile for nav */
  .nav-right .ms-auto { margin-left: 0 !important; }
}

@media (max-width: 480px) {
  .main-content { padding: 0.75rem 0.5rem; }
  .kpi-grid { grid-column: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM AIRING — More breathing room for dense form sections
   ═══════════════════════════════════════════════════════════════════════════ */

/* Larger gap between form grid cells */
.pub-section .row.g-3,
.card .row.g-3,
.card-lg .row.g-3 {
  row-gap: 1.4rem;
}

/* Section dividers inside form grids — the inline-styled uppercase <p> elements */
/* Matches: <div class="col-12 mt-2"><p class="text-muted small ... text-uppercase"> */
.pub-section .col-12 > p.text-uppercase,
.card .col-12 > p.text-uppercase {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em;
  color: var(--primary-color) !important;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

/* Override mt-2 on section-divider col-12 to give more breathing room */
.pub-section .row > .col-12.mt-2 {
  margin-top: 1.5rem !important;
}

/* Inputs inside form sections — more vertical padding */
.pub-section input.form-control,
.pub-section textarea.form-control,
.pub-section select.form-control {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}

/* form-text helper under inputs */
.pub-section .form-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-color-muted);
  margin-top: 0.4rem;
}

/* Publications sidebar items — more airy */
.pub-sidebar .sidebar-item {
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

/* Save button row at bottom of config section */
.pub-section .save-row {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* ── Claude Terminal Float (admin only) ─────────────────────────────────── */
#claude-fab {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  background: var(--primary-color); border: none; cursor: pointer;
  font-size: 1.4rem; box-shadow: 0 4px 20px rgba(240,185,11,.5);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
#claude-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(240,185,11,.7); }
#claude-win {
  position: fixed; bottom: 5.8rem; right: 1.5rem; z-index: 9998;
  width: min(960px, calc(100vw - 2rem));
  height: min(600px, calc(100vh - 8rem));
  background: #0d1117; border: 1px solid var(--border-color);
  border-radius: 14px; display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.75); overflow: hidden;
  resize: both; min-width: 340px; min-height: 220px;
}
#claude-win.claude-hidden { display: none !important; }
.claude-titlebar {
  display: flex; align-items: center; gap: .5rem; padding: .65rem 1rem;
  background: var(--surface-color); border-bottom: 1px solid var(--border-color);
  cursor: grab; user-select: none; flex-shrink: 0;
}
.claude-titlebar:active { cursor: grabbing; }
.claude-title-left { display: flex; gap: .35rem; flex: 1; align-items: center; flex-wrap: wrap; }
.claude-badge {
  font-size: .65rem; font-weight: 700; padding: .15rem .4rem; border-radius: 4px;
  background: rgba(240,185,11,.12); color: var(--primary-color);
  border: 1px solid rgba(240,185,11,.25);
}
#claude-status-dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: #6c757d; flex-shrink: 0;
}
#claude-status-dot.connected { background: #22c55e; }
#claude-status-dot.thinking {
  background: var(--primary-color);
  animation: cdot-pulse .8s ease infinite;
}
@keyframes cdot-pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
#claude-tool-indicator {
  font-size: .7rem; color: var(--text-color-muted);
  display: none; align-items: center; gap: .25rem;
}
#claude-tool-indicator.active { display: flex; }
.claude-spinner { animation: cspin .8s linear infinite; display: inline-block; }
@keyframes cspin { to { transform: rotate(360deg); } }
#claude-messages {
  flex: 1; overflow-y: auto; padding: .75rem 1rem;
  display: flex; flex-direction: column; gap: .65rem;
}
.claude-bubble {
  max-width: 85%; padding: .55rem .85rem; border-radius: 12px;
  font-size: .85rem; line-height: 1.5; word-break: break-word;
}
.claude-bubble.user {
  align-self: flex-end; background: rgba(240,185,11,.18);
  border: 1px solid rgba(240,185,11,.3); color: var(--text-color);
}
.claude-bubble.assistant {
  align-self: flex-start; background: var(--surface-color);
  border: 1px solid var(--border-color); color: var(--text-color);
}
.claude-bubble.assistant p { margin: 0 0 .4rem; }
.claude-bubble.assistant p:last-child { margin-bottom: 0; }
.claude-bubble.assistant pre {
  background: rgba(0,0,0,.4); border-radius: 6px; padding: .5rem;
  overflow-x: auto; font-size: .78rem; margin: .3rem 0;
}
.claude-bubble.assistant ul, .claude-bubble.assistant ol { padding-left: 1.2rem; margin: .3rem 0; }
.claude-thinking-bubble {
  align-self: flex-start; max-width: 85%; margin-bottom: .3rem;
  border-radius: 10px; overflow: hidden; font-size: .78rem;
  border: 1px solid rgba(139,92,246,.3);
}
.claude-thinking-bubble summary {
  cursor: pointer; padding: .35rem .7rem;
  background: rgba(139,92,246,.1); color: rgba(139,92,246,.9);
  user-select: none; list-style: none; display: flex; align-items: center; gap: .4rem;
}
.claude-thinking-bubble summary::-webkit-details-marker { display: none; }
.claude-thinking-bubble summary::before { content: '▶'; font-size: .6rem; transition: transform .15s; }
.claude-thinking-bubble[open] summary::before { transform: rotate(90deg); }
.claude-thinking-content {
  padding: .5rem .7rem; background: rgba(139,92,246,.05);
  color: var(--text-color-muted); white-space: pre-wrap; line-height: 1.5;
  max-height: 300px; overflow-y: auto;
}
/* ── Blocs outils inline ─────────────────────────────────────── */
.claude-tool-block, .claude-tool-result-block {
  align-self: flex-start; max-width: 92%;
  border-radius: 7px; overflow: hidden; font-size: .74rem;
  border: 1px solid rgba(59,130,246,.3); margin: .1rem 0;
}
.claude-tool-block summary {
  cursor: pointer; padding: .28rem .6rem; list-style: none;
  background: rgba(59,130,246,.08); color: rgba(120,170,255,.95);
  user-select: none; display: flex; align-items: center; gap: .35rem;
}
.claude-tool-result-block { border-color: rgba(34,197,94,.28); }
.claude-tool-result-block summary {
  cursor: pointer; padding: .28rem .6rem; list-style: none;
  background: rgba(34,197,94,.07); color: rgba(100,200,130,.9);
  user-select: none; display: flex; align-items: center; gap: .35rem;
}
.claude-tool-block summary::-webkit-details-marker,
.claude-tool-result-block summary::-webkit-details-marker { display: none; }
.claude-tool-block summary::before,
.claude-tool-result-block summary::before { content: '▶'; font-size: .5rem; transition: transform .15s; flex-shrink: 0; }
.claude-tool-block[open] summary::before,
.claude-tool-result-block[open] summary::before { transform: rotate(90deg); }
.claude-tool-pre {
  padding: .4rem .6rem; margin: 0;
  background: rgba(0,0,0,.35); color: var(--text-color-muted);
  white-space: pre-wrap; word-break: break-all;
  line-height: 1.4; font-size: .71rem;
  max-height: 220px; overflow-y: auto;
}
/* ─────────────────────────────────────────────────────────────── */
.claude-typing-dots span {
  display: inline-block; width: .45rem; height: .45rem; margin: 0 .1rem;
  border-radius: 50%; background: var(--text-color-muted);
  animation: ctyping .9s ease infinite;
}
.claude-typing-dots span:nth-child(2) { animation-delay: .15s; }
.claude-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ctyping { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }
.claude-inputbar {
  display: flex; align-items: flex-end; gap: .5rem; padding: .65rem 1rem;
  border-top: 1px solid var(--border-color); flex-shrink: 0;
  background: var(--surface-color);
}
#claude-input {
  flex: 1; resize: none; border: 1px solid var(--border-color); border-radius: 8px;
  padding: .45rem .7rem; font-size: .85rem; background: var(--surface-alt);
  color: var(--text-color); min-height: 2.2rem; max-height: 8rem;
  line-height: 1.4; font-family: inherit; outline: none;
}
#claude-input:focus { border-color: var(--primary-color); }
.claude-send-btn {
  flex-shrink: 0; width: 2.2rem; height: 2.2rem; border-radius: 8px;
  background: var(--primary-color); color: #000; border: none;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  transition: opacity .15s; display: flex; align-items: center; justify-content: center;
}
.claude-send-btn:disabled { opacity: .4; cursor: not-allowed; }
.claude-img-btn {
  flex-shrink: 0; width: 2.2rem; height: 2.2rem; border-radius: 8px;
  background: transparent; color: var(--text-color-muted);
  border: 1px solid var(--border-color); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}
.claude-img-btn:hover { color: var(--primary-color); }
#claude-img-preview { display: none; padding: .3rem 1rem; position: relative; }
#claude-img-preview img { max-height: 80px; border-radius: 6px; border: 1px solid var(--border-color); }
.claude-rm-img {
  position: absolute; top: 0; right: .75rem; width: 1.1rem; height: 1.1rem;
  border-radius: 50%; background: var(--primary-color); color: #000;
  border: none; cursor: pointer; font-size: .6rem;
  display: flex; align-items: center; justify-content: center;
}
/* Titlebar actions */
.claude-title-actions {
  display: flex; align-items: center; gap: .3rem; flex-shrink: 0;
}
.ctb-btn {
  background: transparent; border: 1px solid var(--border-color); color: #ffffff;
  border-radius: 5px; padding: .15rem .4rem; font-size: .7rem; font-weight: 600;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: .2rem;
  transition: background .12s, color .12s;
}
.ctb-btn:hover { background: var(--surface-hover); color: var(--text-color); }
.ctb-stop     { color: #ef4444; border-color: rgba(239,68,68,.4); }
.ctb-stop:hover { background: rgba(239,68,68,.12); color: #ef4444; }
.ctb-model-btn {
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.35); color: #a5b4fc;
  border-radius: 5px; padding: .13rem .38rem; font-size: .65rem; font-weight: 700;
  cursor: pointer; font-family: inherit; display: inline-flex; align-items: center;
  transition: background .12s, color .12s; white-space: nowrap;
}
.ctb-model-btn:hover { background: rgba(99,102,241,.25); color: #c7d2fe; }
.ctb-model-btn--max { background: rgba(240,185,11,.1); border-color: rgba(240,185,11,.4); color: #f0b90b; }
.ctb-model-btn--max:hover { background: rgba(240,185,11,.2); color: #fcd34d; }
.ctb-model-btn--deepseek { background: rgba(56,139,253,.12); border-color: rgba(56,139,253,.45); color: #79b8ff; }
.ctb-model-btn--deepseek:hover { background: rgba(56,139,253,.22); color: #c8e1ff; }
.ctb-approve  { color: #22c55e; border-color: rgba(34,197,94,.4); }
.ctb-approve:hover { background: rgba(34,197,94,.12); }
.ctb-deny     { color: #ef4444; border-color: rgba(239,68,68,.4); }
.ctb-deny:hover { background: rgba(239,68,68,.12); }
.ctb-close    { font-size: .85rem; }
.ctb-approval         { font-size: .8rem; }
.ctb-approval.active  { background: rgba(240,185,11,.12); color: var(--primary-color); border-color: rgba(240,185,11,.4); }

/* Badge queue */
#claude-queue-badge {
  display: none; font-size: .65rem; font-weight: 700;
  background: rgba(240,185,11,.18); color: var(--primary-color);
  border: 1px solid rgba(240,185,11,.3); border-radius: 4px; padding: .1rem .35rem;
}

/* Bandeau d'approbation */
#claude-approval-bar {
  display: none; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .5rem 1rem; background: rgba(240,185,11,.08);
  border-bottom: 1px solid rgba(240,185,11,.25); flex-shrink: 0; flex-wrap: wrap;
}
#claude-approval-text { font-size: .78rem; color: var(--text-color); flex: 1; min-width: 0; word-break: break-word; }
.claude-approval-btns { display: flex; gap: .35rem; flex-shrink: 0; }

/* Console pm2 */
#claude-console {
  display: none; flex: 1; overflow-y: auto; flex-direction: column;
  background: #0a0e14; padding: .4rem .6rem; gap: 0;
  font-family: 'Courier New', Courier, monospace;
}
.claude-console-line {
  font-size: .72rem; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
  color: #8db4c8; padding: .02rem 0;
}
.claude-console-line:empty { min-height: .8rem; }
/* Coloration des niveaux de log */
.claude-console-line[data-level="error"] { color: #f87171; }

/* Bouton console dans titlebar */
#claude-console-btn { font-size: .82rem; padding: .15rem .4rem; }
#claude-console-btn.active {
  background: rgba(34,197,94,.12); color: #22c55e;
  border-color: rgba(34,197,94,.4);
}

/* ── PTY terminal container ───────────────────────────────────────────────── */
#pty-container {
  flex: 1; overflow: hidden; padding: 4px 0 4px 6px;
  background: #0d1117; min-height: 0;
}

/* ── PTY input bar — calque flottant (pointer-events: none → scroll passe à travers) ── */
#pty-input-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 20px 8px 8px; z-index: 2; display: flex;
  flex-direction: column; gap: 5px;
  background: #0d1117;
  pointer-events: none;
}
#pty-staged-img {
  display: none; align-items: center; gap: 8px;
  padding: 4px 6px; background: #161b22; border-radius: 6px;
  border: 1px solid #30363d;
  pointer-events: auto;
}
#pty-staged-img img {
  height: 38px; border-radius: 4px; object-fit: cover;
}
#pty-staged-img span { flex: 1; font-size: .72rem; color: #8b949e; }
#pty-staged-img button {
  background: none; border: none; color: #8b949e; cursor: pointer;
  font-size: .85rem; padding: 0 4px; line-height: 1;
}
#pty-staged-img button:hover { color: #ff7b72; }
.pty-input-row { display: flex; gap: 6px; align-items: flex-end; pointer-events: auto; }
#pty-chat-input {
  flex: 1; background: #161b22; color: #c9d1d9;
  border: 1px solid #30363d; border-radius: 6px;
  padding: 7px 10px; font-family: inherit; font-size: .875rem;
  resize: none; height: 96px; min-height: 96px; max-height: 96px;
  line-height: 1.5; outline: none; overflow-y: auto;
}
#pty-chat-input:focus { border-color: rgba(240,185,11,.5); }
#pty-chat-input::placeholder { color: #484f58; font-size: .8rem; }
#pty-send-btn {
  background: #f0b90b; color: #000; border: none; border-radius: 6px;
  padding: 0 16px; font-weight: 700; font-size: .8rem; cursor: pointer;
  align-self: stretch; white-space: nowrap; flex-shrink: 0;
}
#pty-send-btn:hover { background: #ffcc33; }
#pty-send-btn:active { background: #d4a30a; }
@media (max-width: 767px) {
  #pty-input-bar { padding: 16px 6px 6px; }
  #pty-send-btn { padding: 0 10px; font-size: .75rem; }
}
#pty-container .xterm { height: 100%; }
#pty-container .xterm-viewport { border-radius: 0; overflow-y: scroll !important; }
/* Scrollbar xterm toujours visible pour permettre de remonter */
#pty-container .xterm-viewport::-webkit-scrollbar { width: 8px; }
#pty-container .xterm-viewport::-webkit-scrollbar-track { background: #0d1117; }
#pty-container .xterm-viewport::-webkit-scrollbar-thumb {
  background: rgba(240,185,11,0.45); border-radius: 4px;
}
#pty-container .xterm-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(240,185,11,0.75);
}
#pty-dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: #6c757d; flex-shrink: 0;
}
#pty-dot.connected { background: #22c55e; }
#pty-dot.thinking {
  background: var(--primary-color);
  animation: cdot-pulse .8s ease infinite;
}
/* Indicateur de statut dynamique */
.pty-status {
  font-size: .62rem; font-weight: 500; padding: 2px 8px;
  border-radius: 99px; letter-spacing: .03em;
  transition: opacity .3s, background .3s, color .3s;
  opacity: 0;
}
.pty-status-idle    { opacity: 1; background: #14532d; color: #4ade80; }
.pty-status-active  {
  opacity: 1; background: #172554; color: #60a5fa;
  animation: pty-pulse 1.8s ease-in-out infinite;
}
@keyframes pty-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: .55; }
}
/* Titlebar terminal (fond sombre) */
#claude-win .claude-titlebar {
  background: #161b22; border-bottom-color: #30363d;
}

@media (max-width: 767px) {
  #claude-win { width: calc(100vw - 1rem); height: 55vh; right: .5rem; bottom: 5rem; }
  #claude-fab { right: .75rem; bottom: .75rem; }
  .claude-title-actions { gap: .2rem; }
  .ctb-btn { padding: .1rem .3rem; font-size: .65rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Articles de vente — produits, projets typés, statistiques
   ═══════════════════════════════════════════════════════════════════════════ */

/* --- Modale création projet typée --------------------------------------- */
.proj-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
  overflow-y: auto;
}
.proj-modal {
  width: 100%;
  max-width: 560px;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  padding: 1.25rem 1.25rem 1.1rem;
}
.proj-modal-title {
  margin: 0 0 .3rem;
  font-size: 1.1rem;
  color: #e8eaed;
}
.proj-modal-sub {
  margin: 0 0 .3rem;
  color: #9aa0aa;
  font-size: .85rem;
  line-height: 1.4;
}
.proj-modal-field {
  margin-top: .4rem;
  margin-bottom: 1rem;
}
.proj-modal-field label {
  display: block;
  font-size: .83rem;
  font-weight: 500;
  color: #c0c6d0;
  margin-bottom: .35rem;
}
.proj-modal-field input[type=text],
.proj-modal-field input:not([type]) {
  width: 100%;
  background: #0c0e14;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  padding: .55rem .7rem;
  color: #e8eaed;
  font-size: .9rem;
  box-sizing: border-box;
}
.proj-modal-field input:focus { outline: none; border-color: #f0b90b; }
.proj-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}
.proj-modal-actions .btn-cancel,
.proj-modal-actions .btn-confirm {
  padding: .5rem 1.1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.proj-modal-actions .btn-cancel {
  background: transparent;
  border-color: #2a2f3a;
  color: #c0c6d0;
}
.proj-modal-actions .btn-cancel:hover { border-color: #3a3f4a; }
.proj-modal-actions .btn-confirm {
  background: #f0b90b;
  color: #0c0e14;
}
.proj-modal-actions .btn-confirm:hover:not(:disabled) { background: #d4a309; }
.proj-modal-actions .btn-confirm:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.proj-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: .75rem 0 1rem;
}
.proj-type-card {
  text-align: left;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: 1rem;
  color: #e8eaed;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s;
}
.proj-type-card:hover { border-color: #f0b90b; background: #181d27; }
.proj-type-card:active { transform: scale(.99); }
.proj-type-card.selected {
  border-color: #f0b90b;
  background: #1b1f0f;
  box-shadow: 0 0 0 1px #f0b90b inset;
}
.proj-type-icon { font-size: 1.7rem; color: #f0b90b; margin-bottom: .35rem; }
.proj-type-title { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; }
.proj-type-desc { color: #9aa0aa; font-size: .82rem; line-height: 1.35; }

@media (max-width: 600px) {
  .proj-type-grid { grid-template-columns: 1fr; }
}

/* Onglets projets — icône typée */
.project-tab.proj-type-sales i.bi-bag-heart { color: #f0b90b; }

/* --- Section Produits (grille) ----------------------------------------- */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.products-header h3 { margin: 0; }
.products-header p { margin: .2rem 0 0; color: #9aa0aa; font-size: .88rem; }
.products-empty {
  text-align: center;
  color: #8a909b;
  padding: 2.5rem 1rem;
  background: #141820;
  border: 1px dashed #2a2f3a;
  border-radius: 10px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .9rem;
}

.product-card {
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: border-color .15s, transform .08s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { border-color: #f0b90b; }
.product-card:active { transform: scale(.995); }
.product-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0c0e14;
  overflow: hidden;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.product-card-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0c0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3a3f4a;
  font-size: 2.5rem;
}
.product-card-body { padding: .7rem .8rem .85rem; }
.product-card-title {
  font-weight: 600;
  font-size: .92rem;
  margin: 0 0 .3rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card-desc {
  color: #9aa0aa;
  font-size: .78rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0 0 .45rem;
}
.product-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}
.product-card-chips span {
  font-size: .68rem;
  background: #1e2330;
  color: #c0c6d0;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid #2a2f3a;
}
.product-card-badge {
  position: absolute;
  top: .5rem; right: .5rem;
  background: rgba(240, 185, 11, .95);
  color: #0c0e14;
  font-size: .66rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

/* --- Modale produit ----------------------------------------------------- */
.product-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}
.product-modal {
  width: 100%;
  max-width: 640px;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 4rem);
}
.product-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid #2a2f3a;
}
.product-modal-header h4 { margin: 0; font-size: 1.05rem; }
.product-modal-header .btn-close {
  background: none;
  border: none;
  color: #8a909b;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 .35rem;
}
.product-modal-header .btn-close:hover { color: #f0b90b; }
.product-modal-body {
  padding: 1rem 1.1rem;
  overflow-y: auto;
  flex: 1;
}
.product-modal-footer {
  padding: .75rem 1.1rem;
  border-top: 1px solid #2a2f3a;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;
}
.product-modal-footer .btn-delete { margin-right: auto; }
.product-modal-footer .btn-cancel,
.product-modal-footer .btn-confirm,
.product-modal-footer .btn-danger {
  padding: .5rem 1.1rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.product-modal-footer .btn-cancel {
  background: transparent;
  border-color: #2a2f3a;
  color: #c0c6d0;
}
.product-modal-footer .btn-cancel:hover { border-color: #3a3f4a; color: #e8eaed; }
.product-modal-footer .btn-confirm {
  background: #f0b90b;
  color: #0c0e14;
}
.product-modal-footer .btn-confirm:hover { background: #d4a309; }
.product-modal-footer .btn-danger {
  background: transparent;
  color: #ef4444;
  border-color: rgba(239,68,68,.35);
}
.product-modal-footer .btn-danger:hover { background: rgba(239,68,68,.12); border-color: #ef4444; }

.btn-add-product {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: #f0b90b;
  color: #0c0e14;
  border: none;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-add-product:hover { background: #d4a309; transform: translateY(-1px); }
.btn-add-product:active { transform: scale(.98); }

.pm-field { margin-bottom: 1rem; }
.pm-field > label,
.pm-label {
  display: block;
  font-size: .83rem;
  font-weight: 500;
  color: #c0c6d0;
  margin-bottom: .35rem;
}
.pm-help {
  display: block;
  color: #8a909b;
  font-size: .76rem;
  margin-top: .3rem;
  line-height: 1.4;
}
.pm-field input[type=text],
.pm-field textarea {
  width: 100%;
  background: #0c0e14;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  padding: .55rem .7rem;
  color: #e8eaed;
  font-size: .88rem;
  font-family: inherit;
  box-sizing: border-box;
}
.pm-field textarea { min-height: 80px; resize: vertical; }
.pm-field input:focus,
.pm-field textarea:focus {
  outline: none;
  border-color: #f0b90b;
}

.pm-type-checks,
.pm-associated-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
}
.pm-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #0c0e14;
  border: 1px solid #2a2f3a;
  border-radius: 99px;
  padding: .3rem .7rem;
  font-size: .8rem;
  cursor: pointer;
}
.pm-check:has(input:checked) {
  border-color: #f0b90b;
  background: #1b1f0f;
  color: #f0b90b;
}
.pm-check input { accent-color: #f0b90b; }

.pm-cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}
.pm-cta-grid > div {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pm-cta-grid input { flex: 1; }
.pm-lang-tag {
  background: #1e2330;
  color: #c0c6d0;
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 5px;
  min-width: 30px;
  text-align: center;
  border: 1px solid #2a2f3a;
}

/* Section média (photos + liens par langue) */
.pm-media-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  margin-bottom: .6rem;
}
.pm-media-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .75rem;
  background: #0c0e14;
  border: 1px solid #2a2f3a;
  border-radius: 8px;
  padding: .55rem;
}
.pm-media-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #1a1e26;
}
.pm-media-links {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.pm-media-link-row {
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pm-media-link-row input {
  flex: 1;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 5px;
  padding: .3rem .5rem;
  color: #e8eaed;
  font-size: .78rem;
}
.pm-media-link-row input:focus { outline: none; border-color: #f0b90b; }
.pm-media-item-actions {
  margin-top: .3rem;
  display: flex;
  gap: .35rem;
  justify-content: flex-end;
}
.pm-media-upload {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #1e2330;
  border: 1px dashed #3a3f4a;
  color: #c0c6d0;
  padding: .5rem .9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  transition: border-color .15s, color .15s;
}
.pm-media-upload:hover { border-color: #f0b90b; color: #f0b90b; }
.pm-media-upload input { display: none; }

@media (max-width: 500px) {
  .pm-media-item { grid-template-columns: 56px 1fr; }
  .pm-media-item img { width: 56px; height: 56px; }
}

/* --- Section Statistiques ---------------------------------------------- */
.stats-section-title {
  font-size: .95rem;
  color: #c0c6d0;
  margin: 1.4rem 0 .7rem;
  font-weight: 600;
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .7rem;
  margin-bottom: .5rem;
}
.stats-card {
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.stats-card-accent { border-left: 3px solid #f0b90b; }
.stats-card-icon {
  font-size: 1.6rem;
  color: #f0b90b;
  flex-shrink: 0;
}
.stats-card-label {
  font-size: .76rem;
  color: #8a909b;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stats-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8eaed;
  line-height: 1.15;
}
.stats-bars {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  min-height: 140px;
  padding: .8rem;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow-x: auto;
}
.stats-bar-col {
  flex: 1 0 42px;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.stats-bar-val {
  font-size: .72rem;
  color: #c0c6d0;
}
.stats-bar-wrap {
  width: 100%;
  height: 100px;
  background: #0c0e14;
  border-radius: 5px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.stats-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #f0b90b 0%, #b88708 100%);
  border-radius: 5px 5px 0 0;
  transition: height .4s ease;
}
.stats-bar-lbl {
  font-size: .7rem;
  color: #8a909b;
  text-align: center;
  white-space: nowrap;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow: hidden;
}
.stats-table th,
.stats-table td {
  text-align: left;
  padding: .55rem .8rem;
  border-bottom: 1px solid #21262f;
  font-size: .85rem;
}
.stats-table th {
  background: #1a1e26;
  color: #9aa0aa;
  font-weight: 500;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.stats-table tr:last-child td { border-bottom: none; }
.stats-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #f0b90b;
  font-weight: 600;
}

@media (max-width: 600px) {
  .stats-cards { grid-template-columns: repeat(2, 1fr); }
  .stats-card { padding: .7rem; gap: .55rem; }
  .stats-card-icon { font-size: 1.3rem; }
  .stats-card-value { font-size: 1.05rem; }
  .stats-table { font-size: .78rem; }
  .stats-table th, .stats-table td { padding: .45rem .55rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Articles de vente — rendu public (embarqué dans les pages HTML générées)
   NB : ces règles sont aussi inlinées dans le HTML généré côté serveur,
   mais on les garde ici pour la prévisualisation dans l'app.
   ═══════════════════════════════════════════════════════════════════════════ */
.affiliate-disclosure {
  background: rgba(240, 185, 11, .08);
  border-left: 3px solid #f0b90b;
  padding: .75rem 1rem;
  margin: 1rem 0 1.5rem;
  font-size: .85rem;
  color: #c0c6d0;
  border-radius: 0 6px 6px 0;
}
.product-embed-card {
  background: #141820;
  border: 1px solid #2a2f3a;
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.1rem;
  align-items: center;
  position: relative;
}
.product-embed-card.is-highlight {
  border-color: #f0b90b;
  box-shadow: 0 0 0 1px #f0b90b inset;
}
.product-embed-card .embed-badge {
  position: absolute;
  top: -10px; left: 1rem;
  background: #f0b90b;
  color: #0c0e14;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.product-embed-card img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.product-embed-card h3 {
  margin: 0 0 .4rem;
  font-size: 1.15rem;
}
.product-embed-card p {
  color: #9aa0aa;
  margin: 0 0 .7rem;
  line-height: 1.45;
}
.product-embed-card .embed-cta {
  display: inline-block;
  background: #f0b90b;
  color: #0c0e14;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: background .15s;
}
.product-embed-card .embed-cta:hover { background: #d4a309; }

@media (max-width: 600px) {
  .product-embed-card {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .product-embed-card img { max-width: 240px; margin: 0 auto; }
}

.comparative-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid #2a2f3a;
  border-radius: 10px;
}
.comparative-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.comparative-table th,
.comparative-table td {
  padding: .7rem .85rem;
  text-align: left;
  border-bottom: 1px solid #21262f;
  font-size: .88rem;
}
.comparative-table th {
  background: #1a1e26;
  color: #f0b90b;
  font-weight: 600;
}
.comparative-table tr:last-child td { border-bottom: none; }
.comparative-table .ct-cta a {
  display: inline-block;
  background: #f0b90b;
  color: #0c0e14;
  padding: .35rem .7rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  font-size: .8rem;
}

