/* ==========================================================================
   Atlas Run — Design System v2
   Premium, Dribbble-grade visual language
   ========================================================================== */

/* ── Google Font via system fallback if offline ── */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

/* ── Root variables (Light mode / Public site) ── */
:root {
  --font-sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Colors */
  --bg: #F7F3EC;
  --bg-elevated: #FFFFFF;
  --surface: #FFFFFF;
  --surface-hover: #F3EEE6;
  --surface-strong: #15110D;
  --text: #18130F;
  --text-secondary: #695F55;
  --text-tertiary: #8A7E72;
  --border: rgba(24, 19, 15, 0.09);
  --border-strong: rgba(24, 19, 15, 0.16);

  --accent: #FF6B00;
  --accent-light: #FFE8D6;
  --accent-hover: #D95700;
  --accent-glow: rgba(255, 107, 0, 0.28);
  --accent-deep: #8A3200;
  --sky: #1F8A99;
  --mint: #44A06B;

  --danger: #DC2626;
  --danger-bg: rgba(220, 38, 38, 0.06);
  --danger-border: rgba(220, 38, 38, 0.18);

  --warning: #D97706;
  --info: #2563EB;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(41, 26, 14, 0.05);
  --shadow-sm: 0 2px 10px rgba(41, 26, 14, 0.06);
  --shadow-md: 0 14px 34px rgba(41, 26, 14, 0.09);
  --shadow-lg: 0 24px 60px rgba(41, 26, 14, 0.13);
  --shadow-xl: 0 34px 90px rgba(24, 19, 15, 0.18);
  --shadow-glow: 0 0 0 3px var(--accent-glow);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --container-max: 1200px;
}

/* ── Admin dashboard theme (clean light) ── */
body.admin-mode {
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --sidebar-bg: #FFFFFF;
  --sidebar-border: rgba(15, 23, 42, 0.08);
  --sidebar-text: #475569;
  --sidebar-text-active: #FF6B00;
  --sidebar-hover: #F8FAFC;
  --sidebar-active-bg: #FFF1E8;
  --sidebar-active-border: rgba(255, 107, 0, 0.25);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(255, 107, 0, 0.08) 0%, transparent 420px),
    linear-gradient(135deg, #FBF7F0 0%, var(--bg) 46%, #ECE7DE 100%);
  color: var(--text);
  transition: background var(--transition-slow), color var(--transition-slow);
}

body.admin-mode {
  background: var(--bg);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: var(--radius-full); opacity: 0.4; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ── Utilities ── */
.muted { color: var(--text-secondary); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--font-mono); font-size: 0.88em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Container ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.animate-fade { animation: fadeIn 0.5s var(--transition-slow) both; }
.animate-scale { animation: fadeInScale 0.4s var(--transition-slow) both; }

/* ── Navigation (Public) ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--transition-base), border-color var(--transition-base), backdrop-filter var(--transition-base);
}

.nav.scrolled {
  background: rgba(247, 243, 236, 0.84);
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  gap: var(--space-3);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}

.logo {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 0;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.logo::before {
  content: '';
  display: inline-block;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.24), transparent 42%),
    linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 4px 12px var(--accent-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border);
}

.nav-links a[aria-current="page"] {
  color: var(--accent-deep);
  background: var(--accent-light);
  border-color: rgba(255, 107, 0, 0.25);
  font-weight: 800;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-user {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--transition-fast);
  box-shadow: 0 12px 28px rgba(255, 107, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0); }

.btn:focus-visible,
.nav-links a:focus-visible,
.sidebar-link:focus-visible,
.chip:focus-visible,
.link:focus-visible,
.input:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.row input:focus-visible,
.row textarea:focus-visible,
.row select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.64);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  box-shadow: none;
}

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

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* ── Main ── */
main {
  padding: var(--space-8) 0 var(--space-12);
  min-height: calc(100vh - var(--topbar-height) - 200px);
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  animation: fadeInScale 0.45s var(--transition-slow) both;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h1, .card h2, .card h3, .card h4 {
  margin-top: 0;
  letter-spacing: 0;
  line-height: 1.25;
}

.card h1 { font-size: 1.6rem; font-weight: 800; }
.card h2 { font-size: 1.25rem; font-weight: 700; }
.card h3 { font-size: 1.05rem; font-weight: 700; }

/* ── Hero / Landing ── */
.hero {
  text-align: center;
  padding: var(--space-12) 0 var(--space-10);
  animation: fadeIn 0.7s var(--transition-slow) both;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 var(--space-4);
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-6);
}

/* ── Feature grid ── */
.features {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-light), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  font-size: 1.3rem;
}

