/* ============================================
   STYLE.CSS — Aditor Hub v3 Glassmorphism
   Design Tokens · Glassmorphism · Animations · Responsive
   ============================================ */

/* ───── DESIGN TOKENS ───── */

:root {
  /* Easing */
  --ease-golden: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Fluid type */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
}

/* ───── DARK MODE (default) ───── */

[data-theme="dark"],
:root {
  --color-bg: #08090E;
  --color-surface: rgba(255, 255, 255, 0.03);
  --color-surface-2: rgba(255, 255, 255, 0.06);
  --color-surface-3: rgba(255, 255, 255, 0.09);
  --color-surface-4: rgba(255, 255, 255, 0.12);
  --color-glass-border: rgba(255, 255, 255, 0.08);
  --color-glass-border-hover: rgba(255, 255, 255, 0.16);
  --color-glass-glow: rgba(255, 255, 255, 0.02);

  --color-text: #E8E9ED;
  --color-text-muted: #6B6E7B;
  --color-text-faint: #3D3F4A;

  --color-accent: #FF6B35;
  --color-accent-hover: #FF8F5E;
  --color-accent-glow: rgba(255, 107, 53, 0.15);
  --color-accent-subtle: rgba(255, 107, 53, 0.08);

  --color-blue: #2A5F8F;
  --color-blue-glow: rgba(42, 95, 143, 0.2);

  --color-success: #34D399;
  --color-warning: #FBBF24;
  --color-error: #F87171;

  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 32px rgba(255, 107, 53, 0.08);
  --shadow-login: 0 20px 60px rgba(255, 107, 53, 0.08);
  --shadow-glow: 0 0 60px rgba(255, 107, 53, 0.06);
}

/* ───── LIGHT MODE ───── */

[data-theme="light"] {
  --color-bg: #F5F6FA;
  --color-surface: rgba(255, 255, 255, 0.8);
  --color-surface-2: rgba(255, 255, 255, 0.95);
  --color-surface-3: rgba(255, 255, 255, 1);
  --color-surface-4: rgba(0, 0, 0, 0.04);
  --color-glass-border: rgba(0, 0, 0, 0.06);
  --color-glass-border-hover: rgba(0, 0, 0, 0.12);
  --color-glass-glow: rgba(0, 0, 0, 0.01);

  --color-text: #1A1B23;
  --color-text-muted: #6B6E7B;
  --color-text-faint: #B0B3BE;

  --color-accent: #E85A2A;
  --color-accent-hover: #FF6B35;
  --color-accent-glow: rgba(255, 107, 53, 0.1);
  --color-accent-subtle: rgba(255, 107, 53, 0.06);

  --shadow-glass: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(255, 107, 53, 0.06);
  --shadow-login: 0 20px 60px rgba(255, 107, 53, 0.06);
  --shadow-glow: 0 0 60px rgba(255, 107, 53, 0.04);
}

/* ───── BACKGROUND GLOW EFFECTS ───── */

body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, var(--color-accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bgGlow 25s ease-in-out infinite alternate;
  opacity: 0.6;
}

body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  right: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, var(--color-blue-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bgGlow2 30s ease-in-out infinite alternate;
  opacity: 0.4;
}

@keyframes bgGlow {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(10%, 15%) scale(1.05);
  }

  66% {
    transform: translate(-5%, 10%) scale(0.95);
  }

  100% {
    transform: translate(5%, -5%) scale(1.02);
  }
}

@keyframes bgGlow2 {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-10%, -8%) scale(1.1);
  }

  100% {
    transform: translate(5%, 5%) scale(0.98);
  }
}

/* ───── GLASS CARD SYSTEM ───── */

.glass-card {
  background: var(--color-surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-xl);
  transition: border-color var(--transition-interactive),
    background var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.glass-card-interactive {
  cursor: pointer;
}

.glass-card-interactive:hover {
  border-color: var(--color-glass-border-hover);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-card-hover);
}

.glass-card-interactive:active {
  transform: scale(0.985);
}

/* ───── VIEW SYSTEM ───── */

.view {
  display: none;
  opacity: 0;
}

.view.active {
  display: block;
  opacity: 0;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

@keyframes viewEnter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ───── LOGIN VIEW ───── */

.login-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.login-view.active {
  display: flex;
  opacity: 0;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: var(--login-bg-url) center / cover no-repeat;
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 14, 0.78);
  backdrop-filter: blur(4px);
}

.login-card {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: calc(100% - 48px);
  padding: var(--sp-12);
  text-align: center;
  box-shadow: var(--shadow-login);
  border-radius: var(--radius-2xl);
}

.login-avatar {
  width: 140px;
  height: 140px;
  border-radius: 0;
  object-fit: contain;
  margin: 0 auto var(--sp-4);
  background: transparent;
  box-shadow: none;
  border: none;
  filter: drop-shadow(0 6px 20px rgba(255, 107, 53, 0.35)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  animation: robot-float 3s ease-in-out infinite;
}

@keyframes robot-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.login-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 28px);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.login-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-8);
}

.login-step {
  width: 100%;
}

.login-step:not(.active) {
  display: none;
}

.login-check-icon {
  margin: 0 auto var(--sp-4);
  width: 48px;
  height: 48px;
}

.login-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--sp-3);
  text-align: center;
}

.login-input {
  display: block;
  width: 100%;
  height: 48px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full);
  padding: 0 var(--sp-6);
  font-size: 15px;
  color: var(--color-text);
  transition: border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
  margin-bottom: var(--sp-4);
  text-align: center;
}

.login-input::placeholder {
  color: var(--color-text-faint);
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #FF8F5E 0%, #FF6B35 40%, #E85A2A 100%);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: background var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.35), 0 0 40px rgba(255, 107, 53, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-interactive);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FF8F5E 0%, #FF6B35 50%, #E85A2A 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(255, 107, 53, 0.45), 0 0 60px rgba(255, 107, 53, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: color var(--transition-interactive);
}

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

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.login-powered {
  margin-top: var(--sp-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ───── DASHBOARD LAYOUT ───── */

.dashboard-view {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.dashboard-view.active {
  display: block;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

/* Dashboard content — no sticky top bar */
.dashboard-content {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-16);
}

/* ───── DASHBOARD HEADER (non-sticky) ───── */

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  margin-bottom: var(--sp-6);
}

.dash-header-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-icon-dash {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-glass-border);
  box-shadow: 0 0 20px rgba(255, 107, 53, 0.1);
  transition: box-shadow var(--transition-interactive);
}

.logo-icon-dash:hover {
  box-shadow: 0 0 24px rgba(255, 107, 53, 0.2);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive),
    background var(--transition-interactive);
  position: relative;
}

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

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-3);
  border: 1px solid var(--color-glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  overflow: hidden;
}

/* ───── GREETING ───── */

.greeting {
  margin-bottom: var(--sp-8);
}

.greeting-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.greeting-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.greeting-sub .pending-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: syncPulse 2s infinite;
  flex-shrink: 0;
}

