/* ============================================================
   CSS VARIABLES — Dark Gym Theme
   ============================================================ */
:root {
  --bg:           #080810;
  --bg2:          #0f0f1a;
  --card:         #12121e;
  --card2:        #191926;
  --input-bg:     #1c1c2e;

  --orange:       #ff6b35;
  --orange-dim:   rgba(255,107,53,0.14);
  --orange-glow:  rgba(255,107,53,0.28);
  --orange-text:  #ff8a5c;

  --green:        #10b981;
  --green-dim:    rgba(16,185,129,0.12);
  --green-glow:   rgba(16,185,129,0.25);

  --purple:       #7c3aed;
  --purple-dim:   rgba(124,58,237,0.14);

  --blue:         #3b82f6;

  --red:          #ef4444;
  --red-dim:      rgba(239,68,68,0.14);

  --text1:        #f1f5f9;
  --text2:        #94a3b8;
  --text3:        #475569;

  --border:       rgba(255,255,255,0.07);
  --border2:      rgba(255,255,255,0.13);

  --r-sm:   8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-2xl: 28px;

  --header-h:  60px;
  --nav-h:     68px;
  --pad:       16px;

  --shadow:   0 4px 24px rgba(0,0,0,0.45);
  --ease:     cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   RESET
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text1);
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input { font-family: inherit; }
a { color: inherit; }

/* ============================================================
   APP SHELL
   ============================================================ */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--header-h);
  background: rgba(8,8,16,0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--pad);
}

.header-title { display: flex; align-items: center; gap: 8px; }

.logo-icon { font-size: 22px; }

.logo-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--orange) 0%, #ffb347 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-date {
  font-size: 12px;
  color: var(--text3);
  font-weight: 600;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + 12px);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ============================================================
   PAGES
   ============================================================ */
.page { display: none; }
.page.active { display: block; animation: pageIn 0.28s var(--ease); }

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

.page-content {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  padding: 4px 0;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s var(--ease);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
}

/* ============================================================
   WELCOME CARD
   ============================================================ */
.welcome-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #0e0520 0%, #091830 100%);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--r-xl);
  padding: 24px 22px 22px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.welcome-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.orb1 {
  width: 200px; height: 200px;
  top: -60px; right: -40px;
  background: radial-gradient(circle, rgba(255,107,53,0.18) 0%, transparent 70%);
}
.orb2 {
  width: 160px; height: 160px;
  bottom: -60px; left: -30px;
  background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 70%);
}

.welcome-greeting {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  position: relative; z-index: 1;
}

.welcome-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 22px;
  position: relative; z-index: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--orange), #e85520);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  padding: 13px 22px;
  border-radius: var(--r-md);
  box-shadow: 0 4px 20px var(--orange-glow);
  transition: all 0.2s var(--ease);
  position: relative; z-index: 1;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px var(--orange-glow); }
.btn-primary:active { transform: scale(0.97); }

.btn-primary.btn-large { width: 100%; padding: 15px; font-size: 16px; }

.btn-ghost {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  padding: 5px 9px;
  border-radius: var(--r-sm);
  transition: all 0.15s var(--ease);
}
.btn-ghost:hover { color: var(--orange); background: var(--orange-dim); }

.btn-ghost.btn-sm { font-size: 12px; padding: 4px 8px; }

.btn-back {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--card2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text2);
  flex-shrink: 0;
  transition: all 0.15s var(--ease);
}
.btn-back:hover { color: var(--text1); border-color: var(--border2); }

.btn-link {
  color: var(--orange);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s var(--ease);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  text-align: center;
  transition: all 0.2s var(--ease);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.stat-icon { font-size: 22px; margin-bottom: 6px; }

.stat-value {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: var(--orange-text);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: var(--text3);
  margin-top: 5px;
}

/* ============================================================
   CHART
   ============================================================ */
.chart-card { }

.chart-container {
  position: relative;
  height: 175px;
  width: 100%;
}

.chart-empty {
  text-align: center;
  padding: 30px;
  font-size: 13px;
  color: var(--text3);
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: rgba(8,8,16,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 6px 8px;
  z-index: 200;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--text3);
  flex: 1;
  transition: all 0.18s var(--ease);
}
.nav-btn.active { color: var(--orange); }
.nav-btn:hover:not(.active) { color: var(--text2); }

.nav-icon { width: 22px; height: 22px; }

.nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* ============================================================
   WORKOUT STEPS
   ============================================================ */
.workout-step { display: none; }
.workout-step.active { display: block; }

/* Type selection */
.workout-type-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }

