:root {
  --bg: #0b1120;
  --bg-card: #111a2e;
  --bg-card-done: #0e1824;
  --bg-input: #090e1a;
  --border: #1f2d47;
  --border-hover: #38bdf8;
  --accent: #a3e635;
  --accent-hover: #bef264;
  --accent-dim: rgba(163, 230, 53, 0.14);
  --cyan: #38bdf8;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --danger: #f87171;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-tag {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.48rem 0.9rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-primary-sm {
  text-decoration: none;
  background: var(--accent);
  color: #0b1120;
  padding: 0.5rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.18s;
}

.btn-primary-sm:hover {
  background: var(--accent-hover);
}

/* Summary Card */
.summary-card {
  margin-top: 1.75rem;
  background: linear-gradient(135deg, #111a2e 0%, #16223b 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.summary-text {
  max-width: 560px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  margin-bottom: 0.65rem;
}

.summary-text h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.45rem;
}

.summary-text p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

.progress-panel {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.35rem;
  min-width: 220px;
  flex-shrink: 0;
}

.progress-stats {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.2rem;
}

.stat-divider {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.progress-bar-wrap {
  height: 8px;
  background: #1a263f;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.25s ease;
}

.progress-pct {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Controls */
.controls {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.split-tabs {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1.05rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

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

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1120;
  font-weight: 700;
}

.filter-inputs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-inputs select,
.filter-inputs input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.52rem 0.85rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.filter-inputs input {
  width: 190px;
}

.filter-inputs select:focus,
.filter-inputs input:focus {
  border-color: var(--accent);
}

/* Exercise List */
.exercise-list {
  margin-top: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.exercise-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: border-color 0.18s, opacity 0.18s, background-color 0.18s;
}

.exercise-item:hover {
  border-color: #33486e;
}

.exercise-item.is-done {
  background: var(--bg-card-done);
  border-color: rgba(163, 230, 53, 0.35);
  opacity: 0.72;
}

.exercise-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.check-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: var(--bg-input);
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s;
}

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

.exercise-item.is-done .check-btn {
  background: var(--accent);
  border-color: var(--accent);
}

.exercise-info {
  min-width: 0;
}

.exercise-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.exercise-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.exercise-item.is-done .exercise-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.16rem 0.5rem;
  border-radius: 5px;
}

.badge-split {
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
}

.badge-muscle {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.exercise-metrics {
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.metric strong {
  color: var(--text);
  font-weight: 700;
}

.exercise-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-step {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-step:hover {
  border-color: var(--cyan);
  color: var(--text);
}

.btn-delete {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}

.btn-delete:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.empty-state {
  text-align: center;
  padding: 2.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
}

/* Add Exercise Form */
.add-section {
  margin-top: 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
}

.add-header {
  margin-bottom: 1.25rem;
}

.add-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.add-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.95rem;
}

.field-wide {
  grid-column: span 2;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

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

.field input,
.field select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.62rem 0.8rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

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

.form-actions {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-submit {
  background: var(--accent);
  color: #0b1120;
  border: none;
  padding: 0.72rem 1.4rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s;
}

.btn-submit:hover {
  background: var(--accent-hover);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

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

/* Footer */
.footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-muted);
}

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

.footer-note {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  opacity: 0.8;
}

@media (max-width: 640px) {
  .field-wide {
    grid-column: span 1;
  }

  .exercise-item {
    flex-direction: column;
    align-items: stretch;
  }

  .exercise-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
  }

  .filter-inputs,
  .filter-inputs input,
  .filter-inputs select {
    width: 100%;
  }

  .progress-panel {
    width: 100%;
  }
}