.greeting-stage-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.greeting-stage-badge--1 { background: rgba(243, 156, 18, 0.15); color: #F39C12; }
.greeting-stage-badge--2 { background: rgba(52, 152, 219, 0.15); color: #3498DB; }
.greeting-stage-badge--3 { background: rgba(46, 213, 115, 0.15); color: #2ed573; }

.greeting-stage-rate {
  font-size: var(--text-base);
  color: var(--color-text-muted);
}

.greeting-stage-upgrade {
  font-size: 12px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* ───── EDITOR JOURNEY SECTION ───── */

.journey-section {
  margin-bottom: var(--sp-8);
}

.journey-header {
  margin-bottom: var(--sp-5);
}

.journey-heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.journey-subheading {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ── Track: horizontal row ── */
.journey-track {
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

/* Each step */
.journey-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 0 10px;
}

/* Horizontal connector line — drawn via ::after on each step except the last */
.journey-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 19px;
  left: 50%;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  z-index: 0;
}
.journey-step--done:not(:last-child)::after { background: rgba(46, 213, 115, 0.45); }
.journey-step--active:not(:last-child)::after,
.journey-step--preview:not(:last-child)::after,
.journey-step--upcoming:not(:last-child)::after { background: rgba(255,255,255,0.08); }

/* Node circle */
.journey-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  margin-bottom: 14px;
  background: #08090E;
}
.journey-node svg {
  width: 18px;
  height: 18px;
}

.journey-step--done .journey-node {
  background: rgba(46, 213, 115, 0.15);
  border: 1.5px solid rgba(46, 213, 115, 0.4);
  color: #2ed573;
}
.journey-step--active .journey-node {
  background: rgba(255, 107, 53, 0.15);
  border: 1.5px solid rgba(255, 107, 53, 0.5);
  color: var(--color-accent);
  box-shadow: 0 0 18px rgba(255, 107, 53, 0.3);
}
.journey-step--upcoming .journey-node {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.2);
}
.journey-step--preview .journey-node {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.45);
}

/* Pulse ring on active node */
.journey-node-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 107, 53, 0.3);
  animation: journeyPulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes journeyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.2); }
}

/* Content */
.journey-content {
  width: 100%;
}

.journey-weeks {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.journey-step--done .journey-weeks { color: #2ed573; opacity: 0.8; }
.journey-step--active .journey-weeks { color: var(--color-accent); }
.journey-step--preview .journey-weeks { color: rgba(255,255,255,0.4); }
.journey-step--upcoming .journey-weeks { color: rgba(255,255,255,0.2); }

.journey-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
}

.journey-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.journey-step--done .journey-title { color: var(--color-text); opacity: 0.55; }
.journey-step--active .journey-title { color: var(--color-text); }
.journey-step--preview .journey-title { color: rgba(255,255,255,0.5); }
.journey-step--upcoming .journey-title { color: rgba(255,255,255,0.2); }

/* ── Info button + tooltip ── */
.journey-info-btn {
  position: relative;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  transition: opacity 150ms;
}
.journey-step--done .journey-info-btn { color: rgba(255,255,255,0.3); }
.journey-step--active .journey-info-btn { color: rgba(255,255,255,0.45); }
.journey-step--preview .journey-info-btn { color: rgba(255,255,255,0.3); }
.journey-step--upcoming .journey-info-btn { color: rgba(255,255,255,0.15); }
.journey-info-btn:hover { opacity: 1; }

.journey-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 200px;
  background: #1a1b22;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-muted);
  font-weight: 400;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms, transform 160ms;
  z-index: 300;
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  white-space: normal;
}

/* Tooltip triggered by hovering the ⓘ button — anchored to the step */
.journey-step:has(.journey-info-btn:hover) .journey-tooltip,
.journey-step:has(.journey-info-btn:focus-visible) .journey-tooltip,
.journey-step.tooltip-open .journey-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Edge corrections: first step goes right, last step goes left */
.journey-step:first-child .journey-tooltip { left: 0; transform: translateY(4px); }
.journey-step:first-child:has(.journey-info-btn:hover) .journey-tooltip,
.journey-step:first-child.tooltip-open .journey-tooltip { transform: translateY(0); }

.journey-step:last-child .journey-tooltip { left: auto; right: 0; transform: translateY(4px); }
.journey-step:last-child:has(.journey-info-btn:hover) .journey-tooltip,
.journey-step:last-child.tooltip-open .journey-tooltip { transform: translateY(0); }


/* ── Speed Test CTA card ── */
.journey-cta {
  margin-top: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: rgba(255, 107, 53, 0.25) !important;
  box-shadow: 0 0 24px rgba(255, 107, 53, 0.08);
}

.journey-cta-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.journey-cta-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.25);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-cta-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
}

.journey-cta-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.journey-cta-desc em {
  font-style: normal;
  color: rgba(255,255,255,0.55);
}

.journey-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 11px 22px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

@media (max-width: 600px) {
  .journey-cta { flex-direction: column; align-items: flex-start; }
  .journey-cta-btn { width: 100%; justify-content: center; }
}

/* ── Mobile: stack vertically ── */
@media (max-width: 600px) {
  .journey-track {
    flex-direction: column;
    padding: 24px 20px;
    gap: 0;
  }
  .journey-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 0;
    gap: 16px;
  }
  .journey-step:not(:last-child)::after {
    top: 40px;
    left: 19px;
    width: 2px;
    height: calc(100% - 8px);
  }
  .journey-node { margin-bottom: 0; flex-shrink: 0; }
  .journey-content { padding-bottom: 28px; text-align: left; }
  .journey-step:last-child .journey-content { padding-bottom: 0; }
  .journey-title-row { justify-content: flex-start; }
}

.spin {
  animation: spinAnim 0.9s linear infinite;
}
@keyframes spinAnim {
  to { transform: rotate(360deg); }
}

/* ───── STATS ROW (2 cards) ───── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.stat-card {
  padding: var(--sp-6);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-glass-border-hover), transparent);
  opacity: 0.5;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  color: var(--color-text-faint);
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: var(--sp-2);
}

.stat-delta {
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.stat-delta.positive {
  color: var(--color-success);
}

.stat-delta.neutral {
  color: var(--color-blue);
}

.stat-delta.negative {
  color: var(--color-error);
}

.stat-card-earnings {
  background: var(--color-surface-3);
  box-shadow: var(--shadow-card-hover);
}

.stat-card-chip {
  display: block;
  width: 26px;
  height: 17px;
  border-radius: 3px;
  background: var(--color-accent);
}

.stat-card-earnings-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

.stat-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--color-glass-border);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.stat-card-footer:hover {
  color: var(--color-accent);
}

/* ───── TRAINING BANNER ───── */

.training-banner {
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-10);
  border-left: 3px solid var(--color-accent);
  position: relative;
  overflow: hidden;
}

.training-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-accent-subtle), transparent 60%);
  pointer-events: none;
}

.banner-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
}

.banner-icon svg {
  width: 22px;
  height: 22px;
}

.banner-content {
  flex: 1;
  min-width: 0;
  position: relative;
}

.banner-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  margin-bottom: 2px;
}

.banner-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ─── Training Urgency Bar ─── */
.training-urgency-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-6);
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.12), rgba(255, 107, 53, 0.15), rgba(248, 113, 113, 0.12));
  border-bottom: 1px solid rgba(248, 113, 113, 0.25);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: urgencySlideDown 400ms var(--ease-golden) forwards;
}

@keyframes urgencySlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.urgency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f87171;
  flex-shrink: 0;
  animation: urgencyPulse 1.5s infinite;
}

@keyframes urgencyPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5);
  }

  50% {
    transform: scale(1.2);
    box-shadow: 0 0 8px 4px rgba(248, 113, 113, 0.2);
  }
}

.urgency-text {
  font-size: 13px;
  font-weight: 600;
  color: #f87171;
  letter-spacing: 0.01em;
}

.urgency-btn {
  padding: var(--sp-1) var(--sp-4);
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  cursor: pointer;
  transition: all 180ms var(--ease-golden);
  white-space: nowrap;
}