/* ── Modern public home ── */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  align-items: center;
  gap: clamp(32px, 6vw, 84px);
  min-height: calc(100vh - var(--topbar-height) - 24px);
  padding: clamp(42px, 7vw, 86px) 0 clamp(34px, 6vw, 72px);
  position: relative;
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 10% -22vw auto 48%;
  height: 62%;
  background:
    linear-gradient(135deg, rgba(255, 107, 0, 0.16), rgba(31, 138, 153, 0.12)),
    repeating-linear-gradient(90deg, rgba(24, 19, 15, 0.08) 0 1px, transparent 1px 44px);
  transform: skewY(-8deg);
  border-radius: 28px;
  z-index: -1;
}

.home-hero-copy {
  animation: fadeIn 0.65s var(--transition-slow) both;
}

.home-hero h1 {
  margin: 0;
  max-width: 740px;
  font-size: clamp(3rem, 7.5vw, 6.5rem);
  line-height: 0.93;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--text);
}

.home-hero p {
  max-width: 610px;
  margin: var(--space-5) 0 0;
  color: var(--text-secondary);
  font-size: clamp(1.04rem, 1.6vw, 1.22rem);
  line-height: 1.7;
}

.home-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

.home-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  max-width: 680px;
  margin-top: var(--space-8);
}

.home-proof div {
  padding: var(--space-4);
  border-top: 1px solid var(--border-strong);
}

.home-proof strong,
.home-proof span {
  display: block;
}

.home-proof strong {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--accent-deep);
}

.home-proof span {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
}

.home-product {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInScale 0.7s var(--transition-slow) both;
}

.product-panel {
  width: min(100%, 540px);
  min-height: 420px;
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    var(--surface-strong);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-xl);
  display: grid;
  gap: 16px;
  transform: rotate(-2deg);
}

.product-panel-top,
.product-workout,
.product-metrics {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
}

.product-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
}

.product-panel-top span,
.product-workout span,
.product-metrics span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.product-panel-top strong,
.product-workout strong,
.product-metrics strong {
  font-family: var(--font-mono);
}

.product-chart {
  min-height: 190px;
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 10px;
  background:
    linear-gradient(rgba(255,255,255,0.07) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(135deg, rgba(255, 107, 0, 0.18), rgba(31, 138, 153, 0.1));
  overflow: hidden;
}

.product-chart span {
  display: block;
  min-height: 34px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #FFB000, var(--accent));
  box-shadow: 0 12px 30px rgba(255, 107, 0, 0.24);
}

.product-chart span:nth-child(2n) {
  background: linear-gradient(180deg, #4EC7D5, var(--sky));
  box-shadow: 0 12px 30px rgba(31, 138, 153, 0.2);
}

.product-chart .bar-38 { height: 38%; }
.product-chart .bar-56 { height: 56%; }
.product-chart .bar-44 { height: 44%; }
.product-chart .bar-78 { height: 78%; }
.product-chart .bar-62 { height: 62%; }
.product-chart .bar-88 { height: 88%; }
.product-chart .bar-50 { height: 50%; }

.product-workout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px;
}

.product-workout strong {
  display: block;
  margin-top: 4px;
  font-size: 1.08rem;
}

.product-workout small {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 107, 0, 0.16);
  color: #FFD8BA;
  font-family: var(--font-mono);
  font-weight: 700;
}

.product-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
  gap: 10px;
}

.product-metrics div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.product-metrics strong {
  font-size: 1.35rem;
}

.product-watch {
  position: absolute;
  right: 0;
  bottom: 34px;
  width: 176px;
  height: 216px;
  padding: 12px;
  border-radius: 42px;
  background: #080706;
  box-shadow: 0 28px 70px rgba(24, 19, 15, 0.32);
  transform: rotate(8deg);
}