.workout-type-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  transition: all 0.2s var(--ease);
  width: 100%;
}
.workout-type-card:hover {
  border-color: var(--orange);
  background: var(--card2);
  transform: translateX(3px);
  box-shadow: -4px 0 0 var(--orange), 0 8px 30px rgba(255,107,53,0.1);
}
.workout-type-card.cardio-card:hover {
  border-color: var(--green);
  box-shadow: -4px 0 0 var(--green), 0 8px 30px rgba(16,185,129,0.1);
}

.wtc-left { display: flex; align-items: center; gap: 14px; }

.wtc-icon {
  width: 50px; height: 50px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.wtc-icon.day1 { background: var(--orange-dim); }
.wtc-icon.day2 { background: var(--purple-dim); }
.wtc-icon.cardio { background: var(--green-dim); }

.wtc-name { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; }
.wtc-desc { font-size: 13px; color: var(--text2); margin-top: 2px; }
.wtc-meta { font-size: 11px; color: var(--text3); margin-top: 3px; font-weight: 600; }

.wtc-arrow { font-size: 18px; color: var(--text3); }

/* Active workout header */
.workout-subheader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
  margin-bottom: 2px;
}

.workout-day-label {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
}

.live-cal-badge {
  background: var(--orange-dim);
  border: 1px solid var(--orange-glow);
  color: var(--orange-text);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Cardio input section */
.cardio-card-section {
  border: 1px dashed rgba(16,185,129,0.4) !important;
  background: rgba(16,185,129,0.05) !important;
}

.cardio-row { display: flex; align-items: center; gap: 14px; }

.cardio-emoji { font-size: 28px; flex-shrink: 0; }

.cardio-input-wrap { flex: 1; }

.cardio-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  margin-bottom: 6px;
}

.cardio-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--text1);
  font-size: 18px;
  font-weight: 800;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.cardio-input:focus { border-color: var(--green); }
.cardio-input::placeholder { font-weight: 400; }

/* ============================================================
   EXERCISE DISPLAY LIST (no checkboxes — full program)
   ============================================================ */

.ex-display-item {
  background: var(--card);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--r-md);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  background: rgba(16,185,129,0.05);
}

.ex-display-check {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.ex-weight-input-wrap {
  width: 54px;
  flex-shrink: 0;
}
.ex-weight-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 4px;
  color: var(--text1);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.ex-weight-input:focus {
  border-color: var(--orange);
}


/* ============================================================
   EXERCISE CHECKLIST
   ============================================================ */
.ex-group { margin-bottom: 12px; }

.ex-group-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.ex-group-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--orange-text);
}

.ex-check-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  cursor: pointer;
  user-select: none;
  transition: all 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ex-check-item:hover { border-color: var(--border2); background: var(--card2); }
.ex-check-item.done {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.07);
}

.ex-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border2);
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.18s var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.ex-check-item.done .ex-checkbox {
  background: var(--green);
  border-color: var(--green);
}
.ex-checkbox::after {
  content: '';
  width: 5px; height: 9px;
  border-right: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(45deg) translate(-1px,-1px);
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}
.ex-check-item.done .ex-checkbox::after { opacity: 1; }

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

.ex-check-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-check-muscle {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.ex-check-cal {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange-text);
  background: var(--orange-dim);
  border-radius: 10px;
  padding: 3px 9px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Cardio-only big input */
.cardio-only-card {
  text-align: center;
  padding: 30px 20px;
}
.cardio-only-emoji { font-size: 64px; margin-bottom: 20px; }
.cardio-only-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  margin-bottom: 12px;
}
.cardio-only-input {
  width: 100%;
  background: var(--input-bg);
  border: 2px solid rgba(16,185,129,0.35);
  border-radius: var(--r-lg);
  padding: 18px;
  color: var(--green);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -2px;
  text-align: center;
  outline: none;
  transition: all 0.2s var(--ease);
}
.cardio-only-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-dim);
}

/* Save bar */
.save-bar {
  padding: 12px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.save-bar-info {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
}

/* ============================================================
   PROGRAM — TABS
   ============================================================ */
.tab-bar {
  display: flex;
  gap: 6px;
  padding: 3px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: calc(var(--r-md) - 2px);
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  transition: all 0.2s var(--ease);
  text-align: center;
}
.tab-btn.active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 3px 14px var(--orange-glow);
}

