/* ==========================================================================
   PUSH100 — Modern Dark-Mode Design System
   ========================================================================== */

:root {
  --bg: #07090f;
  --bg-elevated: rgba(15, 20, 34, 0.72);
  --bg-card-solid: #0f1422;
  --bg-surface: rgba(255, 255, 255, 0.035);
  --bg-surface-hover: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --indigo: #6366f1;
  --indigo-glow: rgba(99, 102, 241, 0.35);
  --cyan: #22d3ee;
  --cyan-glow: rgba(34, 211, 238, 0.28);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.32);
  --amber: #f59e0b;
  --rose: #f43f5e;
  --violet: #8b5cf6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.22);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Ambient Animated Background
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.32;
  will-change: transform;
}

.orb-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -160px;
  left: -120px;
  animation: floatOrb1 19s ease-in-out infinite alternate;
}

.orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  top: 22%;
  right: -140px;
  animation: floatOrb2 23s ease-in-out infinite alternate;
}

.orb-3 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  bottom: -160px;
  left: 30%;
  opacity: 0.2;
  animation: floatOrb3 26s ease-in-out infinite alternate;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, black 20%, transparent 100%);
}

@keyframes floatOrb1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(70px, 50px, 0) scale(1.12); }
}

@keyframes floatOrb2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-65px, 60px, 0) scale(1.08); }
}

@keyframes floatOrb3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(55px, -50px, 0) scale(1.15); }
}

/* ==========================================================================
   Confetti Canvas & Toasts
   ========================================================================== */

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.34s var(--ease-spring) forwards;
}

.toast.success { border-color: rgba(16, 185, 129, 0.45); }
.toast.error { border-color: rgba(244, 63, 94, 0.5); }
.toast.celebrate {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(15, 23, 42, 0.95));
  border-color: rgba(16, 185, 129, 0.7);
}
.toast.leaving {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* ==========================================================================
   Shared Glass Card, Buttons, Forms
   ========================================================================== */

.glass-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.13);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--cyan);
  margin-bottom: 4px;
}

.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.muted-text {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-surface);
  transition: transform 0.15s var(--ease-spring), background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 55%, #06b6d4 100%);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(244, 63, 94, 0.6);
  color: #ffffff;
}

.btn-full { width: 100%; }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: 13px; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field .hint {
  font-weight: 400;
  color: var(--text-muted);
}

.field input,
.field select,
.date-input {
  width: 100%;
  background: rgba(7, 10, 18, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  color-scheme: dark;
}

.field input:focus,
.field select:focus,
.date-input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
  background: rgba(11, 16, 28, 0.92);
}

.field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.field-meta {
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}

.form-alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fecdd3;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ==========================================================================
   Auth Screen
   ========================================================================== */

.auth-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.auth-shell {
  width: 100%;
  max-width: 440px;
  animation: fadeUp 0.55s var(--ease-out) forwards;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  justify-content: center;
  text-align: left;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-mark-lg {
  width: 48px;
  height: 48px;
}

.brand-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.brand-title span,
.brand-name span {
  background: linear-gradient(135deg, #818cf8, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-card {
  padding: 24px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.seg-btn.active {
  background: rgba(99, 102, 241, 0.22);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pw-strength {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 2px;
}

.pw-strength-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.28s var(--ease-out), background 0.28s ease;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s var(--ease-spring), border-color 0.2s ease, box-shadow 0.2s ease;
}

.color-swatch:hover {
  transform: scale(1.12);
}

.color-swatch.selected {
  border-color: #ffffff;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.auth-footer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.sec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* ==========================================================================
   Top Navigation & App Layout
   ========================================================================== */

.app-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-bottom: 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.nav-pill svg {
  width: 16px;
  height: 16px;
}

.nav-pill:hover {
  color: var(--text);
}

.nav-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(6, 182, 212, 0.24));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.user-chip-name {
  font-size: 13px;
  font-weight: 600;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28);
}

.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 38px; height: 38px; font-size: 14px; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

.view-section {
  display: none;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: fadeUp 0.38s var(--ease-out);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Hero Row: Progress Ring & Fast Logger
   ========================================================================== */

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  white-space: nowrap;
}

.status-badge.done {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.28);
}

.ring-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  margin: 0 auto;
}