.urgency-btn:hover {
  background: rgba(248, 113, 113, 0.25);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fff;
}

/* ─── Mascot Callout ─── */
.training-mascot-callout {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: calc(-1 * var(--sp-2));
  margin-bottom: var(--sp-4);
  padding-right: var(--sp-4);
  animation: mascotFadeIn 600ms var(--ease-golden) forwards;
}

@keyframes mascotFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mascot-speech {
  position: relative;
  background: var(--color-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  white-space: nowrap;
  animation: mascotBounce 2s ease-in-out infinite;
}

@keyframes mascotBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.speech-arrow {
  position: absolute;
  right: 16px;
  bottom: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-accent);
}

.mascot-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  animation: mascotFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 107, 53, 0.2));
}

@keyframes mascotFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-6px) rotate(3deg);
  }
}

/* Notion footnote link */
.notion-footnote {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.notion-footnote-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-style: italic;
  letter-spacing: 0.02em;
  transition: color 180ms var(--ease-golden);
  cursor: pointer;
}

.notion-footnote-link:hover {
  color: var(--color-accent);
}

.notion-footnote-icon {
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 180ms var(--ease-golden);
}

.notion-footnote-link:hover .notion-footnote-icon {
  opacity: 1;
}

.btn-orange {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  background: linear-gradient(135deg, #FF8F5E 0%, #FF6B35 40%, #E85A2A 100%);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  transition: background var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
  position: relative;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  overflow: hidden;
}

.btn-orange::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-interactive);
}

.btn-orange:hover::before {
  opacity: 1;
}

.btn-orange:hover {
  background: linear-gradient(135deg, #FF8F5E 0%, #FF6B35 50%, #E85A2A 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45), 0 0 40px rgba(255, 107, 53, 0.12);
}

.btn-orange:active {
  transform: translateY(0);
}

/* ───── WORKSPACE HEADLINE ───── */

.workspace-headline {
  margin-bottom: var(--sp-6);
  margin-top: var(--sp-2);
}

.workspace-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.workspace-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

/* ───── TOOL SECTION ───── */

.tools-section {
  margin-bottom: var(--sp-10);
}

/* Row 1 wrapper: 4 compact tools + 2 stacked AI tiles */
.tool-grid-row1 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  align-items: start;
}

/* Uniform 4-column grid for both rows */
.tool-grid-uniform {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

/* Row 1: Main Tools — 4 compact cards */
.tool-grid-main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

/* Row 2: Mix — single wide card */
.tool-grid-mix {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

/* Row 1 Right: AI tiles — 2 stacked small squares */
.tool-grid-ai {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 120px;
}

/* Row 3: Notion + Trello */
.tool-grid-notiontrello {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

/* Tool cards — base */
.tool-card {
  cursor: pointer;
  text-decoration: none;
  display: flex;
  opacity: 0;
  animation: cardReveal 500ms var(--ease-golden) forwards;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-glass-border-hover), transparent);
  opacity: 0.3;
}

.tool-card:hover {
  border-color: rgba(255, 107, 53, 0.25);
  background: var(--color-surface-2);
  box-shadow: var(--shadow-card-hover);
}

.tool-card:active {
  transform: scale(0.985);
}

@keyframes cardReveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Compact main tool cards (Row 1) — horizontal, no description */
.tool-card-main {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  min-height: 64px;
}

/* Uniform tool card (same size in both rows) */
.tool-card-uniform {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  min-height: 64px;
}

/* Mix card (Row 2) */
.tool-card-mix {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  min-height: 68px;
}

.tool-card-info {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.tool-card-mix .tool-card-info {
  flex: 1;
}

/* Tool badge (mic, video, etc.) shown at the trailing edge of a tool card */
.tool-badge-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: var(--sp-2);
}

.tool-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--color-text-faint);
  opacity: 0.55;
  transition: opacity var(--transition-interactive), color var(--transition-interactive);
  pointer-events: none;
}

.tool-badge svg {
  width: 14px;
  height: 14px;
}

.tool-card:hover .tool-badge {
  opacity: 0.85;
  color: var(--color-text-muted);
}

/* AI tiles (Row 1, right column) — small square */
.tool-card-ai {
  flex-direction: column;
  align-items: flex-start;
  padding: var(--sp-3);
  width: 120px;
  min-height: 96px;
  flex-shrink: 0;
}

/* Notion/Trello utility cards (Row 3) */
.tool-card-utility {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  min-height: 68px;
}

/* Tool card components */
.tool-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.tool-logo-mix {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.tool-logo-ai {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  margin-bottom: var(--sp-2);
  flex-shrink: 0;
}

.tool-logo-utility {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.tool-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card-main .tool-name {
  font-size: 13px;
  font-weight: 600;
}

.tool-card-mix .tool-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.tool-card-ai .tool-name {
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  line-height: 1.2;
}

.tool-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.tool-card-ai .tool-desc {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.3;
  margin-top: 1px;
}

/* Flow Studio inline SVG fallback */
.tool-logo-svg {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(42, 95, 143, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-ai .tool-logo-svg {
  width: 28px;
  height: 28px;
  margin-bottom: var(--sp-2);
}

.tool-logo-svg svg {
  width: 16px;
  height: 16px;
  color: var(--color-text);
}

/* ───── BRANDS SECTION (unified — boards & guides) ───── */

.brands-section {
  margin-bottom: var(--sp-10);
  margin-top: var(--sp-4);
}

.brands-header {
  margin-bottom: var(--sp-5);
}

.brands-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.brands-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3);
}

.brand-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.18s var(--ease-golden), border-color 0.18s var(--ease-golden);
}

.brand-card:hover {
  transform: translateY(-1px);
}

.brand-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover, var(--color-accent)));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-card-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-card-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.18s var(--ease-golden), transform 0.18s var(--ease-golden);
}

.brand-card:hover .brand-card-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* ───── GETTING STARTED (Stage 1 brands body) ───── */

.getting-started {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.gs-primary {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-xl, 18px);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.18s var(--ease-golden);
}

.gs-primary:hover {
  transform: translateY(-1px);
}

.gs-primary-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(108, 63, 197, 0.12);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gs-primary-body {
  flex: 1;
  min-width: 0;
}

.gs-primary-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 2px;
}

.gs-primary-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 2px;
  line-height: 1.2;
}

.gs-primary-sub {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

.gs-primary-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.18s var(--ease-golden), transform 0.18s var(--ease-golden);
}

.gs-primary:hover .gs-primary-arrow {
  opacity: 1;
  transform: translate(2px, -2px);
}

.gs-setup {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-xl, 18px);
}

.gs-setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.gs-setup-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gs-setup-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.setup-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}

.setup-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--color-glass-border);
  background: transparent;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s var(--ease-golden), border-color 0.15s var(--ease-golden), color 0.15s var(--ease-golden);
}

.setup-check svg {
  width: 14px;
  height: 14px;
}

.setup-check:hover {
  border-color: var(--color-glass-border-hover);
}

.setup-item-done .setup-check {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.setup-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s var(--ease-golden);
}

.setup-link:hover {
  color: var(--color-accent);
}

.setup-link svg {
  color: var(--color-text-muted);
  opacity: 0.6;
  transition: opacity 0.15s var(--ease-golden);
}

.setup-link:hover svg {
  opacity: 1;
}

.setup-item-done .setup-link {
  color: var(--color-text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--color-text-muted);
}

.gs-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s var(--ease-golden);
}

