@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════
   forsab2b — Subscriber Atelier
   Elevated shell for subscriber dashboard only (not admin).
   Direction: ink porcelain · deep indigo · teal accent · Outfit
   ═══════════════════════════════════════════════════════════════ */

html:not([data-theme="admin"]) {
  --font: 'Outfit', 'Cairo', system-ui, sans-serif;
  --font-display: 'Outfit', 'Cairo', system-ui, sans-serif;
  --sidebar-w: 280px;
  --radius: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --primary: #4338ca;
  --primary-light: #6366f1;
  --primary-deep: #312e81;
  --primary-glow: rgba(67, 56, 202, 0.28);
  --accent: #0f766e;
  --accent-glow: rgba(15, 118, 110, 0.22);
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;

  --sidebar-bg: #0b0d14;
  --sidebar-bg-2: #12151f;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: rgba(226, 232, 240, 0.58);
  --sidebar-text-active: #f8fafc;
  --sidebar-hover: rgba(255, 255, 255, 0.045);
  --sidebar-active: rgba(99, 102, 241, 0.16);

  --canvas: #eef1f6;
  --canvas-2: #e7ebf3;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(241, 245, 249, 0.9);
  --border: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 12px 40px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 28px 60px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 0 transparent;

  --glass-blur: 28px;
  --glass-saturate: 160%;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shine: rgba(255, 255, 255, 0.7);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[lang="ar"]:not([data-theme="admin"]) {
  --font: 'Cairo', 'Outfit', system-ui, sans-serif;
  --font-display: 'Cairo', 'Outfit', system-ui, sans-serif;
}

html[lang="zh"]:not([data-theme="admin"]) {
  --font: 'Noto Sans SC', 'Outfit', system-ui, sans-serif;
  --font-display: 'Noto Sans SC', 'Outfit', system-ui, sans-serif;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) {
  --canvas: #07080d;
  --canvas-2: #0c0e16;
  --surface: rgba(18, 20, 30, 0.88);
  --surface-solid: #12141e;
  --surface-2: rgba(28, 31, 44, 0.75);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-deep: #6366f1;
  --accent: #2dd4bf;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --glass-bg: rgba(14, 16, 26, 0.62);
  --glass-bg-strong: rgba(18, 20, 32, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shine: rgba(255, 255, 255, 0.08);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── Atmosphere ── */
html:not([data-theme="admin"]) .app-body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(67, 56, 202, 0.09), transparent 55%),
    radial-gradient(900px 500px at 92% 8%, rgba(15, 118, 110, 0.08), transparent 50%),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-2) 100%);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .app-body {
  background:
    radial-gradient(1000px 520px at 10% -8%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(800px 420px at 95% 0%, rgba(45, 212, 191, 0.1), transparent 50%),
    linear-gradient(180deg, #07080d 0%, #0a0c14 100%);
}

html:not([data-theme="admin"]) .mesh-bg::before {
  width: 720px;
  height: 720px;
  filter: blur(100px);
  opacity: 0.85;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.18) 0%, transparent 68%);
  top: -260px;
  inset-inline-end: -120px;
  animation: atelierDrift 28s var(--ease) infinite;
}

html:not([data-theme="admin"]) .mesh-bg::after {
  width: 560px;
  height: 560px;
  filter: blur(90px);
  opacity: 0.75;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.14) 0%, transparent 70%);
  bottom: -180px;
  inset-inline-start: 15%;
  animation: atelierDrift 34s var(--ease) infinite reverse;
}

html:not([data-theme="admin"]) .grid-overlay {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.55;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 20%, black 10%, transparent 75%);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .grid-overlay {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

@keyframes atelierDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(24px, -18px) scale(1.04); }
  70% { transform: translate(-16px, 14px) scale(0.98); }
}

/* ── Sidebar atelier rail — light by default, dark only in dark mode ── */
html:not([data-theme="admin"]) .app-shell {
  gap: 0;
}