.ring-wrap.goal-glow {
  filter: drop-shadow(0 0 22px rgba(16, 185, 129, 0.35));
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 14;
}

.ring-fill {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 578.05;
  stroke-dashoffset: 578.05;
  transition: stroke-dashoffset 0.85s var(--ease-out);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.ring-number-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.ring-number {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ring-goal {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.ring-subtext {
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ring-subtext.done {
  color: #34d399;
}

.today-mini-stats {
  flex: 1;
  min-width: 190px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-stat {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.mini-value {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.accent-emerald { color: #34d399; }

/* Logger Card */
.logger-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quick-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.preset-chip {
  padding: 9px 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(129, 140, 248, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.preset-chip.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32), rgba(34, 211, 238, 0.24));
  border-color: rgba(34, 211, 238, 0.65);
  color: #ffffff;
}

.stepper-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 15px;
  background: rgba(7, 10, 18, 0.72);
  border: 1px solid var(--border);
}

.stepper-btn {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.14s var(--ease-spring);
}

.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.11);
}

.stepper-btn:active {
  transform: scale(0.93);
}

.stepper-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stepper-input-wrap input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  outline: none;
  appearance: textfield;
}

.stepper-input-wrap input::-webkit-outer-spin-button,
.stepper-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-unit {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: -2px;
}

.advanced-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  animation: fadeUp 0.25s var(--ease-out);
}

.today-sets-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.subhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.subhead-row h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.sets-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.sets-list.compact {
  max-height: 280px;
}

.set-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  animation: fadeUp 0.25s var(--ease-out);
}

.set-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.set-reps-badge {
  min-width: 48px;
  padding: 5px 10px;
  border-radius: 9px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.28), rgba(34, 211, 238, 0.18));
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #e0e7ff;
}