.gs-secondary:hover {
  color: var(--color-text);
}

.gs-secondary svg {
  opacity: 0.7;
}

/* ───── UPCOMING EVENTS ───── */

.upcoming-events-section {
  margin-bottom: var(--sp-10);
}

.upcoming-events-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.upcoming-events-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.upcoming-events-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.calendar-view-all {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  margin-top: 4px;
  transition: color var(--transition-interactive);
  flex-shrink: 0;
}

.calendar-view-all:hover {
  color: var(--color-accent);
}

.upcoming-events-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.event-card {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-5) var(--sp-6);
  text-decoration: none;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  animation: cardReveal 500ms var(--ease-golden) forwards;
  opacity: 0;
}

.event-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  flex-shrink: 0;
}

.event-date-month {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 2px;
}

.event-date-day {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.event-divider {
  width: 1px;
  height: 40px;
  background: var(--color-glass-border);
  flex-shrink: 0;
}

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

.event-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.event-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-location-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition-interactive);
}

.event-location-link:hover {
  opacity: 0.8;
}

.event-actions {
  flex-shrink: 0;
}

.btn-add-cal {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-interactive);
}

.btn-add-cal:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.events-empty {
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.events-loading {
  padding: var(--sp-2) 0;
}

/* ───── FOOTER / SYNC ───── */

.dash-footer {
  text-align: center;
  padding: var(--sp-8) 0 var(--sp-4);
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sync-dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
  animation: syncPulse 2s infinite;
}

@keyframes syncPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
}

/* ───── TRAINING MODAL ───── */

.training-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}

.training-overlay.active {
  display: flex;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

.training-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.training-modal {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
  padding: var(--sp-8);
  border-radius: var(--radius-2xl);
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: modalSlideUp 400ms var(--ease-golden) forwards;
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  z-index: 2;
  transition: color var(--transition-interactive),
    background var(--transition-interactive);
  cursor: pointer;
}

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

.modal-close svg {
  width: 18px;
  height: 18px;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.training-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-4);
}

/* Video placeholder */
.video-placeholder {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #0F1219;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

.video-placeholder-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}

.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px var(--color-accent-glow);
}

.play-btn svg {
  width: 24px;
  height: 24px;
  color: #fff;
  margin-left: 3px;
}

.video-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* Progress bar */
.progress-track {
  width: 100%;
  height: 4px;
  background: var(--color-surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--sp-5);
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.btn-watched {
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-golden);
}

.btn-watched.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Quiz */
.quiz-phase {
  display: none;
}

.quiz-phase.active {
  display: block;
  animation: slideInRight 400ms var(--ease-golden) forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(30px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.quiz-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.quiz-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-6);
}

.quiz-question {
  display: none;
}

.quiz-question.active {
  display: block;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

.quiz-question-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--sp-5);
  line-height: 1.5;
}

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.quiz-answer {
  width: 100%;
  padding: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 14px;
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive);
}

.quiz-answer:hover {
  background: var(--color-surface-2);
  border-color: var(--color-glass-border-hover);
}

.quiz-answer.correct {
  background: rgba(52, 211, 153, 0.15);
  border-color: var(--color-success);
  color: var(--color-success);
  transform: scale(1.02);
}

.quiz-answer.wrong {
  background: rgba(248, 113, 113, 0.15);
  border-color: var(--color-error);
  color: var(--color-error);
  animation: shake 0.4s var(--ease-golden);
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  50% {
    transform: translateX(6px);
  }

  75% {
    transform: translateX(-4px);
  }
}

.quiz-answer:disabled {
  cursor: default;
  pointer-events: none;
}

/* Progress dots */
.quiz-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.quiz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-surface-3);
  transition: all var(--transition-interactive);
}

.quiz-dot.answered {
  background: var(--color-accent);
}

.quiz-dot.current {
  background: var(--color-accent);
  animation: syncPulse 1.5s infinite;
}

/* Open text quiz question */
.quiz-open-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.quiz-textarea {
  width: 100%;
  padding: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--color-text);
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--transition-interactive);
}

.quiz-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.quiz-textarea:disabled {
  opacity: 0.6;
  cursor: default;
}

.quiz-submit-open {
  align-self: flex-end;
  padding: var(--sp-2) var(--sp-6);
  font-size: 14px;
}

.quiz-submit-open:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Training progress counter */
.training-progress-counter {
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--sp-4);
  letter-spacing: 0.02em;
}

.result-image {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto var(--sp-6);
  animation: playerFloat 3s ease-in-out infinite;
}

@keyframes playerFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.btn-full-orange {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-8);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.btn-full-orange:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--color-accent-glow);
}

.btn-full-orange:active {
  transform: translateY(0);
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-8);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  color: var(--color-text);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition-interactive),
    border-color var(--transition-interactive);
}

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

/* Confetti */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ───── ADMIN VIEW ───── */

.admin-view {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.admin-view.active {
  display: block;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

/* Admin top bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--color-glass-border);
  padding: var(--sp-4) var(--sp-8);
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.admin-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-8) var(--sp-16);
}

.admin-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.admin-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 28px);
  font-weight: 700;
  color: var(--color-text);
}

.admin-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
}

.admin-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin tabs */
.admin-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.admin-tab {
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.admin-tab:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.admin-tab.active {
  background: var(--color-surface-2);
  color: var(--color-text);
  border-color: var(--color-glass-border-hover);
}

/* Admin panel */
.admin-panel {
  display: none;
}

.admin-panel.active {
  display: block;
  animation: viewEnter 300ms var(--ease-golden) forwards;
}

/* Tables */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  overscroll-behavior: contain;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--color-glass-border);
  position: sticky;
  top: 0;
  background: var(--color-surface);
}

.admin-table tbody td {
  padding: var(--sp-4) var(--sp-5);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-glass-border);
  font-variant-numeric: tabular-nums lining-nums;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .admin-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

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

/* Status badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--color-success);
}

.badge-yellow {
  background: rgba(251, 191, 36, 0.12);
  color: var(--color-warning);
}

.badge-red {
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-error);
}

/* Ghost button */
.btn-ghost-orange {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-interactive);
}

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

/* Training cards in admin */
.training-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.training-item {
  padding: var(--sp-5);
}

.training-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.training-item-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

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

.training-item-progress {
  height: 4px;
  background: var(--color-surface-3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--sp-2);
}

.training-item-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
}

.training-item-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--sp-5);
}

/* ───── SUBMIT FOR REVIEW ─────
   Paste field + open-card entries on the dashboard; the modal hosts
   review.aditor.ai chrome-less (?embed=1). Look ported from the agreed
   reference: feedback-agent/public/hub-preview.html (dark glass, hairlines). */

.review-section {
  margin-bottom: var(--sp-10);
  margin-top: var(--sp-4);
}

.review-paste {
  display: flex;
  gap: var(--sp-3);
  max-width: 640px;
}

.review-paste input {
  flex: 1;
  min-width: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-text);
  font: inherit;
  transition: border-color var(--transition-interactive);
}

.review-paste input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.review-cards {
  margin-top: var(--sp-4);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.review-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-4);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.review-card:disabled {
  opacity: 0.55;
  cursor: default;
}

.review-card-title {
  font-weight: 600;
  color: var(--color-text);
}

.review-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.review-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
}