.product-watch-screen {
  height: 100%;
  border-radius: 32px;
  background:
    radial-gradient(circle at 52% 50%, rgba(255, 107, 0, 0.34), transparent 42%),
    linear-gradient(160deg, #1C120C, #060504);
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.product-watch-screen strong {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  line-height: 1;
}

.product-watch-screen span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.08em;
}

.watch-time {
  position: absolute;
  top: 18px;
}

.watch-ring {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 7px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-right-color: #FFB000;
  position: absolute;
  bottom: 16px;
}

.home-section {
  padding: clamp(50px, 8vw, 92px) 0;
}

.home-section-tight {
  padding-top: clamp(24px, 5vw, 56px);
}

.section-kicker {
  width: max-content;
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.52fr);
  align-items: end;
  gap: clamp(20px, 5vw, 64px);
  margin-bottom: var(--space-8);
}

.home-section-head h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2rem, 4.8vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.home-section-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.workflow-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--border-strong);
}

.workflow-rail article {
  padding: clamp(22px, 4vw, 38px);
  border-right: 1px solid var(--border);
}

.workflow-rail article:last-child {
  border-right: 0;
}

.workflow-rail span {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.workflow-rail h3 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 1.25rem;
}

.workflow-rail p {
  margin: 0;
  color: var(--text-secondary);
}

.feature-mosaic {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 0.9fr;
  grid-auto-rows: minmax(220px, auto);
  gap: var(--space-4);
}

.feature-tile {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.58);
  padding: var(--space-5);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.feature-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 107, 0, 0.09), transparent 52%);
  pointer-events: none;
}

.feature-tile-large {
  grid-row: span 2;
  background:
    linear-gradient(145deg, rgba(255, 107, 0, 0.92), rgba(138, 50, 0, 0.9)),
    var(--accent);
  color: #fff;
}

.feature-tile-large::before {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.16) 0 1px, transparent 1px 18px);
}

.feature-glyph {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(24, 19, 15, 0.06);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-weight: 800;
}

