/* ============================================================
   Welki — Design System
   Thème clair, accent orange. Épuré, professionnel, sans dégradés.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;

  /* Texte */
  --text: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  /* Bordures */
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Accent orange */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-active: #c2410c;
  --accent-soft: #fff7ed;
  --accent-soft-2: #ffedd5;
  --accent-border: #fed7aa;
  --accent-ring: rgba(249, 115, 22, 0.18);

  /* États */
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  /* Ombres (discrètes) */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  /* Rayons */
  --r-sm: 6px;
  --r: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

/* L'attribut [hidden] doit TOUJOURS masquer, même si une classe définit un display. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

::selection { background: var(--accent-soft-2); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

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

.btn-secondary { background: var(--surface); color: var(--text-secondary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-3); }

.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Navbar ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.brand-icon { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; image-rendering: auto; }

.hnav { display: flex; align-items: center; gap: 4px; }
.hlink {
  padding: 8px 14px; border-radius: var(--r); font-size: 14px; font-weight: 600;
  color: var(--text-muted); transition: background-color 0.1s, color 0.1s;
}
.hlink:hover { background: var(--surface-3); color: var(--text); }
.hlink.active { color: var(--accent-active); background: var(--accent-soft); }

.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user .uname { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.avatar { width: 34px; height: 34px; border-radius: var(--r-full); object-fit: cover; border: 1px solid var(--border); }

/* ---------- Avatar dropdown ---------- */
.nav-avatar-wrap { position: relative; }
.nav-avatar-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  display: flex; align-items: center; border-radius: var(--r-full);
  transition: opacity 0.1s;
}
.nav-avatar-btn:hover { opacity: 0.85; }
.nav-avatar-btn img { width: 34px; height: 34px; border-radius: var(--r-full); object-fit: cover; border: 1px solid var(--border); display: block; }
.nav-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); min-width: 168px; z-index: 200; padding: 6px;
}
.nd-user {
  padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border); margin-bottom: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.nd-item {
  display: block; padding: 8px 12px; font-size: 14px; color: var(--text);
  border-radius: var(--r-sm); text-decoration: none; cursor: pointer;
  transition: background-color 0.1s;
}
.nd-item:hover { background: var(--surface-3); }
.nd-logout { color: var(--danger); }
.nd-logout:hover { background: var(--danger-soft); }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

/* ---------- Conteneur ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-muted);
}
.badge svg { width: 13px; height: 13px; }
.badge-accent { background: var(--accent-soft); color: var(--accent-active); }
.badge-success { background: var(--success-soft); color: var(--success); }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  font-family: inherit; font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.textarea { resize: vertical; min-height: 70px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
  background: #ffffff; color: #111827;
  padding: 12px 16px; border-radius: var(--r);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 9999; display: flex; align-items: center; gap: 10px; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-ico { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.toast-ico svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.toast-ico.ok { background: var(--success); }
.toast-ico.err { background: var(--danger); }
.toast.show .toast-ico { animation: toastPop 0.35s ease; }
.toast.show .toast-ico svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: toastDraw 0.4s 0.12s ease forwards; }
@keyframes toastPop { 0% { transform: scale(0); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes toastDraw { to { stroke-dashoffset: 0; } }

/* ---------- Spinner ---------- */
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.center-screen { display: grid; place-items: center; min-height: 60vh; gap: 14px; color: var(--text-muted); }

/* ---------- Grille / cartes de création ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 22px; }
.ccard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.12s, border-color 0.12s;
}
.ccard:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.ccard-prev { aspect-ratio: 800 / 300; background: var(--surface-3); }

/* ---------- Effet premium (cohérent partout : bordure orange + Welki en coin) ---------- */
.welki-prem {
  position: relative;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md) !important;
}
/* La carte de création masque l'overflow : on le rétablit pour laisser dépasser le Welki,
   tout en arrondissant le haut de l'aperçu pour garder des coins propres. */
.ccard.welki-prem { overflow: visible; }
.ccard.welki-prem .ccard-prev { border-radius: var(--r-md) var(--r-md) 0 0; overflow: hidden; }
.welki-prem-corner {
  position: absolute; top: -13px; right: -11px; width: 38px; height: 38px;
  z-index: 4; pointer-events: none; object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(16, 24, 40, 0.22));
}