.program-tab-content { display: none; }
.program-tab-content.active { display: block; }

/* ============================================================
   EXERCISE CARDS (Programs Page)
   ============================================================ */
.exercise-cards { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }

.ex-group-section { display: flex; flex-direction: column; gap: 10px; }

.ex-group-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--orange-text);
  padding: 0 2px;
  margin-top: 4px;
}

.exercise-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s var(--ease);
}
.exercise-card:hover { border-color: var(--border2); transform: translateY(-2px); }

/* GIF Container */
.gif-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a18;
  position: relative;
  overflow: hidden;
}

.gif-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gif-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: absolute; inset: 0;
}
.gif-placeholder .ph-icon { font-size: 48px; }
.gif-placeholder .ph-text { font-size: 12px; color: var(--text3); text-align: center; padding: 0 16px; }

.gif-spinner {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a18;
}
.gif-spinner::after {
  content: '';
  width: 28px; height: 28px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Card body */
.ex-card-body { padding: 14px; }

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

.ex-card-name { font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.ex-card-subname { font-size: 11px; color: var(--text3); margin-top: 2px; font-weight: 500; }

.ex-card-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

.badge-weight {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-muscle {
  background: var(--purple-dim);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-cal {
  background: var(--orange-dim);
  color: var(--orange-text);
  border: 1px solid var(--orange-glow);
  border-radius: 10px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.ex-card-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}

/* ============================================================
   WEIGHT PAGE
   ============================================================ */
.weight-hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.weight-hero-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 12px;
  text-align: center;
}
.weight-hero-card.current { border-color: rgba(255,107,53,0.25); background: rgba(255,107,53,0.05); }
.weight-hero-card.target  { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.05); }

.wh-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 800;
  color: var(--text3);
  margin-bottom: 6px;
}

.wh-value { font-size: 36px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
.weight-hero-card.current .wh-value { color: var(--orange-text); }
.weight-hero-card.target  .wh-value { color: var(--green); }

.wh-unit { font-size: 12px; color: var(--text3); margin-top: 3px; }

.weight-diff-badge {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  flex-shrink: 0;
  min-width: 36px;
  color: var(--text3);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: flex; flex-direction: column; gap: 12px; }

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

.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
}

.form-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  color: var(--text1);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  width: 100%;
  transition: all 0.18s var(--ease);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}
input[type="date"].form-input { color-scheme: dark; }

/* Weight history list */
.weight-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.weight-list-item:last-child { border-bottom: none; }

.wl-date { font-size: 13px; color: var(--text2); }
.wl-val  { font-size: 18px; font-weight: 900; color: var(--orange-text); }
.wl-right { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   HISTORY PAGE
   ============================================================ */
.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  transition: all 0.18s var(--ease);
}
.filter-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

/* History item */
.history-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 15px;
  margin-bottom: 10px;
  transition: border-color 0.15s var(--ease);
}
.history-item:hover { border-color: var(--border2); }

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

.history-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hbadge-type {
  background: var(--orange-dim);
  color: var(--orange-text);
  border: 1px solid var(--orange-glow);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}
.hbadge-type.cardio {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-glow);
}

.hbadge-date { font-size: 12px; color: var(--text3); }

.history-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hcal-badge {
  background: var(--orange-dim);
  color: var(--orange-text);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
}

.history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-tag {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text3);
}
.history-tag.cardio-tag { color: var(--green); border-color: var(--green-dim); }

/* Recent workouts (Dashboard) */
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.recent-item:last-child { border-bottom: none; }

.recent-left { display: flex; align-items: center; gap: 12px; }

.recent-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--orange-dim);
  border: 1px solid var(--orange-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.recent-name { font-size: 13px; font-weight: 700; }
.recent-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
.recent-cal  { font-size: 13px; font-weight: 800; color: var(--orange-text); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 40px 16px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; color: var(--text3); font-weight: 500; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e30;
  border: 1px solid var(--green);
  color: var(--text1);
  padding: 11px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s var(--ease);
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: var(--red); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 2px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   DESKTOP TWEAK
   ============================================================ */
@media (min-width: 481px) {
  .app-header,
  .bottom-nav {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}