.review-modal-card {
  position: relative;
  width: min(880px, 94vw);
  background: #101014;
  border: 1px solid var(--color-glass-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 30px 80px rgba(0, 0, 0, 0.6);
}

.review-modal-card iframe {
  display: block;
  width: 100%;
  border: 0;
  min-height: 520px;
  max-height: 85vh;
  background: transparent;
}

.review-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  border-radius: var(--radius-full);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.review-close:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ───── MOBILE BOTTOM NAV ───── */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--color-surface);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--color-glass-border);
  padding: var(--sp-2) 0 max(var(--sp-2), env(safe-area-inset-bottom));
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  min-width: 64px;
  min-height: 44px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-interactive);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--color-accent);
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

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

/* Tablet */
@media (max-width: 1023px) {
  .tool-grid-main {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-grid-uniform {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-grid-row1 {
    grid-template-columns: 1fr;
  }

  .tool-grid-ai {
    width: 100%;
    flex-direction: row;
  }

  .tool-card-ai {
    width: auto;
    flex: 1;
  }

}

/* Mobile */
@media (max-width: 767px) {
  .mobile-nav {
    display: block;
  }

  .dashboard-content,
  .admin-content {
    padding: var(--sp-4) var(--sp-4) calc(var(--sp-16) + 60px);
  }

  .top-bar {
    padding: var(--sp-3) var(--sp-4);
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .stat-value {
    font-size: 36px;
  }

  .tool-grid-uniform {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-grid-main {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-grid-row1 {
    grid-template-columns: 1fr;
  }

  .tool-grid-ai {
    width: 100%;
    flex-direction: row;
  }

  .tool-card-ai {
    width: auto;
    flex: 1;
    min-height: 80px;
  }

  .tool-grid-notiontrello {
    grid-template-columns: 1fr;
  }

  .training-banner {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-4);
  }

  .training-modal {
    padding: var(--sp-6);
    margin: var(--sp-4);
    max-height: calc(100vh - 32px);
  }

  .login-card {
    padding: var(--sp-8);
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .admin-table-wrap {
    margin: 0 calc(-1 * var(--sp-4));
  }

  .dash-header {
    margin-bottom: var(--sp-4);
  }
}

/* Very small mobile */
@media (max-width: 400px) {
  .tool-grid-main {
    grid-template-columns: 1fr;
  }
}

/* Touch device adjustments */
@media (hover: none) {
  .glass-card-interactive:hover {
    border-color: var(--color-glass-border);
    background: var(--color-surface);
    transform: none;
    box-shadow: none;
  }

  .tool-card:hover {
    border-color: var(--color-glass-border);
    background: var(--color-surface);
    transform: none;
    box-shadow: none;
  }

  .tool-card:active {
    background: var(--color-surface-2);
    border-color: rgba(255, 107, 53, 0.25);
  }
}

/* ───── SKELETON LOADING ───── */

.skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, rgba(255, 255, 255, 0.06) 50%, var(--color-surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.04) 25%, rgba(0, 0, 0, 0.08) 50%, rgba(0, 0, 0, 0.04) 75%);
  background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ───── TOAST NOTIFICATIONS ───── */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-golden), transform 0.3s var(--ease-golden);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: calc(100% - 48px);
  text-align: center;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-info {
  background: rgba(42, 95, 143, 0.85);
  color: #fff;
  border: 1px solid rgba(42, 95, 143, 0.5);
}

.toast-error {
  background: rgba(248, 113, 113, 0.85);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.5);
}

/* ───── SIGN OUT BUTTON ───── */

.btn-sign-out {
  color: var(--color-text-muted);
}

.btn-sign-out:hover {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
}

/* ───── SYNC NOW BUTTON ───── */

.btn-sync-now {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  margin-left: var(--sp-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-interactive);
}

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

.btn-sync-now:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ───── NOTIFICATION DOT ───── */

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

/* ───── ANALYTICS TAB ───── */

.analytics-date-pills {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.date-pill {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.date-pill:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.date-pill.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* KPI Cards Row */
.analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.kpi-card {
  padding: var(--sp-5) var(--sp-5);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-glass-border-hover), transparent);
  opacity: 0.5;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  margin-bottom: var(--sp-1);
}

.kpi-sub {
  font-size: 11px;
  color: var(--color-text-faint);
}

/* Analytics Sections */
.analytics-section {
  margin-bottom: var(--sp-8);
}

.analytics-section-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-4);
}

/* Tool Usage Bars */
.tool-bars-container {
  padding: var(--sp-5);
  border-radius: var(--radius-xl);
}

.tool-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.tool-bar-row:last-child {
  margin-bottom: 0;
}

.tool-bar-name {
  width: 140px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-bar-track {
  flex: 1;
  height: 24px;
  background: var(--color-surface-2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.tool-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
  border-radius: 6px;
  width: 0%;
  transition: width 600ms var(--ease-golden);
  min-width: 2px;
}

.tool-bar-hours {
  width: 60px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Daily Activity Trend (mini bar chart) */
.daily-trend-container {
  padding: var(--sp-5);
  border-radius: var(--radius-xl);
}

.daily-trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding-top: var(--sp-2);
}

.daily-trend-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: var(--sp-1);
}

.daily-trend-bar {
  width: 100%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-hover));
  border-radius: 4px 4px 2px 2px;
  transition: height 600ms var(--ease-golden);
}

.daily-trend-bar:hover {
  opacity: 0.8;
}

.daily-trend-label {
  font-size: 9px;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.daily-trend-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-2);
}

.daily-trend-labels span {
  font-size: 10px;
  color: var(--color-text-faint);
}

/* Analytics Empty State */
.analytics-empty {
  padding: var(--sp-12) var(--sp-8);
  text-align: center;
  border-radius: var(--radius-xl);
}

.analytics-empty-icon {
  margin: 0 auto var(--sp-4);
  color: var(--color-text-faint);
}

.analytics-empty-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-2);
}

.analytics-empty-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 360px;
  margin: 0 auto;
}

/* ───── MY LINKS TAB ───── */

.mylinks-header,
.trainings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.mylinks-section-title,
.trainings-section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

.mylinks-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.mylink-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  transition: background var(--transition-interactive),
    border-color var(--transition-interactive);
}

.mylink-row:hover {
  background: var(--color-surface-2);
}

.mylink-emoji {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

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

.mylink-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.mylink-url {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mylink-category {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-glass-border);
  flex-shrink: 0;
}

.mylink-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.mylink-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-interactive);
  background: none;
  border: none;
}

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

.mylink-btn.btn-delete:hover {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
}

.mylink-btn svg {
  width: 16px;
  height: 16px;
}

/* Drag handle for mylink rows */
.mylink-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  cursor: grab;
  border-radius: var(--radius-sm);
  transition: color var(--transition-interactive), background var(--transition-interactive);
}

.mylink-drag-handle:hover {
  color: var(--color-text);
  background: var(--color-surface-3);
}

.mylink-drag-handle:active {
  cursor: grabbing;
}

/* Row being dragged */
.mylink-row.dragging {
  opacity: 0.45;
  border-color: var(--color-accent) !important;
  background: var(--color-surface-2);
}

/* Drop target highlight */
.mylink-row.drag-over {
  border-color: var(--color-accent) !important;
  background: var(--color-accent-subtle);
  box-shadow: 0 0 0 2px var(--color-accent-glow);
}

/* Subtitle under My Links section title */
.mylinks-section-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 2px 0 0;
}

/* Inline edit mode for mylink rows */
.mylink-row.editing {
  background: var(--color-surface-2);
  border-color: var(--color-glass-border-hover);
}

.mylink-row .edit-field {
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-2);
  font-size: 13px;
  color: var(--color-text);
  width: 100%;
  transition: border-color var(--transition-interactive);
}