.feature-tile-large .feature-glyph {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.feature-tile h3 {
  margin: 0 0 var(--space-2);
  font-size: 1.3rem;
  position: relative;
}

.feature-tile p {
  margin: 0;
  color: var(--text-secondary);
  position: relative;
}

.feature-tile-large p {
  color: rgba(255, 255, 255, 0.78);
  max-width: 440px;
}

/* ── Forms ── */
.form {
  display: grid;
  gap: var(--space-4);
  max-width: 420px;
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
}

.field input,
.field select,
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field input::placeholder,
.input::placeholder {
  color: var(--text-tertiary);
}

.field input:focus,
.field select:focus,
.input:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Alert ── */
.alert {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 500;
  font-size: 0.9rem;
  max-width: 540px;
  animation: fadeInScale 0.3s var(--transition-slow) both;
}

.alert.success {
  color: #FF6B00;
  background: rgba(255, 107, 0, 0.08);
  border-color: rgba(255, 107, 0, 0.22);
}

/* ── Tables ── */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.table th,
.table td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-compact th,
.table-compact td {
  padding: var(--space-2) var(--space-3);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge.get    { color: #FF6B00; background: rgba(255, 107, 0, 0.08); border-color: rgba(255, 107, 0, 0.22); }
.badge.post   { color: #2563EB; background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.22); }
.badge.put    { color: #D97706; background: rgba(217, 119, 6, 0.08); border-color: rgba(217, 119, 6, 0.22); }
.badge.patch  { color: #7C3AED; background: rgba(124, 58, 237, 0.08); border-color: rgba(124, 58, 237, 0.22); }
.badge.delete { color: #DC2626; background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.22); }

/* ── Chips ── */
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Filters ── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* ── Endpoint list (Admin API tester) ── */
.endpoint-list {
  display: grid;
  gap: var(--space-2);
}

.endpoint-item {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.endpoint-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateX(2px);
}

.endpoint-item.active {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-glow);
}

.endpoint-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.endpoint-path {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
}

.endpoint-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ── Tester / Panel ── */
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  animation: fadeInScale 0.4s var(--transition-slow) both;
}

.split {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1.6fr;
}

.tester {
  display: grid;
  gap: var(--space-4);
}

.row {
  display: grid;
  gap: var(--space-2);
}

.row input,
.row textarea,
.row select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.row input:focus,
.row textarea:focus,
.row select:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.row textarea {
  min-height: 160px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
}

.tester-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.result {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  min-height: 64px;
  color: var(--text-secondary);
  max-height: 400px;
  overflow: auto;
}

/* ── Grid system ── */
.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(12, 1fr);
}

.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-6  { grid-column: span 6; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ── Workout cells ── */
.workout-cells {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.workout-cell {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  animation: fadeInScale 0.4s var(--transition-slow) both;
}

.workout-cell:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.workout-thumb {
  width: 140px;
  height: 96px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--surface-hover), var(--bg));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.workout-thumb svg {
  width: 140px;
  height: 96px;
}

.workout-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}

.workout-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workout-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
}

.workout-sub {
  font-size: 0.88rem;
  margin-top: var(--space-1);
}

.workout-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.stat {
  display: grid;
  gap: 2px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.workout-preview-meta {
  margin-top: var(--space-3);
  font-size: 0.82rem;
}

/* ── Link ── */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity var(--transition-fast);
}

.link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ── Modal ── */
dialog.modal {
  border: none;
  padding: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  max-width: min(720px, calc(100vw - 32px));
  animation: fadeInScale 0.3s var(--transition-slow) both;
}

dialog.modal::backdrop {
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  min-width: min(560px, calc(100vw - 32px));
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* ── Watch preview ( preserved & enhanced ) ── */
.watch-preview {
  margin-top: var(--space-3);
  display: flex;
  justify-content: center;
  align-items: center;
}

.watch-device {
  width: 300px;
  height: 360px;
  border-radius: 64px;
  background: radial-gradient(circle at 50% 45%, rgba(110, 0, 0, 0.95) 0%, rgba(35, 0, 0, 0.98) 42%, rgba(0, 0, 0, 1) 100%);
  padding: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.watch-screen {
  width: 100%;
  height: 100%;
  border-radius: 52px;
  background: radial-gradient(circle at 50% 45%, rgba(125, 0, 0, 0.95) 0%, rgba(50, 0, 0, 0.98) 55%, rgba(0, 0, 0, 1) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

.watch-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.watch-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 42px;
  z-index: 1;
}

.watch-face-dots {
  position: absolute;
  right: 12px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.watch-face-dots .dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.watch-face-dots .dot.active {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.watch-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 9px;
  align-items: center;
}

.watch-tabs .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.watch-tabs .dot.active {
  background: rgba(255, 255, 255, 0.88);
}

.watch-layout {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  padding: 2px;
  gap: 2px;
}

.watch-layout.is-hidden { display: none; }

.watch-layout.layout_1111 {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(4, 1fr);
}

.watch-layout.layout_1221 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
  grid-template-areas:
    "a a"
    "b c"
    "d e"
    "f f";
}

.watch-layout.layout_1221 .area-a { grid-area: a; }
.watch-layout.layout_1221 .area-b { grid-area: b; }
.watch-layout.layout_1221 .area-c { grid-area: c; }
.watch-layout.layout_1221 .area-d { grid-area: d; }
.watch-layout.layout_1221 .area-e { grid-area: e; }
.watch-layout.layout_1221 .area-f { grid-area: f; }

.watch-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  user-select: none;
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
  background: rgba(0, 0, 0, 0.92);
  border-radius: var(--radius-sm);
}

.watch-slot:hover { background: rgba(0, 0, 0, 0.86); }

.watch-slot.active {
  background: rgba(0, 0, 0, 0.82);
  box-shadow: inset 0 0 0 2px rgba(29, 158, 117, 0.45);
  margin-top: 2px;
}

.watch-metric { display: grid; gap: 6px; place-items: center; }
.watch-label { font-size: 11px; letter-spacing: 0.18em; font-weight: 800; color: rgba(255, 255, 255, 0.62); }
.watch-value { font-size: 28px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }

.watch-sep {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  display: none;
}
.watch-sep.sep-h { left: 0; right: 0; height: 2px; }
.watch-sep.sep-h.h1 { top: 25%; }
.watch-sep.sep-h.h2 { top: 50%; }
.watch-sep.sep-h.h3 { top: 75%; }
.watch-sep.sep-v { top: 25%; height: 50%; width: 2px; left: 50%; }

.watch-editor {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr 1.15fr;
  align-items: start;
}

.watch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.watch-editor-header {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr 1fr;
  margin-bottom: var(--space-3);
}

.watch-metric-groups {
  display: grid;
  gap: var(--space-3);
  max-height: 520px;
  overflow: auto;
  padding-right: var(--space-1);
}

.watch-metric-group-title { font-weight: 900; margin: 0 0 var(--space-2); font-size: 0.9rem; }

.watch-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.watch-metric-item {
  text-align: left;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.watch-metric-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.watch-metric-item-top { font-weight: 700; }
.watch-metric-item-sub { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Admin Layout (Dashboard) ── */
body.admin-mode {
  overflow-x: hidden;
}

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transition: width var(--transition-slow), transform var(--transition-slow);
}

/* Sidebar header with collapse toggle */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--sidebar-border);
  height: var(--topbar-height);
}

.sidebar-header .logo {
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast), width var(--transition-fast);
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
  background: var(--sidebar-hover);
}

.sidebar-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Sidebar navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

.sidebar-link .sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link .sidebar-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-color: var(--sidebar-active-border);
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon svg {
  stroke: var(--sidebar-text-active);
}

/* Sidebar footer / user */
.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--sidebar-border);
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.sidebar-user-menu-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-user-menu-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

/* User popup */
.sidebar-user-popup {
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: calc(100% + 8px);
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
  z-index: 50;
  animation: fadeInScale 0.2s var(--transition-slow) both;
}

.sidebar-user-popup.show {
  display: block;
}

.sidebar-popup-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.sidebar-popup-item:hover {
  background: var(--sidebar-hover);
}

.sidebar-popup-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  stroke: var(--text-secondary);
  flex-shrink: 0;
}

/* Collapsed sidebar */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header .logo {
  opacity: 0;
  width: 0;
  pointer-events: none;
}

.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-menu-btn {
  opacity: 0;
  width: 0;
  pointer-events: none;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: var(--space-3);
}

.sidebar.collapsed .sidebar-footer {
  display: flex;
  justify-content: center;
}

.sidebar.collapsed .sidebar-user {
  padding: var(--space-2);
  justify-content: center;
}

.sidebar.collapsed .sidebar-user-popup {
  left: calc(var(--sidebar-collapsed-width) + var(--space-3));
  bottom: var(--space-3);
  width: 200px;
  right: auto;
}

.sidebar.collapsed + .sidebar-overlay + .admin-main {
  margin-left: var(--sidebar-collapsed-width);
}

/* Admin main area */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-slow);
}