html:not([data-theme="admin"]) .sidebar.atelier-rail {
  --sidebar-w: 292px;
  --rail-text: #334155;
  --rail-text-strong: #0f172a;
  --rail-muted: #64748b;
  width: var(--sidebar-w);
  margin: 0.85rem 0 0.85rem 0.85rem;
  height: calc(100vh - 1.7rem);
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-inline-end: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(420px 220px at 14% -10%, rgba(67, 56, 202, 0.1), transparent 58%),
    radial-gradient(360px 200px at 95% 108%, rgba(15, 118, 110, 0.08), transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #f7f8fc 48%, #f1f4f9 100%);
  box-shadow:
    0 24px 50px rgba(15, 23, 42, 0.08),
    0 2px 0 rgba(255, 255, 255, 0.9) inset,
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
  overflow: hidden;
  color: var(--rail-text);
}

html[dir="rtl"]:not([data-theme="admin"]) .sidebar.atelier-rail {
  margin: 0.85rem 0.85rem 0.85rem 0;
}

html:not([data-theme="admin"]) .sidebar.atelier-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 72%);
  pointer-events: none;
  z-index: 0;
}

html:not([data-theme="admin"]) .sidebar.atelier-rail::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 18%;
  width: 3px;
  height: 88px;
  border-radius: 99px;
  background: linear-gradient(180deg, #4338ca, #0f766e);
  box-shadow: 0 0 18px rgba(67, 56, 202, 0.25);
  z-index: 2;
  pointer-events: none;
}

html:not([data-theme="admin"]) .sidebar.atelier-rail > * {
  position: relative;
  z-index: 1;
}

html:not([data-theme="admin"]) .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1.35rem 1.2rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: none;
}

html:not([data-theme="admin"]) .sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.35), transparent 42%),
    linear-gradient(135deg, #4338ca 0%, #312e81 48%, #0f766e 120%);
  box-shadow:
    0 12px 28px rgba(67, 56, 202, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

html:not([data-theme="admin"]) .sidebar-logo::after { display: none; }

html:not([data-theme="admin"]) .sidebar-logo-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.06em;
  color: #fff;
}

html:not([data-theme="admin"]) .sidebar-brand-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.1;
  background: linear-gradient(115deg, #0f172a 10%, #3730a3 60%, #0f766e 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html:not([data-theme="admin"]) .sidebar-brand-sub {
  margin-top: 0.2rem;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 650;
}

html:not([data-theme="admin"]) .sidebar-pulse {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.1rem 0.85rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

html:not([data-theme="admin"]) .sidebar-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: atelierPulse 2.4s var(--ease) infinite;
}

@keyframes atelierPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

html:not([data-theme="admin"]) .sidebar-nav {
  padding: 0.15rem 0.85rem 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.12) transparent;
}

html:not([data-theme="admin"]) .nav-group {
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.35rem 0.45rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

html:not([data-theme="admin"]) .sidebar-section {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem 0.55rem;
  letter-spacing: 0.16em;
  color: #94a3b8;
  font-size: 10px;
}

html:not([data-theme="admin"]) .sidebar-section::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.1), transparent);
}

html:not([data-theme="admin"]) .nav-item {
  border-radius: 13px;
  padding: 0.55rem 0.55rem;
  font-weight: 550;
  letter-spacing: -0.015em;
  gap: 0.75rem;
  margin-bottom: 3px;
  color: #475569;
}

html:not([data-theme="admin"]) .nav-icon-well {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.2s var(--ease);
}

html:not([data-theme="admin"]) .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  color: #64748b;
}

html:not([data-theme="admin"]) .nav-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html:not([data-theme="admin"]) .nav-item:hover {
  background: rgba(67, 56, 202, 0.06);
  color: #0f172a;
  transform: none;
}

html:not([data-theme="admin"]) .nav-item:hover .nav-icon-well {
  background: rgba(67, 56, 202, 0.1);
  border-color: rgba(67, 56, 202, 0.16);
  transform: translateY(-1px);
}