.set-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.set-meta-top {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

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

.style-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.set-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.running-pill {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.running-pill.reached {
  color: #34d399;
}

.icon-delete {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-delete:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.empty-state {
  padding: 18px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================================================
   KPI Row & Section Bars
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  padding: 18px 20px;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.delta-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta-pill.positive {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.delta-pill.negative {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.delta-pill.neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-variant-numeric: tabular-nums;
}

.kpi-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.kpi-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-sub {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.section-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-subtitle {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.range-switcher {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  gap: 4px;
}

.range-btn,
.lb-period-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.range-btn:hover,
.lb-period-btn:hover {
  color: var(--text);
}

.range-btn.active,
.lb-period-btn.active {
  background: rgba(99, 102, 241, 0.28);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.45);
}

/* ==========================================================================
   Charts & Activity Heatmap
   ========================================================================== */

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-cyan { background: #22d3ee; box-shadow: 0 0 8px rgba(34, 211, 238, 0.6); }
.dot-indigo { background: #818cf8; box-shadow: 0 0 8px rgba(129, 140, 248, 0.6); }
.dot-emerald { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot-violet { background: #6366f1; }

.chart-stage {
  width: 100%;
  min-height: 255px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 255px;
  display: block;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.chart-goal-line {
  stroke: rgba(16, 185, 129, 0.6);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.chart-axis-text {
  fill: #64748b;
  font-size: 11px;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}

.chart-line-anim {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 1.05s var(--ease-out) forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.chart-bar {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: growBar 0.65s var(--ease-out) both;
  cursor: pointer;
  transition: filter 0.18s ease, opacity 0.18s ease;
}

.chart-bar:hover {
  filter: brightness(1.22);
}

@keyframes growBar {
  from { transform: scaleY(0); opacity: 0.4; }
  to { transform: scaleY(1); opacity: 1; }
}

.chart-point {
  cursor: pointer;
  transition: r 0.18s ease, filter 0.18s ease;
}

.chart-point:hover {
  filter: drop-shadow(0 0 6px currentColor);
}

.chart-tooltip {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(10, 14, 24, 0.96);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  font-size: 12.5px;
  color: var(--text);
  min-width: 155px;
}

.tt-title {
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 5px;
  font-size: 12.5px;
}

.tt-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}

.tt-row strong {
  color: var(--text);
}

/* Bottom Grid: Heatmap + Recent */
.bottom-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.heat-tile {
  aspect-ratio: 1.35 / 1;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: transform 0.18s var(--ease-spring), border-color 0.18s ease;
}

.heat-tile:hover {
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.heat-tile-day {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.58);
}

.heat-tile-val {
  font-size: 13px;
  font-weight: 700;
}

.heat-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.lvl-0 { background: rgba(255, 255, 255, 0.03); color: var(--text-muted); }
.lvl-1 { background: rgba(99, 102, 241, 0.2); color: #c7d2fe; }
.lvl-2 { background: rgba(99, 102, 241, 0.38); color: #e0e7ff; }
.lvl-3 { background: rgba(6, 182, 212, 0.42); color: #cffafe; }
.lvl-4 {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.48), rgba(52, 211, 153, 0.32));
  border-color: rgba(16, 185, 129, 0.55) !important;
  color: #ecfdf5;
}

/* ==========================================================================
   Leaderboard & Daily Participant Comparison
   ========================================================================== */

.lb-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-nav .date-input {
  width: auto;
  padding: 6px 10px;
  font-size: 13px;
}

.group-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.strip-card {
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.strip-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.32);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

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

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lb-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: transform 0.2s var(--ease-out), border-color 0.2s ease, background 0.2s ease;
  animation: fadeUp 0.35s var(--ease-out) both;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(3px);
}

.lb-row.is-me {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(6, 182, 212, 0.07));
  border-color: rgba(129, 140, 248, 0.45);
}

.lb-row.reached {
  border-color: rgba(16, 185, 129, 0.4);
}

.rank-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.rank-1 { background: linear-gradient(135deg, rgba(251, 191, 36, 0.32), rgba(245, 158, 11, 0.14)); color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.45); }
.rank-2 { background: linear-gradient(135deg, rgba(226, 232, 240, 0.25), rgba(148, 163, 184, 0.12)); color: #f1f5f9; border: 1px solid rgba(203, 213, 225, 0.35); }
.rank-3 { background: linear-gradient(135deg, rgba(251, 146, 60, 0.28), rgba(234, 88, 12, 0.12)); color: #fed7aa; border: 1px solid rgba(251, 146, 60, 0.4); }

.lb-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-user-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lb-name {
  font-weight: 700;
  font-size: 15px;
}

.me-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.28);
  color: #c7d2fe;
}

.goal-done-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.lb-sub-metrics {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.lb-bar-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.lb-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #6366f1, #22d3ee);
  transition: width 0.75s var(--ease-out);
}

.lb-bar-fill.done {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.lb-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lb-score-big {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lb-score-target {
  font-size: 12px;
  color: var(--text-muted);
}

/* Comparison Table */
.table-scroll {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-variant-numeric: tabular-nums;
}

.comparison-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 8px;
  white-space: nowrap;
}

.comparison-table th:first-child {
  text-align: left;
  padding-left: 12px;
}

.comparison-table th.is-today {
  color: var(--cyan);
}

.comparison-table td {
  padding: 10px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.comparison-table td:first-child {
  text-align: left;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  border-radius: 12px 0 0 12px;
}

.comparison-table td:last-child {
  border-right: 1px solid var(--border);
  border-radius: 0 12px 12px 0;
  font-weight: 800;
}

.comparison-table tr.is-me td {
  background: rgba(99, 102, 241, 0.11);
  border-color: rgba(129, 140, 248, 0.32);
}

.comp-user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.day-pill {
  display: inline-block;
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.day-pill.zero {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.day-pill.partial {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.18);
}

.day-pill.done {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.security-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.security-actions h4 {
  margin: 0 0 2px;
  font-size: 15px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-grid,
  .charts-grid,
  .bottom-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .group-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 10px 14px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .nav-pill {
    flex: 1;
    justify-content: center;
    padding: 8px 8px;
    font-size: 12.5px;
  }

  .user-chip-name {
    display: none;
  }

  .container {
    padding: 16px 14px 0;
  }

  .glass-card {
    padding: 16px;
    border-radius: 18px;
  }

  .quick-presets {
    grid-template-columns: repeat(3, 1fr);
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .kpi-grid,
  .group-strip {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .kpi-value {
    font-size: 24px;
  }

  .lb-row {
    grid-template-columns: 36px 1fr;
  }

  .lb-score {
    grid-column: 2;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