.mylink-row .edit-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-glow);
}

/* ───── FORMS (shared by My Links & Training Links) ───── */

.tool-add-form,
.training-link-form {
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  border-radius: var(--radius-xl);
  animation: formSlideIn 300ms var(--ease-golden) forwards;
}

@keyframes formSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-4);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}

.form-input {
  display: block;
  width: 100%;
  height: 40px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-3);
  font-size: 14px;
  color: var(--color-text);
  transition: border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
  font-family: var(--font-body);
}

.form-input::placeholder {
  color: var(--color-text-faint);
}

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

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

.form-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

.btn-cancel {
  font-size: 14px;
  padding: var(--sp-2) var(--sp-5);
}

/* ───── TRAINING LINK CARDS (admin) ───── */

.training-link-card {
  padding: var(--sp-5);
  position: relative;
}

.training-link-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.training-link-card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.training-link-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.training-type-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.training-type-badge.notion {
  background: rgba(42, 95, 143, 0.12);
  color: var(--color-blue);
}

[data-theme="light"] .training-type-badge.notion {
  background: rgba(42, 95, 143, 0.1);
}

.training-type-badge.loom {
  background: rgba(107, 65, 255, 0.12);
  color: #8B6AFF;
}

.training-type-badge.other {
  background: var(--color-surface-3);
  color: var(--color-text-muted);
}

.training-link-date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.training-link-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

.training-link-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.training-link-url {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--transition-interactive);
  word-break: break-all;
}

.training-link-url:hover {
  opacity: 0.8;
}

.btn-copy-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-interactive);
}

.btn-copy-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-delete-training {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-interactive);
  background: none;
  border: none;
}

.btn-delete-training:hover {
  color: var(--color-error);
  background: rgba(248, 113, 113, 0.1);
}

.btn-delete-training svg {
  width: 14px;
  height: 14px;
}

/* ───── RESPONSIVE: Analytics & My Links ───── */

@media (max-width: 1023px) {
  .analytics-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .analytics-kpi-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .tool-bar-name {
    width: 100px;
  }

  .mylink-row {
    flex-wrap: wrap;
  }

  .mylink-category {
    order: 10;
  }

  .analytics-date-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ─── FIX 4: Tool logos in admin table ─── */
.tool-logo-admin {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.tool-logo-admin.tool-logo-svg {
  width: 24px;
  height: 24px;
}

/* ─── FIX 5: Preview as Editor button & banner ─── */
.btn-preview-editor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-interactive);
  margin-left: auto;
  font-family: var(--font-body);
}

.btn-preview-editor:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  letter-spacing: 0.5px;
}


/* ============================================
   STAGE SYSTEM, OPEN CARDS, NOTIFICATIONS
   v2.1 additions
   ============================================ */

/* ─── Notification Banner ──────────────── */
.notification-banner { margin-bottom: var(--sp-4); }
.notification-banner-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 18px;
  border-left: 4px solid var(--color-accent);
}
.notification-banner-icon { flex-shrink: 0; width: 24px; height: 24px; }
.notification-banner-icon svg { width: 24px; height: 24px; }
.notification-banner-body { flex: 1; min-width: 0; }
.notification-banner-body strong { display: block; font-size: 14px; color: var(--color-text); }
.notification-banner-body p { font-size: 13px; color: var(--color-text-muted); margin: 2px 0 0; }
.icon-btn-sm { width: 28px; height: 28px; padding: 4px; }
.icon-btn-sm svg { width: 14px; height: 14px; }
.btn-sm { font-size: 13px; padding: 6px 14px; border-radius: 8px; }