.admin-topbar {
  height: var(--topbar-height);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 30;
}

.admin-topbar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.admin-content {
  flex: 1;
  padding: var(--space-6);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 var(--space-2);
  letter-spacing: 0;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 0 0 var(--space-6);
  font-size: 0.95rem;
}

/* ── Dashboard Cards / Stats ── */
.stat-cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  animation: fadeInScale 0.4s var(--transition-slow) both;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 var(--space-2);
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

/* removed dead .sidebar-toggle rule */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 35;
}

/* ── Pricing / Plans cards (public) ── */
.pricing-cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.5s var(--transition-slow) both;
}

.pricing-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.pricing-card.featured::before {
  content: 'Mais popular';
  position: absolute;
  top: 14px;
  right: -32px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 36px;
  transform: rotate(45deg);
}

.pricing-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--space-2);
}

.pricing-price {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: var(--space-3) 0;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: var(--space-5) 0;
  text-align: left;
}

.pricing-features li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child { border-bottom: none; }

/* ── Support / FAQ ── */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
}

.faq-question:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-glow);
  border-radius: var(--radius-md);
}

.faq-icon {
  flex-shrink: 0;
  margin-left: var(--space-3);
  font-weight: 700;
  color: var(--text-secondary);
}

.faq-answer {
  padding: 0 var(--space-5) var(--space-4);
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
  margin-top: auto;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .watch-editor { grid-template-columns: 1fr; }
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .home-hero::before {
    inset: 45% -18vw auto -10vw;
    height: 42%;
  }
  .home-product {
    min-height: 500px;
  }
  .home-section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .feature-mosaic {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .workout-cell {
    grid-template-columns: 1fr;
  }
  .workout-thumb {
    width: 100%;
    height: 120px;
  }
  .workout-thumb svg {
    width: 100%;
    height: 120px;
  }
  .workout-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-3, .span-4, .span-6, .span-8 { grid-column: span 12; }
  .workflow-rail {
    grid-template-columns: 1fr;
  }
  .workflow-rail article {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .workflow-rail article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 780px) {
  .nav-inner {
    height: auto;
    padding: var(--space-3) 0;
    align-items: flex-start;
  }
  .nav-left {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  .nav-links { gap: var(--space-1); }
  .nav-right {
    align-self: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar.collapsed .sidebar-header .logo,
  .sidebar.collapsed .sidebar-label,
  .sidebar.collapsed .sidebar-user-info,
  .sidebar.collapsed .sidebar-user-menu-btn {
    opacity: 1;
    width: auto;
    pointer-events: auto;
  }
  .sidebar.collapsed .sidebar-link {
    justify-content: flex-start;
    padding: var(--space-3) var(--space-3);
  }
  .admin-main {
    margin-left: 0 !important;
  }
  .sidebar-overlay.show {
    display: block;
  }
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Utilities ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.w-full { width: 100%; }

.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }
.animate-delay-6 { animation-delay: 0.3s; }

/* ── Input file custom style ── */
input[type="file"].input {
  padding: 9px 12px;
  cursor: pointer;
}
input[type="file"].input::file-selector-button {
  margin-right: var(--space-3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
input[type="file"].input::file-selector-button:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Workout thumb placeholder ── */
.workout-thumb:empty::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-light), transparent);
  opacity: 0.5;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-6);
}
.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-light), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 1.6rem;
}
.empty-state-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
}
.empty-state-desc {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto var(--space-4);
  font-size: 0.92rem;
}

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg-elevated) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s both;
  max-width: 360px;
  pointer-events: auto;
  font-size: 0.92rem;
}
.toast.success { border-left: 4px solid var(--accent); }
.toast.error { border-left: 4px solid var(--danger); }