html:not([data-theme="admin"]) .nav-item:hover .nav-icon {
  color: #4338ca;
}

html:not([data-theme="admin"]) .nav-item.active {
  background: linear-gradient(105deg, rgba(67, 56, 202, 0.12), rgba(15, 118, 110, 0.08));
  color: #1e1b4b;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1px rgba(67, 56, 202, 0.14),
    0 8px 20px rgba(67, 56, 202, 0.08);
}

html:not([data-theme="admin"]) .nav-item.active::before {
  display: none;
}

html:not([data-theme="admin"]) .nav-item.active .nav-icon-well {
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.18), rgba(15, 118, 110, 0.14));
  border-color: rgba(67, 56, 202, 0.22);
  box-shadow: 0 6px 14px rgba(67, 56, 202, 0.16);
}

html:not([data-theme="admin"]) .nav-item.active .nav-icon {
  color: #3730a3;
  opacity: 1;
}

html:not([data-theme="admin"]) .nav-nest {
  display: grid;
  gap: 2px;
  margin: 0.15rem 0.35rem 0.45rem 2.85rem;
  padding: 0.3rem;
  border-radius: 12px;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

html[dir="rtl"]:not([data-theme="admin"]) .nav-nest {
  margin: 0.15rem 2.85rem 0.45rem 0.35rem;
}

html:not([data-theme="admin"]) .nav-item.nav-item-sub {
  padding: 0.42rem 0.7rem;
  font-size: 12px;
  border-radius: 9px;
  margin: 0;
  opacity: 1;
  color: #64748b;
}

html:not([data-theme="admin"]) .nav-item.nav-item-sub.active {
  background: rgba(67, 56, 202, 0.1);
  color: #312e81;
  box-shadow: none;
  font-weight: 650;
}

html:not([data-theme="admin"]) .sidebar-cta {
  position: relative;
  margin: 0.35rem 0.95rem 0.75rem;
  padding: 1.1rem 1.1rem 1.05rem;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(67, 56, 202, 0.1), rgba(15, 118, 110, 0.08) 70%, #ffffff);
  border: 1px solid rgba(67, 56, 202, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 28px rgba(67, 56, 202, 0.08);
}

html:not([data-theme="admin"]) .sidebar-cta-orb {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  inset-inline-end: -36px;
  top: -48px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.18), transparent 68%);
  pointer-events: none;
}

html:not([data-theme="admin"]) .sidebar-cta-kicker {
  position: relative;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
  margin-bottom: 0.35rem;
}

html:not([data-theme="admin"]) .sidebar-cta-title {
  position: relative;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

html:not([data-theme="admin"]) .sidebar-cta-sub {
  position: relative;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
  margin-bottom: 0.85rem;
}

html:not([data-theme="admin"]) .sidebar-cta-btn {
  position: relative;
  width: 100%;
  justify-content: center;
}

html:not([data-theme="admin"]) .sidebar-footer {
  padding: 0.75rem 0.9rem 0.95rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.02));
}

html:not([data-theme="admin"]) .user-chip {
  border-radius: 16px;
  padding: 0.65rem 0.7rem;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.2s var(--ease);
}

html:not([data-theme="admin"]) .user-chip:hover {
  background: #f8fafc;
  border-color: rgba(67, 56, 202, 0.2);
  transform: translateY(-1px);
}

html:not([data-theme="admin"]) .user-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, #4338ca, #0f766e);
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.25);
  font-weight: 750;
  color: #fff;
}

html:not([data-theme="admin"]) .user-online {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  inset-inline-end: -1px;
  bottom: -1px;
}

html:not([data-theme="admin"]) .user-meta {
  min-width: 0;
  flex: 1;
}

html:not([data-theme="admin"]) .user-email {
  font-size: 12.5px;
  font-weight: 650;
  color: #0f172a;
}