/* ─── Stage Section ────────────────────── */
.stage-section { margin-bottom: var(--sp-4); }
.stage-block { padding: 20px; margin-bottom: var(--sp-3); }
.stage-block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stage-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}
.stage-badge-1 { background: rgba(243, 156, 18, 0.15); color: #F39C12; }
.stage-badge-2 { background: rgba(52, 152, 219, 0.15); color: #3498DB; }
.stage-badge-3 { background: rgba(155, 89, 182, 0.15); color: #9B59B6; }
.stage-block-count { font-size: 13px; color: var(--color-text-muted); }
.stage-block-body { display: flex; gap: 20px; align-items: flex-start; }
.stage-block-icon { flex-shrink: 0; width: 40px; height: 40px; color: var(--color-accent); }
.stage-block-icon svg { width: 40px; height: 40px; }
.stage-block-title { font-size: 17px; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.stage-block-desc { font-size: 14px; color: var(--color-text-muted); margin-bottom: 14px; line-height: 1.5; }

/* Exam section — centered layout */
.exam-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.exam-icon-wrap {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
  margin-bottom: 14px;
  background: rgba(243, 156, 18, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.exam-icon-wrap svg { width: 28px; height: 28px; }
.exam-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.exam-desc {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  max-width: 420px;
  line-height: 1.5;
}
.exam-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  text-align: left;
}
.exam-steps li {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.5;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.exam-steps li::before {
  content: counter(exam-step);
  counter-increment: exam-step;
  font-size: 12px;
  font-weight: 700;
  color: #F39C12;
  background: rgba(243, 156, 18, 0.15);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.exam-steps { counter-reset: exam-step; }

/* Exam form */
.exam-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
  width: 100%;
}
.exam-notes-input {
  resize: none;
  font-size: 13px;
}
.exam-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  margin-top: 8px;
}
.exam-status svg { width: 24px; height: 24px; flex-shrink: 0; }

/* Stage 3: Brand cards */
.stage-brand-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stage-brand-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.stage-brand-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.stage-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.stage-brand-name { font-size: 14px; font-weight: 600; }
.stage-brand-card svg { color: var(--color-text-muted); flex-shrink: 0; }

/* ─── Open Cards Dispatch ──────────────── */
.open-cards-section { margin-bottom: var(--sp-6); }
.open-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.open-cards-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
}
.open-cards-title svg { color: var(--color-accent); }
.open-cards-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(108, 63, 197, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
}
.open-cards-subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin: 16px 0 10px;
}
.open-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.open-cards-empty p { color: var(--color-text-muted); font-size: 14px; text-align: center; padding: 24px 0; }

.open-card {
  padding: 16px 20px;
  transition: transform 0.12s ease;
}
.open-card:hover { transform: translateY(-1px); }
.open-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.open-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.open-card-client { font-size: 13px; color: var(--color-text-muted); }
.open-card-title { font-size: 15px; font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.open-card-desc { font-size: 13px; color: var(--color-text-muted); margin-bottom: 10px; line-height: 1.4; }
.open-card-actions { display: flex; align-items: center; gap: 10px; }
.card-stage-req { font-size: 12px; color: var(--color-text-muted); }

.card-priority-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.card-rush .card-priority-badge { background: rgba(231, 76, 60, 0.15); color: #E74C3C; }
.card-urgent .card-priority-badge { background: rgba(243, 156, 18, 0.15); color: #F39C12; }
.card-priority-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
}
.card-deadline { font-size: 12px; color: var(--color-text-muted); }
.card-payout { font-size: 15px; font-weight: 700; color: #27AE60; }
.card-status-badge {
  font-size: 12px;
  font-weight: 600;
  color: #3498DB;
  background: rgba(52, 152, 219, 0.12);
  padding: 2px 10px;
  border-radius: 6px;
}

/* ─── Admin: Approvals ─────────────────── */
.approvals-header { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-3); }
.approvals-section-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.badge-count {
  font-size: 13px;
  font-weight: 600;
  color: #F39C12;
  background: rgba(243, 156, 18, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
}
.approvals-list { display: flex; flex-direction: column; gap: 12px; }
.approvals-empty p { color: var(--color-text-muted); font-size: 14px; text-align: center; padding: 32px; }
.approval-item { padding: 20px; }
.approval-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.approval-item-header strong { font-size: 15px; color: var(--color-text); }
.approval-date { font-size: 13px; color: var(--color-text-muted); }
.approval-video-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 8px;
}
.approval-video-link:hover { text-decoration: underline; }
.approval-notes { font-size: 13px; color: var(--color-text-muted); margin-bottom: 12px; font-style: italic; }
.approval-actions { display: flex; gap: 8px; }

/* ─── Admin: Card Management ───────────── */
.cards-admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.cards-section-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.card-add-form { margin-bottom: var(--sp-4); padding: 20px; }
.admin-cards-list { display: flex; flex-direction: column; gap: 10px; }
.admin-card-row { padding: 14px 18px; }
.admin-card-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.admin-card-row-top strong { font-size: 15px; color: var(--color-text); flex: 1; }
.card-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.admin-card-row-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--color-text-muted); }

/* ─── Admin: Stage Management ──────────── */
.stages-header { margin-bottom: var(--sp-3); }
.stages-section-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.stages-section-sub { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* ─── Admin: Push Notifications ────────── */
.push-header { margin-bottom: var(--sp-3); }
.push-section-title { font-size: 17px; font-weight: 700; color: var(--color-text); }
.push-section-sub { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }
.push-form { padding: 20px; }
.push-history-title { font-size: 15px; font-weight: 600; color: var(--color-text); }
.push-history { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.push-history-item { padding: 12px 16px; }
.push-history-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.push-type-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.push-history-meta strong { font-size: 14px; color: var(--color-text); }
.push-history-body { font-size: 13px; color: var(--color-text-muted); }
.push-dismissed-badge { font-size: 11px; color: var(--color-text-muted); background: rgba(255,255,255,0.06); padding: 2px 8px; border-radius: 6px; }
.push-active-badge { font-size: 11px; color: #27AE60; background: rgba(39, 174, 96, 0.12); padding: 2px 8px; border-radius: 6px; }
/* ── Auto-billing view (payroll-creation) ─────────────── */
.billing-title { font-family: var(--font-display); font-size: 20px; margin: 0; }
.bill-loading, .bill-empty { padding: var(--sp-8); text-align: center; color: var(--color-text-muted); }
.bill-empty .bill-muted { display: block; margin-top: var(--sp-2); font-size: 13px; }
.bill-summary { padding: var(--sp-6); margin-bottom: var(--sp-4); text-align: center; }
.bill-period { font-size: 12px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.bill-net-big { font-family: var(--font-display); font-size: 44px; font-weight: 800; color: var(--color-accent); margin: var(--sp-2) 0; font-variant-numeric: tabular-nums; }
.bill-breakdown { display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--color-text-muted); }
.bill-neg { color: var(--color-error, #F87171); }
.bill-pos { color: var(--color-success, #34D399); }
.bill-muted { color: var(--color-text-muted); }
.bill-confirmed { margin-top: var(--sp-3); color: var(--color-success, #34D399); font-weight: 600; }
.bill-flag { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); font-size: 14px; border-left: 3px solid var(--color-accent); }
.bill-table td { vertical-align: top; }
.bill-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-net { font-weight: 700; }
.bill-reason { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; max-width: 400px; }
.bill-row-review { background: rgba(255, 107, 53, 0.05); }
.bill-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 107, 53, 0.15); color: var(--color-accent); vertical-align: middle; }
.bill-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); flex-wrap: wrap; }

/* ── Identity claims — "hey, is this yours?" ─────────── */
.claims-title { font-family: var(--font-display); font-size: 16px; margin: 0 0 var(--sp-3); }
.claim-card { padding: var(--sp-4); margin-bottom: var(--sp-3); }
.claim-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); }
.claim-card-head a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.claim-card-head a:hover { color: var(--color-accent); }
.claim-card-board { font-size: 12px; color: var(--color-text-muted); margin: 2px 0 var(--sp-3); }
.claim-card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ─── Billing Page ("paper on a dark desk") ─── */

.billing-view .dash-header { margin-bottom: var(--sp-6); }

.billing-content {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-10);
}

@media (max-width: 767px) {
  .billing-content {
    max-width: none;
    padding: var(--sp-5) var(--sp-4);
  }
}

.billing-months {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.billing-month-pill {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: none;
  cursor: pointer;
  transition: background var(--transition-interactive), color var(--transition-interactive);
}

.billing-month-pill:hover {
  background: var(--color-surface-3);
}

.billing-month-pill.active {
  background: var(--color-accent);
  color: #fff;
}

.invoice-card {
  background: #F7F5F0;
  color: #1A1B23;
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.billing-empty {
  color: var(--color-text-muted);
  font-size: 14px;
  text-align: center;
  padding: var(--sp-8) 0;
}

.invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.invoice-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.invoice-billed-to {
  font-size: 12px;
  color: #6B6E7B;
  margin-top: 2px;
}

.invoice-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.invoice-status-current { background: rgba(52, 211, 153, 0.16); color: #0F6E56; }
.invoice-status-paid { background: rgba(107, 110, 123, 0.14); color: #4A4D57; }

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.invoice-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B6E7B;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.invoice-table td {
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.invoice-table .invoice-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.invoice-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-3);
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}

.invoice-total-amount {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.invoice-csv-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--sp-5);
  padding: 11px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  background: transparent;
  color: #1A1B23;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.invoice-csv-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

/* Preview-as-editor dropdown sits as a compact control on the right of the admin header,
   not a full-width bar (the .form-input default width would otherwise stretch it across the row). */
#preview-as-editor {
  width: auto;
  min-width: 190px;
  flex: 0 0 auto;
  margin-left: auto;
}

/* quiet finalizing/appeal affordances (Alan 2026-07-02: option exists, never solicited) */
.bill-badge-quiet { background: rgba(255,255,255,0.07); color: var(--color-text-muted); }
.bill-finalizing { font-size: 12.5px; color: var(--color-text-muted); margin: 0 0 var(--sp-3); }
.bill-footnote { font-size: 12px; color: var(--color-text-muted); margin-top: var(--sp-5); opacity: .8; }
/* billing buttons: compact inline, never full-width; decline stays quieter than claim */
.claim-card-actions button, .bill-actions button, #billing-note button {
  width: auto; display: inline-flex; align-items: center; justify-content: center;
}
.claim-card-actions .btn-primary, #billing-note .btn-primary {
  background: rgba(255,255,255,0.08); color: var(--color-text); box-shadow: none;
}
.bill-actions .btn-primary { background: rgba(255,255,255,0.08); color: var(--color-text); box-shadow: none; }

/* paper-invoice refinements: auto-billing data on main's design */
.invoice-meta { font-size: 12px; color: #6B6E7B; margin-top: 6px; }
.invoice-incentives { color: #0F6E56; font-weight: 600; }
.invoice-table td a { color: #1A1B23; text-decoration: none; }
.invoice-table td a:hover { text-decoration: underline; }
.invoice-board { color: #9A9DA8; font-size: 12px; }
.invoice-adj { font-size: 11px; color: #8A8D98; margin-top: 2px; }
/* T1: reasoning + evidence state, muted + factual (never red, never loud) */
.invoice-note { font-size: 11.5px; color: #6B6E7B; margin-top: 3px; max-width: 420px; line-height: 1.4; }
.invoice-state { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; margin-top: 4px; }
.invoice-state-verified { color: #9A9DA8; }
.invoice-state-verified::before { content: "✓ "; }
.invoice-state-review { color: #B26B2E; }
.bill-window { font-size: 12.5px; color: var(--color-text-muted); text-align: center; margin: var(--sp-3) 0 0; }
/* orange dot on the billing nav while a draft invoice awaits review */
.has-billing-dot { position: relative; }
.mobile-nav-item.has-billing-dot::after {
  content: ""; position: absolute; top: 6px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-accent); box-shadow: 0 0 0 2px var(--color-bg, #0B0B0D);
}
/* desktop footer: dot sits right after the "View billing" text (Alan call), not at the row's far right */
a.stat-card-footer.has-billing-dot .vb-label::after {
  content: ""; display: inline-block; margin-left: 6px; vertical-align: middle;
  width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent);
}
.invoice-card .invoice-table td { vertical-align: top; }
.billing-view .bill-finalizing { text-align: center; margin: var(--sp-3) 0 0; }
.billing-view .bill-actions { justify-content: center; margin-top: var(--sp-4); }
.billing-view .bill-footnote { text-align: center; }
.billing-view #billing-note { margin-top: var(--sp-6); }

/* ============================================
   SERVICE-AGENT CHAT + TICKET-QUEUE  (Spec 2026-07-23, T4)
   ============================================ */

.agent-launcher {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-6);
  z-index: 70;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow-glass);
  color: var(--color-accent);
  cursor: pointer;
  transition: transform var(--transition-interactive),
    border-color var(--transition-interactive),
    background var(--transition-interactive);
}
.agent-launcher svg { width: 22px; height: 22px; }
.agent-launcher:hover { border-color: var(--color-glass-border-hover); background: var(--color-surface-3); }
.agent-launcher:active { transform: scale(0.94); }

.agent-panel {
  position: fixed;
  right: var(--sp-6);
  bottom: calc(var(--sp-6) + 64px);
  z-index: 71;
  width: min(384px, calc(100vw - var(--sp-8)));
  height: min(560px, calc(100vh - 160px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Fast deckend, nicht durchscheinend: der Verlauf scrollt unter Kopf und
     Eingabezeile durch — bei echtem Glas geistert der Text dahinter durch. */
  background: #101014;
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 64px rgba(0, 0, 0, .45);
}
[data-theme="light"] .agent-panel { background: #FFFFFF; }
.agent-panel.open { animation: agent-in 220ms var(--ease-golden); }
@keyframes agent-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .agent-panel.open { animation: none; } }

.agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--color-glass-border);
  flex: 0 0 auto;
}
.agent-head-id { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.agent-avatar {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-glow);
  color: var(--color-accent);
}
.agent-avatar svg { width: 17px; height: 17px; }
.agent-head-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--color-text); }
.agent-head-sub { font-size: 11.5px; color: var(--color-text-muted); }
.agent-close {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--color-text-muted); cursor: pointer;
}
.agent-close svg { width: 16px; height: 16px; }
.agent-close:hover { background: var(--color-surface-4); color: var(--color-text); }

.agent-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.agent-msg {
  max-width: 84%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.agent-msg-user {
  align-self: flex-end;
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-glow);
  color: var(--color-text);
  border-bottom-right-radius: var(--radius-sm);
}
.agent-msg-bot {
  align-self: flex-start;
  background: var(--color-surface-3);
  border: 1px solid var(--color-glass-border);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-sm);
}
.agent-typing { color: var(--color-text-muted); font-style: italic; }
.agent-ticket {
  align-self: flex-start;
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3);
  font-size: 11.5px;
  background: transparent;
  border: 1px dashed var(--color-glass-border-hover);
  color: var(--color-text-muted);
}

.agent-form {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-top: 1px solid var(--color-glass-border);
}
.agent-input {
  flex: 1 1 auto;
  resize: none;
  max-height: 120px;
  padding: var(--sp-3);
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
}
.agent-input::placeholder { color: var(--color-text-faint); }
.agent-input:focus { outline: none; border-color: var(--color-glass-border-hover); }
.agent-send {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: var(--radius-md);
  background: var(--color-accent); color: #fff; cursor: pointer;
  transition: background var(--transition-interactive), transform var(--transition-interactive);
}
.agent-send svg { width: 17px; height: 17px; }
.agent-send:hover { background: var(--color-accent-hover); }
.agent-send:active { transform: scale(0.94); }

/* Mobile: über der Bottom-Nav parken, Panel fast vollflächig */
@media (max-width: 767px) {
  .agent-launcher {
    right: var(--sp-4);
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .agent-panel {
    right: var(--sp-3);
    left: var(--sp-3);
    width: auto;
    bottom: calc(136px + env(safe-area-inset-bottom));
    height: min(520px, calc(100vh - 220px));
  }
  /* Notiz + Button nebeneinander wird bei 393px zu eng */
  .ticket-resolve { flex-direction: column; align-items: stretch; }
  .ticket-resolve-btn { align-self: flex-end; }
}

/* ───── Admin: Ticket-Queue ───── */

.ticket-filters { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.ticket-filter {
  padding: 6px 14px;
  font-size: 13px;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition-interactive), border-color var(--transition-interactive);
}
.ticket-filter:hover { border-color: var(--color-glass-border-hover); color: var(--color-text); }
.ticket-filter.active { color: var(--color-accent); border-color: var(--color-accent-glow); background: var(--color-accent-subtle); }

.ticket-card { padding: var(--sp-4); margin-bottom: var(--sp-3); }
.ticket-card-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ticket-editor { font-size: 12.5px; color: var(--color-text); font-weight: 500; }
.ticket-when { font-size: 11.5px; margin-left: auto; }
.ticket-summary { margin-top: var(--sp-2); font-size: 13.5px; line-height: 1.5; color: var(--color-text); }
.ticket-link { margin-top: var(--sp-2); font-size: 12px; }
.ticket-link a { color: var(--color-accent); text-decoration: none; }
.ticket-link a:hover { text-decoration: underline; }
.ticket-excerpt { margin-top: var(--sp-3); font-size: 12px; color: var(--color-text-muted); }
.ticket-excerpt summary { cursor: pointer; }
.ticket-excerpt pre {
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11.5px;
  line-height: 1.5;
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.ticket-resolve { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
/* Bewusst leise: Tickets abarbeiten ist Routine, kein Highlight — die lauten
   btn-primary/btn-orange-Gradients gehören den Editor-Aktionen. */
.ticket-resolve-btn {
  flex: 0 0 auto;
  padding: 7px var(--sp-4);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface-3);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-interactive), color var(--transition-interactive);
}
.ticket-resolve-btn:hover { border-color: var(--color-accent-glow); color: var(--color-accent); }
.ticket-note-input {
  flex: 1 1 auto;
  padding: 7px var(--sp-3);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-sm);
}
.ticket-note-input::placeholder { color: var(--color-text-faint); }
.ticket-note-input:focus { outline: none; border-color: var(--color-glass-border-hover); }
.ticket-resolved { margin-top: var(--sp-3); font-size: 12.5px; color: var(--color-text-muted); }
/* Beweis-Link steht vor dem Card-Link: bei Billing ist er der Grund fürs Ticket */
.ticket-evidence { font-weight: 600; }
.ticket-link-sep { color: var(--color-text-faint); margin: 0 var(--sp-2); }