/* ── Loading button ── */
.btn.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn.secondary.is-loading::after {
  border-color: rgba(15,23,42,0.15);
  border-top-color: var(--text);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton { animation: none; background: var(--surface-hover); }
}

/* ── Sidebar icon active color inheritance ── */
.sidebar-link.active .sidebar-icon svg {
  stroke: var(--sidebar-text-active);
}

@media (max-width: 520px) {
  .watch-metric-list { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  main {
    padding-top: var(--space-5);
  }
  .container {
    padding: 0 var(--space-4);
  }
  .home-hero {
    padding-top: var(--space-5);
  }
  .home-hero h1 {
    font-size: clamp(2.6rem, 16vw, 4rem);
  }
  .home-actions .btn {
    width: 100%;
  }
  .home-proof {
    grid-template-columns: 1fr;
    margin-top: var(--space-6);
  }
  .home-proof div {
    padding: var(--space-3) 0;
  }
  .home-product {
    min-height: 430px;
    justify-content: flex-start;
  }
  .product-panel {
    min-height: 380px;
    padding: 14px;
    transform: none;
  }
  .product-chart {
    min-height: 150px;
    gap: 7px;
  }
  .product-watch {
    width: 134px;
    height: 166px;
    right: -4px;
    bottom: 8px;
    border-radius: 34px;
  }
  .product-watch-screen {
    border-radius: 26px;
  }
  .product-watch-screen strong {
    font-size: 1.65rem;
  }
  .watch-ring {
    width: 58px;
    height: 58px;
    border-width: 5px;
  }
  .product-metrics strong {
    font-size: 1rem;
  }
  .product-panel-top,
  .product-workout {
    align-items: flex-start;
    flex-direction: column;
  }
  .feature-mosaic {
    grid-template-columns: 1fr;
  }
  .feature-tile-large {
    grid-row: auto;
  }
}