html:not([data-theme="admin"]) .user-role {
  font-size: 11px;
  color: #64748b;
}

html:not([data-theme="admin"]) .user-chevron {
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  transform: translateY(-1px);
}

html[dir="rtl"]:not([data-theme="admin"]) .user-chevron {
  transform: scaleX(-1) translateY(-1px);
}

/* Dark mode sidebar only */
html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar.atelier-rail {
  border-color: rgba(255, 255, 255, 0.08);
  border-inline-end-color: rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(420px 220px at 18% -8%, rgba(99, 102, 241, 0.28), transparent 58%),
    radial-gradient(360px 200px at 90% 105%, rgba(15, 118, 110, 0.22), transparent 55%),
    linear-gradient(165deg, #0a0c14 0%, #10131d 48%, #0c1018 100%);
  box-shadow:
    0 30px 70px rgba(8, 10, 18, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  color: rgba(226, 232, 240, 0.8);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar.atelier-rail::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar.atelier-rail::after {
  background: linear-gradient(180deg, #a5b4fc, #2dd4bf);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.35);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-brand-text {
  background: linear-gradient(115deg, #ffffff 10%, #c7d2fe 55%, #99f6e4 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-brand-sub,
html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-section,
html[data-color-mode="dark"]:not([data-theme="admin"]) .user-role,
html[data-color-mode="dark"]:not([data-theme="admin"]) .user-chevron {
  color: rgba(148, 163, 184, 0.7);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-pulse {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.07);
  color: rgba(226, 232, 240, 0.62);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-group {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.045);
  box-shadow: none;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-section::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item {
  color: rgba(203, 213, 225, 0.72);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-icon-well {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-icon {
  color: rgba(226, 232, 240, 0.7);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #f1f5f9;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item:hover .nav-icon {
  color: #c7d2fe;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item.active {
  background: linear-gradient(105deg, rgba(99, 102, 241, 0.28), rgba(15, 118, 110, 0.12));
  color: #fff;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item.active .nav-icon {
  color: #e0e7ff;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-nest {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.05);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item.nav-item-sub {
  color: rgba(203, 213, 225, 0.65);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .nav-item.nav-item-sub.active {
  background: rgba(165, 180, 252, 0.14);
  color: #e0e7ff;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-cta {
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.42), rgba(15, 118, 110, 0.22) 70%, rgba(15, 23, 42, 0.4));
  border-color: rgba(165, 180, 252, 0.22);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-cta-kicker {
  color: rgba(199, 210, 254, 0.7);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-cta-title {
  color: #fff;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-cta-sub {
  color: rgba(226, 232, 240, 0.62);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.18));
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .user-chip {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .user-chip:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .user-online {
  border-color: #0c1018;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .user-email {
  color: #f1f5f9;
}

@media (max-width: 900px) {
  html:not([data-theme="admin"]) .sidebar.atelier-rail {
    margin: 0;
    height: 100vh;
    border-radius: 0;
  }
}

/* ── Topbar & main ── */
html:not([data-theme="admin"]) .main-wrap {
  background: transparent;
}

html:not([data-theme="admin"]) .topbar {
  height: 68px;
  margin: 0.85rem 1rem 0;
  padding: 0 1.25rem 0 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass-bg-strong);
  box-shadow: var(--shadow-sm), var(--glass-inner);
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .topbar {
  background: rgba(12, 14, 22, 0.78);
  border-color: rgba(255, 255, 255, 0.07);
}

html:not([data-theme="admin"]) .topbar-breadcrumb {
  font-size: 12.5px;
  letter-spacing: 0.01em;
}

html:not([data-theme="admin"]) .topbar-breadcrumb strong {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

html:not([data-theme="admin"]) .main-content {
  padding: 1.5rem 1.5rem 3.5rem;
}

html:not([data-theme="admin"]) .page-full {
  max-width: 1280px;
}

/* ── Hero ── */
html:not([data-theme="admin"]) .hero-header {
  margin-bottom: 1.75rem;
  padding: 0.25rem 0.15rem 0.5rem;
  position: relative;
}

html:not([data-theme="admin"]) .hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  background: linear-gradient(120deg, var(--text) 0%, var(--primary-deep) 55%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .hero-title {
  background: linear-gradient(120deg, #f8fafc 10%, #a5b4fc 55%, #5eead4 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

html:not([data-theme="admin"]) .hero-subtitle {
  font-size: 15px;
  line-height: 1.55;
  max-width: 34rem;
  color: var(--text-secondary);
  margin-top: 0.55rem;
}

/* ── Surfaces ── */
html:not([data-theme="admin"]) .glass-panel,
html:not([data-theme="admin"]) .kpi-card,
html:not([data-theme="admin"]) .plan-card.glass-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm), var(--glass-inner);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  overflow: hidden;
}

html:not([data-theme="admin"]) .glass-panel::before,
html:not([data-theme="admin"]) .kpi-card::before {
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.55) 0%,
    transparent 42%,
    transparent 58%,
    rgba(67, 56, 202, 0.04) 100%
  );
}

html:not([data-theme="admin"]) .kpi-card {
  padding: 1.45rem 1.5rem 1.35rem;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.25s;
}

html:not([data-theme="admin"]) .kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--glass-inner);
  border-color: rgba(67, 56, 202, 0.18);
}

html:not([data-theme="admin"]) .kpi-card::after {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(67, 56, 202, 0.55), rgba(15, 118, 110, 0.45), transparent);
}

html:not([data-theme="admin"]) .kpi-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

html:not([data-theme="admin"]) .kpi-value {
  font-family: var(--font-display);
  letter-spacing: -0.05em;
  font-weight: 800;
}

html:not([data-theme="admin"]) .kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.12), rgba(15, 118, 110, 0.1));
  color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

html:not([data-theme="admin"]) .kpi-progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

html:not([data-theme="admin"]) .glass-panel-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
  border-bottom-color: var(--border);
  padding: 1.2rem 1.5rem;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .glass-panel-header {
  background: rgba(255, 255, 255, 0.02);
}

html:not([data-theme="admin"]) .glass-panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.025em;
}

/* ── Campaign cards ── */
html:not([data-theme="admin"]) .campaign-card {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), border-color 0.2s;
}

html:not([data-theme="admin"]) .campaign-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(67, 56, 202, 0.22);
}

html:not([data-theme="admin"]) .campaign-keyword {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.03em;
}

html:not([data-theme="admin"]) .progress-fill {
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ── Buttons ── */
html:not([data-theme="admin"]) .btn {
  border-radius: 12px;
  letter-spacing: -0.01em;
  font-weight: 650;
}

html:not([data-theme="admin"]) .btn-primary {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 45%, #0f766e 130%);
  background-size: 160% auto;
  color: #fff;
  box-shadow: 0 8px 22px rgba(67, 56, 202, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

html:not([data-theme="admin"]) .btn-primary:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(67, 56, 202, 0.32);
  color: #fff;
}

html:not([data-theme="admin"]) .btn-glow {
  animation: none;
}

html:not([data-theme="admin"]) .btn-secondary {
  background: var(--surface-solid);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

html:not([data-theme="admin"]) .btn-secondary:hover {
  border-color: rgba(67, 56, 202, 0.35);
  color: var(--primary);
}

/* ── Tables / forms / badges ── */
html:not([data-theme="admin"]) .table-wrap {
  border-radius: var(--radius-xl);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface-solid);
}

html:not([data-theme="admin"]) .table th {
  letter-spacing: 0.1em;
  font-size: 10px;
  background: var(--surface-2);
}

html:not([data-theme="admin"]) .input,
html:not([data-theme="admin"]) .select {
  border-radius: 12px;
  border-color: var(--border-strong);
  background: var(--surface-solid);
  transition: border-color 0.2s, box-shadow 0.2s;
}

html:not([data-theme="admin"]) .input:focus,
html:not([data-theme="admin"]) .select:focus {
  border-color: rgba(67, 56, 202, 0.45);
  box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.12);
}

html:not([data-theme="admin"]) .badge {
  border-radius: 8px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

html:not([data-theme="admin"]) .badge-primary {
  background: rgba(67, 56, 202, 0.12);
  color: #3730a3;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .badge-primary {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.18);
}

html:not([data-theme="admin"]) .lang-pill {
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
}

html:not([data-theme="admin"]) .theme-toggle {
  border-radius: 12px;
  width: 38px;
  height: 38px;
  background: var(--surface-solid);
}

html:not([data-theme="admin"]) .billing-subnav {
  border-radius: 16px;
  padding: 0.4rem;
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

html:not([data-theme="admin"]) .billing-subnav-link {
  border-radius: 11px;
}

html:not([data-theme="admin"]) .billing-subnav-link.is-active {
  background: linear-gradient(135deg, rgba(67, 56, 202, 0.12), rgba(15, 118, 110, 0.08));
  border-color: transparent;
  color: var(--primary-deep);
  box-shadow: none;
}

html[data-color-mode="dark"]:not([data-theme="admin"]) .billing-subnav-link.is-active {
  color: #c7d2fe;
}

html:not([data-theme="admin"]) .plan-card {
  border-radius: 22px;
}

html:not([data-theme="admin"]) .plan-name {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

html:not([data-theme="admin"]) .plan-price {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

html:not([data-theme="admin"]) .plan-badge {
  border-radius: 8px;
  background: rgba(67, 56, 202, 0.12);
  color: var(--primary-deep);
}

html:not([data-theme="admin"]) .empty-state {
  padding: 2.5rem 1.5rem;
}

html:not([data-theme="admin"]) .empty-state-visual {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 0;
  background: linear-gradient(145deg, rgba(67, 56, 202, 0.14), rgba(15, 118, 110, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
}

html:not([data-theme="admin"]) .empty-state-visual::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(135deg, #4338ca, #0f766e);
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.3);
}

html:not([data-theme="admin"]) .empty-state-title {
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.03em;
}

html:not([data-theme="admin"]) .alert {
  border-radius: 14px;
  border-width: 1px;
  backdrop-filter: blur(12px);
}

/* ── Auth (login / register) ── */
html:not([data-theme="admin"]) .auth-page {
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(67, 56, 202, 0.16), transparent 55%),
    radial-gradient(700px 420px at 90% 80%, rgba(15, 118, 110, 0.12), transparent 50%),
    linear-gradient(160deg, #0b0d14 0%, #12151f 45%, #0f172a 100%);
}

html:not([data-theme="admin"]) .auth-showcase h1 {
  font-family: var(--font-display);
  letter-spacing: -0.045em;
}

html:not([data-theme="admin"]) .auth-showcase h1 em {
  background: linear-gradient(120deg, #a5b4fc, #5eead4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: normal;
}

html:not([data-theme="admin"]) .auth-glass-card {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px) saturate(140%);
}

html:not([data-theme="admin"]) .auth-stat-val {
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}

/* Motion */
html:not([data-theme="admin"]) .animate-in {
  animation: atelierRise 0.7s var(--ease-out) both;
}

@keyframes atelierRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="admin"]) .mesh-bg::before,
  html:not([data-theme="admin"]) .mesh-bg::after,
  html:not([data-theme="admin"]) .animate-in,
  html:not([data-theme="admin"]) .kpi-card,
  html:not([data-theme="admin"]) .campaign-card {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 900px) {
  html:not([data-theme="admin"]) .topbar {
    margin: 0.65rem 0.65rem 0;
    height: 60px;
    padding-inline: 0.85rem;
  }
  html:not([data-theme="admin"]) .main-content {
    padding: 1.15rem 0.85rem 2.5rem;
  }
}