/* Tags de type d'image (JOIN / LEAVE / BOOST) */
.welki-type-tag {
  display: inline-flex; align-items: center; vertical-align: middle;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-full); margin-left: 6px; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-muted);
}
.welki-type-tag.join { background: #dbeafe; color: #1e40af; }
.welki-type-tag.leave { background: #fee2e2; color: #991b1b; }
.welki-type-tag.boost { background: #fae8ff; color: #86198f; }
.welki-type-tag.universal { background: var(--surface-3); color: var(--text-muted); }

/* ---------- Scrollbar stylée (fenêtres scrollables) ---------- */
.welki-scroll { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.welki-scroll::-webkit-scrollbar { width: 8px; }
.welki-scroll::-webkit-scrollbar-track { background: transparent; }
.welki-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.welki-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: padding-box; }

/* ---------- Tableau comparatif Free / Premium (accueil + page premium) ---------- */
.cmp-section { padding-block: 48px 110px; text-align: center; }
.cmp-title { font-size: 38px; margin-bottom: 10px; }
.cmp-sub { color: var(--text-muted); font-size: 18px; margin-bottom: 76px; }
.cmp-table { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 18px; max-width: 980px; margin: 0 auto; text-align: left; }
.cmp-labels { display: flex; flex-direction: column; position: relative; }
/* Panneau bleu derrière les intitulés (commence sous la zone d'en-tête) */
.cmp-labels::before { content: ''; position: absolute; left: 0; right: 0; top: 182px; bottom: 0; background: #58C4E6; border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.cmp-lhead { height: 182px; }
.cmp-row-lbl {
  position: relative; z-index: 1;
  height: 82px; display: flex; align-items: center; justify-content: flex-end;
  text-align: right; font-weight: 800; font-size: 18px; color: #fff;
  text-transform: uppercase; letter-spacing: 0.02em; padding-right: 20px; line-height: 1.15;
}
.cmp-col { border-radius: var(--r-lg); overflow: visible; box-shadow: var(--shadow-md); }
.cmp-head {
  position: relative; height: 182px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 20px;
}
.cmp-mascot { position: absolute; top: -64px; left: 50%; transform: translateX(-50%); width: 128px; height: 128px; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(16,24,40,.2)); }
.cmp-plan { font-family: 'Matcha Cih', var(--font); font-size: 46px; font-weight: 400; letter-spacing: 0.02em; text-shadow: 0 2px 4px rgba(16,24,40,.15); }
.cmp-wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 18px; display: block; }
.cmp-body { display: flex; flex-direction: column; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cmp-cell { height: 82px; display: flex; align-items: center; justify-content: center; }
.cmp-ico { width: 42px; height: 42px; object-fit: contain; }
.cmp-num { font-family: 'Matcha Cih', var(--font); font-size: 48px; font-weight: 400; letter-spacing: 0; }
/* FREE — aqua clair */
.cmp-col.free .cmp-head { background: #7FD3EF; }
.cmp-col.free .cmp-plan { color: #fff; }
.cmp-col.free .cmp-wave { fill: #DCF2FC; }
.cmp-col.free .cmp-body { background: #DCF2FC; }
.cmp-col.free .cmp-num { color: #1F86A6; }
/* PREMIUM — bleu plus soutenu (mis en avant) */
.cmp-col.premium { box-shadow: 0 0 0 2px #2BB3D4, var(--shadow-lg); }
.cmp-col.premium .cmp-head { background: #2BB3D4; }
.cmp-col.premium .cmp-plan { color: #fff; }
.cmp-col.premium .cmp-wave { fill: #CDEBF8; }
.cmp-col.premium .cmp-body { background: #CDEBF8; }
.cmp-col.premium .cmp-num { color: #1F86A6; }
@media (max-width: 700px) {
  .cmp-section { padding-block: 32px 72px; }
  .cmp-title { font-size: 24px; }
  .cmp-sub { font-size: 14px; margin-bottom: 52px; }
  .cmp-table { gap: 6px; grid-template-columns: 1fr 0.95fr 0.95fr; }
  .cmp-row-lbl { font-size: 11px; letter-spacing: 0; padding-right: 6px; }
  .cmp-labels::before { top: 110px; }
  .cmp-mascot { width: 64px; height: 64px; top: -32px; }
  .cmp-head, .cmp-lhead { height: 110px; }
  .cmp-plan { font-size: 22px; }
  .cmp-cell, .cmp-row-lbl { height: 52px; }
  .cmp-ico { width: 26px; height: 26px; }
  .cmp-num { font-size: 26px; }
}
.ccard-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard-body { padding: 10px 12px; }
.ccard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ccard-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ccard-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ccard-author { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12.5px; min-width: 0; flex: 0 1 auto; max-width: 55%; overflow: hidden; }
.ccard-author img { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.ccard-author span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-acts { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.cbtn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface);
  cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary);
}
.cbtn:hover { background: var(--surface-2); }
.cbtn svg { width: 14px; height: 14px; }
.cbtn.on { color: var(--accent-active); border-color: var(--accent-border); background: var(--accent-soft); }
.cbtn.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.cbtn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.cbtn.primary:hover { background: var(--accent-hover); }
/* Add (+) — orange icon-only button */
.cbtn.add { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); padding: 6px 9px; }
.cbtn.add:hover { background: var(--accent-soft-2); }
.cbtn.add svg { width: 16px; height: 16px; }
/* Like — the heart IS the button (no border) */
.clike { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 4px 2px; margin: 0; cursor: pointer; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; line-height: 1; }
.clike:hover { color: var(--text-secondary); }
.clike svg { width: 22px; height: 22px; }
.clike.on, .clike.on:hover { color: #e0245e; }
.clike.pop svg { animation: likePop 0.4s ease; }
@keyframes likePop { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.4); } 70% { transform: scale(0.9); } }

/* ---------- Segmented control (shared, also used in library) ---------- */
.seg { display: flex; background: var(--surface-3); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--r-sm); border: none; background: transparent;
  color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.seg-btn.active { background: var(--surface); color: var(--accent-active); box-shadow: var(--shadow-sm); }

/* ---------- Mobile hamburger ---------- */
.ham-btn {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 38px; height: 38px; padding: 8px; border: none; background: transparent;
  cursor: pointer; border-radius: var(--r); color: var(--text-secondary);
}
.ham-btn span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.ham-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ham-btn.open span:nth-child(2) { opacity: 0; }
.ham-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; position: absolute; top: 64px; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md); z-index: 49; padding: 10px 16px 16px;
}
.mobile-menu.open { display: block; }
.mobile-menu .hlink { display: block; padding: 12px 14px; font-size: 15px; border-radius: var(--r); margin-bottom: 2px; }
.mobile-menu .hlink.active { background: var(--accent-soft); color: var(--accent-active); }
.mobile-menu-sep { height: 1px; background: var(--border); margin: 10px 0; }
.mobile-menu .btn { width: 100%; justify-content: center; margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav { padding: 0 20px; position: relative; }
  .container { padding: 0 20px; }
  .cgrid { grid-template-columns: 1fr; }
  .hnav { display: none; }
  .ham-btn { display: flex; }
  .nav-user .btn-secondary, .nav-user .uname { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .nav { padding: 0 16px; }
  .hero-actions { flex-wrap: wrap; }
}

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.5); z-index: 2000;
  display: grid; place-items: center; padding: 20px;
}
.modal-bg[hidden] { display: none; }
.modal {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; padding: 22px; max-height: 85vh; overflow-y: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal p.sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Apparition au scroll (partagé) ---------- */
/* Animation (et non transition) pour ne PAS entrer en conflit avec le `transition`
   propre des cartes (.gcard / .ccard) qui sinon annule l'effet d'apparition. */
.reveal { opacity: 0; }
.reveal.in { animation: revealUp 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) var(--rd, 0s) both; }
@keyframes revealUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; }
  .reveal.in { animation: none; }
}

/* ---------- Footer partagé ---------- */
.welki-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 56px; background: var(--bg); }
.welki-footer .footer-row { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 13px; flex-wrap: wrap; gap: 10px; }
.welki-footer .footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); }
.welki-footer .footer-brand img { width: 48px; height: 48px; object-fit: contain; }
.welki-footer .footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.welki-footer .footer-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.welki-footer .footer-links a:hover { color: var(--accent-active); }

/* ── Admin sidebar layout ── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 220px; background: var(--surface); border-right: 1px solid var(--border);
  flex-shrink: 0; transition: width .22s ease; overflow: hidden; position: relative;
}
.admin-sidebar.collapsed { width: 0; }
.sidebar-inner { width: 220px; padding: 20px 0 32px; display: flex; flex-direction: column; min-height: 100%; }
.sidebar-head { padding: 0 18px 14px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar-head h2 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }
.slink {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r); font-size: 14px; font-weight: 600; white-space: nowrap;
  color: var(--text-secondary); cursor: pointer;
  transition: background .1s, color .1s; border: none; background: none; font-family: inherit; width: 100%; text-align: left;
}
.slink svg { width: 16px; height: 16px; flex-shrink: 0; }
.slink:hover { background: var(--surface-2); color: var(--text); }
.slink.active { background: var(--accent-soft); color: var(--accent-active); }
.sidebar-toggle {
  position: fixed; left: 220px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 48px; background: var(--surface); border: 1px solid var(--border);
  border-left: none; border-radius: 0 var(--r) var(--r) 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 300; transition: left .22s ease;
  color: var(--text-muted); box-shadow: 2px 0 6px rgba(0,0,0,.06);
}
.sidebar-toggle:hover { background: var(--surface-2); color: var(--text); }
.sidebar-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
.admin-sidebar.collapsed + .sidebar-toggle { left: 0; }
.admin-sidebar.collapsed + .sidebar-toggle svg { transform: scaleX(-1); }
.admin-main { flex: 1; min-width: 0; padding: 32px 32px 80px; background: var(--surface-2); }
.admin-main-head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.admin-main-head h1 { font-size: 22px; font-weight: 800; }
.admin-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-full); letter-spacing: 0.04em; }
/* Creation cards (admin) */
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.cr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .12s; }
.cr-card:hover { box-shadow: var(--shadow-md); }
.cr-prev { aspect-ratio: 800/300; background: var(--surface-3); overflow: hidden; }
.cr-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-body { padding: 12px 14px; }
.cr-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cr-name-input { flex: 1; min-width: 120px; font: 600 14px/1.3 inherit; border: 1px solid transparent; border-radius: var(--r-sm); padding: 3px 6px; background: transparent; color: var(--text); }
.cr-name-input:hover, .cr-name-input:focus { border-color: var(--border-strong); background: var(--surface-2); outline: none; }
.cr-name-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.cr-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cr-owner { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex: 1; min-width: 0; }
.cr-owner img { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.cr-owner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.status-sel { font: 700 11px/1 inherit; padding: 3px 8px; border-radius: var(--r-full); border: 1px solid; cursor: pointer; outline: none; -webkit-appearance: none; appearance: none; }
.status-sel.s-approved { background: var(--success-soft); color: var(--success); border-color: #86efac; }
.status-sel.s-pending  { background: #fef9c3; color: #854d0e; border-color: #fde047; }
.status-sel.s-hidden   { background: var(--surface-3); color: var(--text-muted); border-color: var(--border-strong); }
/* Search wrap */
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.search-wrap input { padding-left: 34px !important; }
/* Hidden badge */
.b-hidden { display: inline-block; padding: 2px 9px; border-radius: var(--r-full); font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border-strong); }
/* Mobile admin */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed; left: 0; top: 60px; bottom: 0; z-index: 250;
    width: 240px; transform: translateX(0); transition: transform .22s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,.12);
  }
  .admin-sidebar.collapsed { width: 240px; transform: translateX(-240px); }
  .sidebar-toggle { left: 240px; transition: left .22s ease; }
  .admin-sidebar.collapsed + .sidebar-toggle { left: 0; }
  .admin-main { padding: 20px 16px 60px; }
  .cr-grid { grid-template-columns: 1fr; }
}

/* ── Premium badge animation (editor topbar) ── */
@keyframes premTagAppear {
  0%   { opacity: 0; transform: translateY(-5px) scale(.88); }
  55%  { transform: translateY(2px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.prem-tag-pop { animation: premTagAppear .38s cubic-bezier(.34,1.56,.64,1) both; }

/* ── Views counter on cards (matches .clike style) ── */
.ccard-left { display: flex; align-items: center; gap: 8px; }
.ccard-views {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); font-weight: 600; line-height: 1;
  padding: 4px 2px;
}
.ccard-views svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ── Creation page stats row ── */
.cd-stats-row {
  display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px;
}
.cd-stat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.cd-stat svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }

/* ── Author link hover ── */
.cd-author, .ccard-author {
  transition: opacity .15s;
}
a.cd-author:hover, a.ccard-author:hover { opacity: .75; }
a.ccard-author { text-decoration: none; color: inherit; }

/* ── Profile page ── */
.prof-top { position: relative; }

.prof-banner {
  height: 180px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft-2), var(--surface-3));
  position: relative;
}
.prof-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prof-banner-default { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 50%, #fed7aa 100%); }

.prof-info {
  position: relative; padding: 0 24px 20px;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.prof-avatar-wrap {
  position: absolute; top: -44px;
}
.prof-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  border: 4px solid var(--bg); object-fit: cover; display: block;
  box-shadow: var(--shadow-md);
}
.prof-name-block {
  padding-top: 52px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.prof-displayname { font-size: 22px; font-weight: 800; line-height: 1.15; }
.prof-handle { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.prof-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.prof-stats {
  display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; padding-top: 4px;
}
.pstat { text-align: center; min-width: 52px; }
.pstat-val { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.pstat-lbl {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; color: var(--text-muted); margin-top: 3px; white-space: nowrap;
}
.pstat-lbl svg { width: 11px; height: 11px; flex-shrink: 0; }

.prof-grid-head {
  padding: 28px 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.prof-grid-head h2 {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-faint);
}

@media (max-width: 640px) {
  .prof-name-block { flex-direction: column; gap: 14px; }
  .prof-stats { gap: 16px; }
  .prof-banner { height: 120px; }
  .prof-avatar { width: 72px; height: 72px; }
  .prof-avatar-wrap { top: -36px; }
  .prof-name-block { padding-top: 44px; }
}
