/* ============================================================
   GYM Remind - Main App Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg: #09090B;
  --bg-card: #18181B;
  --bg-card-hover: #1E1E21;
  --bg-input: #27272A;
  --bg-elevated: #222224;

  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-muted: rgba(37, 99, 235, 0.15);
  --accent: #3B82F6;
  --light-blue: #60A5FA;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);

  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;

  --success: #22C55E;
  --success-muted: rgba(34, 197, 94, 0.15);
  --warning: #F59E0B;
  --warning-muted: rgba(245, 158, 11, 0.15);
  --danger: #EF4444;
  --danger-muted: rgba(239, 68, 68, 0.15);

  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 60px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(37,99,235,0.25);

  --transition: 0.18s ease;
  --transition-slow: 0.3s ease;

  --font: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Light mode */
[data-theme="light"] {
  --bg: #F4F4F5;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9F9FA;
  --bg-input: #F4F4F5;
  --bg-elevated: #EBEBED;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.14);
  --text-primary: #09090B;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}

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

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 56px; height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img { width: 56px; height: 56px; object-fit: contain; border-radius: var(--radius-sm); }

.logo-fallback {
  width: 56px; height: 56px;
  background: var(--primary-muted);
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  color: var(--primary);
}
.logo-fallback svg { width: 18px; height: 18px; }

.sidebar-brand {
  font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap; flex: 1; overflow: hidden;
  opacity: 1;
  transition: opacity var(--transition);
}
.sidebar.collapsed .sidebar-brand { opacity: 0; pointer-events: none; }

.sidebar-collapse-btn {
  width: 28px; height: 28px;
  background: none; border: none;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: all var(--transition);
  margin-left: auto;
}
.sidebar-collapse-btn:hover { background: var(--border); color: var(--text-primary); }
.sidebar-collapse-btn svg { width: 15px; height: 15px; transition: transform var(--transition-slow); }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Keep toggle button visible and centered when sidebar is collapsed */
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 0 8px;
}
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar.collapsed .sidebar-collapse-btn { margin-left: 0; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden;
  transition: all var(--transition);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item span { overflow: hidden; opacity: 1; transition: opacity var(--transition); }
.sidebar.collapsed .nav-item span { opacity: 0; pointer-events: none; }
.nav-item:hover { background: var(--border); color: var(--text-primary); }
.nav-item.active { background: var(--primary-muted); color: var(--primary); }
.nav-item.active svg { stroke: var(--primary); }
.nav-item-back { opacity: 0.55; margin-top: 4px; }
.nav-item-back:hover { opacity: 1; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}
.sidebar.collapsed ~ .main-wrapper,
.sidebar.collapsed + .main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 50; gap: 16px;
  backdrop-filter: blur(10px);
}

.header-left { display: flex; align-items: center; gap: 16px; }

.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  align-items: center; justify-content: center;
}
.mobile-menu-btn svg { width: 18px; height: 18px; }

.header-datetime { display: flex; align-items: center; gap: 12px; }

.header-date { font-size: 0.88rem; font-weight: 500; color: var(--text-secondary); }
.header-time {
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

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

.header-btn {
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.header-btn:hover { background: var(--border); color: var(--text-primary); }
.header-btn svg { width: 17px; height: 17px; }

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

.avatar {
  width: 34px; height: 34px;
  background: var(--primary-muted);
  border: 1px solid var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
}
.avatar svg { width: 16px; height: 16px; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed; inset: 0;
  z-index: 99;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { display: none; animation: fadeIn 0.22s ease; }
.section.active { display: block; }

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

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-header-left { flex: 1; }

.section-title-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.section-icon { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.section-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.section-subtitle { font-size: 0.85rem; color: var(--text-muted); padding-left: 32px; }

.section-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.section-actions { display: flex; gap: 10px; margin-bottom: 20px; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.card-title {
  font-size: 0.92rem; font-weight: 600;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.card-title svg { width: 15px; height: 15px; color: var(--text-secondary); flex-shrink: 0; }

.card-body { padding: 20px; }

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.card-half { margin-bottom: 0; }

/* ============================================================
   MOTIVATION BANNER
   ============================================================ */
.motivation-banner {
  background: linear-gradient(135deg, var(--primary-muted) 0%, rgba(139,92,246,0.08) 100%);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 52px;
}
.motivation-banner:empty { display: none; }
.motivation-banner-icon { color: var(--primary); flex-shrink: 0; width: 20px; height: 20px; }
.motivation-banner strong { color: var(--text-primary); }

/* ============================================================
   WEEK OVERVIEW
   ============================================================ */
.week-overview {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.week-day-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.week-day-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all var(--transition);
  min-height: 44px;
}
.week-day-cell.today { border-color: var(--primary); background: var(--primary-muted); }
.week-day-cell.future { opacity: 0.35; }

.week-day-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.week-day-dot { width: 5px; height: 5px; border-radius: 50%; }
.week-day-dot.workout { background: var(--primary); }
.week-day-dot.nutrition { background: var(--success); }
.week-day-dot.habits { background: var(--warning); }

.week-day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.week-day-cell.today .week-day-num { color: var(--light-blue); }

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition);
  cursor: default;
  animation: fadeIn 0.3s ease both;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-color, var(--primary));
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-card:hover::before { opacity: 1; }

.stat-card-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-card-icon svg { width: 16px; height: 16px; }
.stat-card-label {
  font-size: 0.75rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.stat-card-value {
  font-size: 1.55rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-unit { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }
.stat-card-change {
  font-size: 0.72rem; font-weight: 600;
  margin-top: 8px;
  display: flex; align-items: center; gap: 3px;
}
.stat-card-change.positive { color: var(--success); }
.stat-card-change.negative { color: var(--danger); }

.stat-card:nth-child(1) { animation-delay: 0.03s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.09s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }
.stat-card:nth-child(5) { animation-delay: 0.15s; }
.stat-card:nth-child(6) { animation-delay: 0.18s; }
.stat-card:nth-child(7) { animation-delay: 0.21s; }
.stat-card:nth-child(8) { animation-delay: 0.24s; }
.stat-card:nth-child(9) { animation-delay: 0.27s; }
.stat-card:nth-child(10) { animation-delay: 0.30s; }
.stat-card:nth-child(11) { animation-delay: 0.33s; }
.stat-card:nth-child(12) { animation-delay: 0.36s; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group-full { grid-column: 1 / -1; }

label {
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
textarea { resize: vertical; min-height: 80px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.86rem; font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-glow); transform: translateY(-1px); }

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

.btn-sm { padding: 6px 13px; font-size: 0.8rem; }

.btn-danger {
  background: var(--danger-muted); color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-warning {
  background: var(--warning-muted); color: var(--warning);
  border: 1px solid rgba(245,158,11,0.2);
}
.btn-warning:hover { background: var(--warning); color: #fff; }

.btn-success {
  background: var(--success-muted); color: var(--success);
  border: 1px solid rgba(34,197,94,0.2);
}
.btn-success:hover { background: var(--success); color: #fff; }

.btn-icon {
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--border); color: var(--text-primary); }
.btn-icon svg { width: 15px; height: 15px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-blue { background: var(--primary-muted); color: var(--light-blue); }
.badge-green { background: var(--success-muted); color: var(--success); }
.badge-yellow { background: var(--warning-muted); color: var(--warning); }
.badge-red { background: var(--danger-muted); color: var(--danger); }
.badge-gray { background: var(--border); color: var(--text-muted); }

/* ============================================================
   DAILY CHECKLIST
   ============================================================ */
.habit-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
  cursor: pointer;
  border-radius: 0;
  user-select: none;
}
.habit-item:last-child { border-bottom: none; }
.habit-item:hover { background: rgba(255,255,255,0.02); border-radius: var(--radius); padding-left: 8px; padding-right: 8px; }

.habit-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.habit-checkbox.checked { background: var(--primary); border-color: var(--primary); }
.habit-checkbox.checked::after {
  content: '';
  width: 12px; height: 8px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-2px);
}

.habit-label { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); flex: 1; }
.habit-label.done { text-decoration: line-through; color: var(--text-muted); }

.habit-streak {
  font-size: 0.75rem; font-weight: 600;
  color: var(--warning);
  display: flex; align-items: center; gap: 3px;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-item { margin-bottom: 16px; }
.progress-item:last-child { margin-bottom: 0; }

.progress-label {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 6px;
}
.progress-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.progress-value { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.progress-pct { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); min-width: 38px; text-align: right; }

.progress-bar-wrap { background: var(--bg-input); border-radius: 99px; height: 7px; overflow: hidden; }

.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: var(--primary);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 100%;
}
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  font-size: 0.86rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); }

/* ============================================================
   WORKOUT CARDS
   ============================================================ */
.workout-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: all var(--transition);
}
.workout-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.workout-card:last-child { margin-bottom: 0; }

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

.workout-card-title { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

.workout-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }

.workout-meta-item {
  font-size: 0.76rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.workout-meta-item svg { width: 12px; height: 12px; }

.workout-intensity {
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: capitalize;
}
.intensity-light { background: var(--success-muted); color: var(--success); }
.intensity-moderate { background: var(--warning-muted); color: var(--warning); }
.intensity-hard { background: var(--danger-muted); color: var(--danger); }
.intensity-max { background: rgba(139,92,246,0.15); color: #A78BFA; }

.workout-card-exercises {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}

.exercise-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.74rem; font-weight: 500;
  color: var(--text-secondary);
  margin: 3px 4px 3px 0;
}

.workout-actions { display: flex; gap: 6px; }

/* ============================================================
   EXERCISES IN MODAL
   ============================================================ */
.exercises-section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.exercises-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.86rem; font-weight: 600;
  color: var(--text-secondary);
}

.exercises-list { display: flex; flex-direction: column; gap: 10px; }

.exercise-entry {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.exercise-entry-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.exercise-entry-name { flex: 1; }
.exercise-entry-name input {
  background: transparent; border: none;
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-primary); padding: 0;
}
.exercise-entry-name input:focus { box-shadow: none; border: none; }

.sets-table { width: 100%; border-collapse: collapse; }
.sets-table th {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
  padding: 4px 6px; text-align: left; font-weight: 700;
}
.sets-table td { padding: 4px; }
.sets-table input { padding: 6px 8px; font-size: 0.82rem; text-align: center; }

.add-set-btn {
  margin-top: 8px; font-size: 0.76rem;
  color: var(--text-muted);
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 12px; width: 100%;
  transition: all var(--transition);
}
.add-set-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================================
   WORKOUT TEMPLATES
   ============================================================ */
.modal-templates {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-templates-label {
  font-size: 0.76rem; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.template-pills { display: flex; gap: 6px; flex-wrap: wrap; }

.template-pill {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.76rem; font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  transition: all var(--transition);
  white-space: nowrap;
}
.template-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-muted);
}

/* ============================================================
   PERSONAL RECORDS
   ============================================================ */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.pr-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}
.pr-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-muted);
  transform: translateY(-1px);
}

.pr-card-exercise {
  font-size: 0.76rem; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pr-card-weight {
  font-size: 1.75rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.pr-card-unit { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.pr-card-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 5px; }

.pr-history-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.pr-history-item:last-child { border-bottom: none; }

/* 1RM Result */
.orm-result {
  margin-top: 20px;
  background: linear-gradient(135deg, var(--primary-muted) 0%, rgba(139,92,246,0.08) 100%);
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.orm-result-label {
  font-size: 0.76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 8px;
}
.orm-result-value {
  font-size: 2.5rem; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.orm-result-unit { font-size: 1rem; color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.orm-result-table {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.orm-pct-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}
.orm-pct-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-bottom: 3px; }
.orm-pct-value { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }

/* BMR Result */
.bmr-result {
  margin-top: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.bmr-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.bmr-result-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.bmr-result-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.bmr-result-value { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.bmr-result-unit { font-size: 0.8rem; color: var(--text-muted); }
.bmr-goals-tip {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 10px 14px;
  background: var(--primary-muted);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-nav { display: flex; align-items: center; gap: 12px; }
.calendar-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; color: var(--text-secondary); font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.workout { background: var(--primary); }
.legend-dot.nutrition { background: var(--success); }
.legend-dot.habits { background: var(--warning); }
.legend-dot.today { background: var(--light-blue); }

.calendar-grid { width: 100%; }
.calendar-days-header { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.cal-day-name {
  text-align: center;
  font-size: 0.71rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 0;
}

.calendar-cells { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cal-cell {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  transition: all var(--transition);
  min-height: 50px;
}
.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today {
  background: var(--primary-muted);
  color: var(--light-blue);
  font-weight: 700;
  border: 1px solid rgba(96,165,250,0.3);
}
.cal-cell.has-data { color: var(--text-primary); }

.cal-cell-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-cell-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-cell-dot.workout { background: var(--primary); }
.cal-cell-dot.nutrition { background: var(--success); }
.cal-cell-dot.habits { background: var(--warning); }

/* ============================================================
   CHARTS
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.chart-wide { grid-column: 1 / -1; }
.chart-container { position: relative; height: 240px; }

/* ============================================================
   PHOTOS
   ============================================================ */
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.photo-upload-area:hover, .photo-upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-muted);
  color: var(--text-primary);
}
.upload-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--text-muted); display: block; }
.photo-upload-area p { font-size: 0.88rem; font-weight: 600; margin-bottom: 4px; }
.photo-upload-area small { font-size: 0.74rem; color: var(--text-muted); }
.photo-preview-wrap { margin-top: 12px; }
.photo-preview-img { max-height: 200px; border-radius: var(--radius); border: 1px solid var(--border); }

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.photo-gallery-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  position: relative;
}
.photo-gallery-item:hover { border-color: var(--border-hover); transform: scale(1.02); box-shadow: var(--shadow); }
.photo-gallery-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-gallery-info { padding: 10px; }
.photo-gallery-date { font-size: 0.74rem; font-weight: 700; color: var(--text-secondary); }
.photo-gallery-label { font-size: 0.8rem; color: var(--text-primary); font-weight: 500; }
.photo-gallery-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px;
  opacity: 0; transition: opacity var(--transition);
}
.photo-gallery-item:hover .photo-gallery-actions { opacity: 1; }

/* ============================================================
   NOTES
   ============================================================ */
.notes-search-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  transition: border-color var(--transition);
}
.notes-search-wrap:focus-within { border-color: var(--primary); }
.notes-search-wrap input {
  background: transparent; border: none;
  padding: 9px 0; font-size: 0.86rem; flex: 1;
}
.notes-search-wrap input:focus { box-shadow: none; }

.note-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: all var(--transition);
  cursor: pointer;
}
.note-card:last-child { margin-bottom: 0; }
.note-card:hover { border-color: var(--border-hover); }

.note-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px; gap: 12px;
}
.note-card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); flex: 1; }
.note-card-date { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }
.note-card-content {
  font-size: 0.83rem; color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-card.expanded .note-card-content {
  display: block;
  -webkit-line-clamp: unset;
}

/* ============================================================
   STREAKS
   ============================================================ */
.streak-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.streak-item:last-child { border-bottom: none; }

.streak-info { display: flex; align-items: center; gap: 10px; }

.streak-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--warning-muted);
  color: var(--warning);
  flex-shrink: 0;
}
.streak-icon svg { width: 15px; height: 15px; }
.streak-label { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.streak-sub { font-size: 0.74rem; color: var(--text-muted); }
.streak-count { font-size: 1.4rem; font-weight: 800; color: var(--warning); letter-spacing: -0.02em; }
.streak-count-label { font-size: 0.72rem; color: var(--text-muted); text-align: right; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-list { display: flex; flex-direction: column; gap: 4px; }

.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.setting-item:last-child { border-bottom: none; }

.setting-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.setting-label { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.setting-desc { font-size: 0.77rem; color: var(--text-muted); }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: all var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px) translateY(-50%);
  background: #fff;
}

/* Color picker */
.color-picker-wrap { display: flex; gap: 8px; align-items: center; }
.color-option {
  width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.color-option:hover { transform: scale(1.15); }
.color-option.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px currentColor; }

/* Unit toggle */
.unit-toggle-group {
  display: flex; gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.unit-btn {
  background: transparent; border: none;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: calc(var(--radius) - 3px);
  font-size: 0.8rem; font-weight: 600;
  transition: all var(--transition);
}
.unit-btn.active { background: var(--primary); color: #fff; }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal-large { max-width: 700px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.modal-header-left { flex: 1; }
.modal-header-right { display: flex; align-items: center; gap: 8px; }
.modal-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }

.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 80px 20px 20px;
}

.search-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.15s ease;
  overflow: hidden;
}

.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.search-input-wrap input {
  background: transparent; border: none;
  font-size: 0.95rem; flex: 1; padding: 0;
}
.search-input-wrap input:focus { box-shadow: none; }
.search-icon-sm { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; }

.search-esc {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  font-size: 0.7rem; font-family: var(--font);
  color: var(--text-muted);
}

.search-results {
  border-top: 1px solid var(--border);
  max-height: 360px;
  overflow-y: auto;
}

.search-result-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-elevated); }

.search-result-type {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-muted);
  white-space: nowrap; margin-top: 1px;
}

.search-result-main { flex: 1; }
.search-result-title { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); }
.search-result-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.search-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.86rem; }

.search-footer {
  display: flex; gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem; color: var(--text-muted);
}
.search-footer kbd {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font);
  margin-right: 4px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  min-width: 280px; max-width: 380px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.25s ease;
  border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error   { border-left-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(0.95); }
}

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast .toast-icon       { color: var(--primary); }
.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error .toast-icon   { color: var(--danger); }

.toast-message { font-size: 0.86rem; font-weight: 600; color: var(--text-primary); flex: 1; }

.toast-close {
  background: none; border: none;
  color: var(--text-muted);
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color var(--transition);
}
.toast-close:hover { color: var(--text-primary); }
.toast-close svg { width: 14px; height: 14px; }

/* ============================================================
   TIMER WIDGET
   ============================================================ */
.timer-widget {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.05);
  animation: slideUp 0.25s ease;
}

.timer-widget-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px;
}

.timer-icon-col {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.timer-pulse-ring {
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  opacity: 0.6;
  animation: pulseRing 2s ease infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(0.92); opacity: 0.6; }
  50%       { transform: scale(1.08); opacity: 0.2; }
}

.timer-widget-icon { width: 18px; height: 18px; color: var(--success); }

.timer-col { display: flex; flex-direction: column; gap: 2px; }
.timer-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.timer-display { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.timer-actions { display: flex; gap: 6px; margin-left: 8px; }

.timer-btn {
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.timer-btn:hover { background: var(--border); color: var(--text-primary); }
.timer-btn svg { width: 14px; height: 14px; }
.timer-btn-stop:hover { background: var(--danger-muted); color: var(--danger); border-color: rgba(239,68,68,0.3); }

/* ============================================================
   QUICK WATER
   ============================================================ */
.quick-water-row {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}

.water-today-display {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}
.water-amount {
  font-size: 2rem; font-weight: 800;
  color: var(--light-blue);
  letter-spacing: -0.03em;
  line-height: 1;
}
.water-goal-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.water-quick-btns { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }

.water-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem;
  border-color: rgba(96,165,250,0.2);
  color: var(--light-blue);
  transition: all var(--transition);
}
.water-btn:hover { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.4); }
.water-btn svg { width: 13px; height: 13px; color: var(--light-blue); }

.water-bar-label {
  font-size: 0.76rem; color: var(--text-muted);
  font-weight: 500; margin-left: 8px;
  float: right; line-height: 1; margin-top: 4px;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto 16px; color: var(--text-muted); opacity: 0.5; }
.empty-state-title { font-size: 0.95rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc { font-size: 0.82rem; color: var(--text-muted); }
.empty-state-action { margin-top: 16px; }

/* ============================================================
   NUTRITION SUMMARY
   ============================================================ */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.macro-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.macro-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.macro-value { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.macro-unit { font-size: 0.74rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   HISTORY ENTRIES
   ============================================================ */
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }

.history-entry {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-size: 0.84rem;
  transition: all var(--transition);
}
.history-entry:hover { border-color: var(--border-hover); }

.history-entry-left { flex: 1; }
.history-entry-date { font-size: 0.74rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.history-entry-values { color: var(--text-secondary); font-size: 0.82rem; }
.history-entry-note { font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; font-style: italic; }

/* ============================================================
   STATISTICS
   ============================================================ */
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-row-label { font-size: 0.86rem; color: var(--text-secondary); font-weight: 500; }
.stat-row-value { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }

/* Achievement items */
.achievement-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.achievement-item:last-child { border-bottom: none; }
.achievement-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.achievement-icon svg { width: 17px; height: 17px; }
.achievement-title { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); }
.achievement-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Import wrap */
.import-wrap { display: flex; align-items: center; }

/* ============================================================
   WORKOUT FILTER
   ============================================================ */
#workout-filter {
  width: 200px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-canvas {
  position: fixed; inset: 0;
  z-index: 9999;
  pointer-events: none;
  width: 100%; height: 100%;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  :root { --sidebar-width: 64px; }
  .sidebar-brand { opacity: 0; pointer-events: none; }
  .nav-item span { opacity: 0; pointer-events: none; }
  .sidebar-collapse-btn { display: none; }
  .main-content { padding: 20px 16px; }
  .dashboard-row { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .pr-grid { grid-template-columns: 1fr 1fr; }
  .water-quick-btns { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); width: 220px !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.mobile-open .sidebar-brand { opacity: 1; }
  .sidebar.mobile-open .nav-item span { opacity: 1; }
  .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex; }
  .header { padding: 0 16px; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .header-date { display: none; }
  .section-title { font-size: 1.25rem; }
  .orm-result-table { grid-template-columns: 1fr 1fr; }
  .bmr-result-grid { grid-template-columns: 1fr; }
  .week-overview { gap: 3px; }
  .week-day-cell { min-height: 36px; }
  .timer-widget { bottom: 16px; left: 16px; right: 16px; transform: none; }
  .modal-templates { padding: 8px 16px; }
  .template-pills { gap: 4px; }
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-blue      { color: var(--primary); }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}
.onboarding-overlay.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.onboarding-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

.onboarding-progress-bar {
  padding: 28px 32px 0;
}

.onboarding-dots {
  display: flex;
  gap: 6px;
}

.onboarding-dot {
  height: 3px;
  flex: 1;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.4s ease;
}
.onboarding-dot.active  { background: var(--primary); }
.onboarding-dot.done    { background: var(--success); }

.onboarding-content {
  padding: 28px 32px 24px;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
}

.onboarding-step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.onboarding-icon {
  width: 52px;
  height: 52px;
  background: var(--primary-muted);
  color: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.onboarding-icon svg { width: 24px; height: 24px; }

.onboarding-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.25;
}

.onboarding-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 22px;
}

/* Step 1 - welcome */
.onboarding-name-field {
  margin-bottom: 22px;
}
.onboarding-name-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.onboarding-name-field input {
  width: 100%;
}

.ob-check-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.ob-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.ob-check-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Step 2 - goals */
.ob-goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.ob-field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.ob-field-group input {
  width: 100%;
}
.ob-skip-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Step 3 - habits */
.ob-habits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-habit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ob-habit-num {
  width: 28px;
  height: 28px;
  background: var(--primary-muted);
  color: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ob-habit-input {
  flex: 1;
}

/* Step 4 - prefs */
.ob-prefs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}
.ob-pref-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ob-toggle-group {
  display: flex;
  gap: 8px;
}
.ob-toggle-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  font-family: var(--font);
  text-align: center;
}
.ob-toggle-btn.active {
  border-color: var(--primary);
  background: var(--primary-muted);
  color: var(--primary);
  font-weight: 600;
}
.ob-toggle-btn:hover:not(.active) {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.ob-ready-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.ob-ready-icon { color: var(--success); flex-shrink: 0; }
.ob-ready-icon svg { width: 20px; height: 20px; }
.ob-ready-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Footer nav */
.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 28px;
  border-top: 1px solid var(--border);
}

@media (max-width: 560px) {
  .onboarding-box { border-radius: var(--radius-lg); }
  .onboarding-content { padding: 22px 20px 16px; }
  .onboarding-progress-bar { padding: 22px 20px 0; }
  .onboarding-footer { padding: 16px 20px 22px; }
  .ob-goals-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ADDITIONS - v2 IMPROVEMENTS
   ============================================================ */

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Sidebar tooltips (collapsed state) --- */
.sidebar.collapsed .nav-item {
  position: relative;
}
.sidebar.collapsed .nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.sidebar.collapsed .nav-item[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--border);
  z-index: 10000;
}

/* --- Avatar initials --- */
.avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-initials {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  display: none;
}
.avatar.has-initials .avatar-initials { display: block; }
.avatar.has-initials #avatar-icon { display: none; }

/* --- Back to top (app) --- */
.app-back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
}
.app-back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.app-back-to-top:hover {
  background: var(--primary-hover, #1D4ED8);
  transform: translateY(-2px) scale(1.05);
}
.app-back-to-top svg { width: 18px; height: 18px; }

/* --- Rest timer popup --- */
.rest-timer-popup {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 600;
  width: 240px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: slideUp 0.25s ease;
}
.rest-timer-popup.hidden { display: none; }
.rest-timer-inner { padding: 16px; }
.rest-timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rest-timer-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}
.rest-timer-title svg { width: 14px; height: 14px; color: var(--primary); }
.rest-timer-close { width: 22px; height: 22px; }
.rest-timer-display {
  font-size: 2.4rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.rest-timer-presets {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 10px;
}
.rest-preset-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.rest-preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.rest-preset-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rest-timer-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}
.rest-timer-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 1s linear;
}
.rest-timer-actions { display: flex; gap: 8px; }
.rest-timer-actions .btn { flex: 1; justify-content: center; font-size: 0.78rem; }

/* --- Exercise autocomplete --- */
.exercise-add-wrap { display: flex; align-items: center; }
.exercise-input-group { display: flex; gap: 8px; align-items: center; }
.exercise-autocomplete-wrap {
  position: relative;
  width: 220px;
}
.exercise-name-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 7px 12px;
  transition: border-color 0.2s;
}
.exercise-name-input:focus { border-color: var(--primary); outline: none; }
.exercise-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 9999;
  max-height: 200px;
  overflow-y: auto;
}
.exercise-suggestions.hidden { display: none; }
.exercise-suggestion-item {
  padding: 9px 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.exercise-suggestion-item:hover,
.exercise-suggestion-item.focused {
  background: rgba(37,99,235,0.1);
  color: var(--text);
}

/* --- Rest timer trigger on exercise row --- */
.exercise-rest-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.exercise-rest-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,0.08); }
.exercise-rest-btn svg { width: 13px; height: 13px; }

/* --- Chart range filter --- */
.chart-range-filter {
  display: flex;
  gap: 4px;
}
.chart-range-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.chart-range-btn:hover { border-color: var(--primary); color: var(--primary); }
.chart-range-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- PR chart select --- */
.pr-chart-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 5px 10px;
  cursor: pointer;
}
.pr-chart-select:focus { border-color: var(--primary); outline: none; }

/* --- Macro donut chart --- */
.macro-donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.macro-donut-wrap canvas {
  width: 160px !important;
  height: 160px !important;
  flex-shrink: 0;
}
.macro-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.macro-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.macro-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.macro-legend-label { color: var(--text-muted); }
.macro-legend-value { font-weight: 700; color: var(--text); }

/* --- Photo lightbox --- */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox.hidden { display: none; }
.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 64px rgba(0,0,0,0.8);
}
.lightbox-close {
  position: fixed;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.lightbox-label { font-size: 0.88rem; font-weight: 700; color: #fff; }
.lightbox-date  { font-size: 0.78rem; color: rgba(255,255,255,0.6); }
.lightbox-counter { font-size: 0.73rem; color: rgba(255,255,255,0.45); }

/* Gallery item lightbox trigger */
.photo-item { cursor: pointer; }
.photo-item img { transition: transform 0.2s, opacity 0.2s; }
.photo-item:hover img { transform: scale(1.02); opacity: 0.9; }

/* --- Habit names grid --- */
.habit-names-grid { grid-template-columns: repeat(2, 1fr); }
.habit-names-grid .form-group:last-child { grid-column: span 2; }

/* --- Storage indicator --- */
.storage-indicator {}
.storage-bar-wrap { margin-bottom: 10px; }
.storage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.storage-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.storage-pct { font-size: 0.8rem; color: var(--text-muted); }
.storage-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* Progress bar warning/danger states */
.progress-bar-fill.warning { background: var(--warning, #F59E0B) !important; }
.progress-bar-fill.danger  { background: var(--danger,  #EF4444) !important; }

/* --- Goals deadline --- */
.goal-deadline-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}
.goal-progress-item {
  margin-bottom: 18px;
}
.goal-progress-item:last-child { margin-bottom: 0; }

/* --- Workout filter wrap --- */
.workout-filter-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  transition: border-color 0.2s;
}
.workout-filter-wrap:focus-within { border-color: var(--primary); }
.workout-filter-icon { width: 13px; height: 13px; color: var(--text-muted); flex-shrink: 0; }
.workout-filter-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 0;
  width: 180px;
  outline: none;
}
.workout-filter-input::placeholder { color: var(--text-dim); }

/* --- Footer note in Settings --- */
.footer-note {
  text-align: center;
  padding: 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-note p { font-size: 0.78rem; color: var(--text-dim); }

/* --- Note edit mode --- */
.note-card-edit-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.note-card-edit-btn:hover { background: rgba(37,99,235,0.1); color: var(--primary); }
.note-card-edit-btn svg { width: 13px; height: 13px; }

/* --- Section header actions flex fix for charts --- */
#section-charts .section-header {
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Responsive chart range --- */
@media (max-width: 600px) {
  .chart-range-filter { flex-wrap: wrap; }
  .chart-range-btn { padding: 5px 10px; font-size: 0.75rem; }
  .exercise-autocomplete-wrap { width: 160px; }
  .rest-timer-popup { bottom: 70px; right: 12px; width: 220px; }
  .habit-names-grid { grid-template-columns: 1fr; }
  .habit-names-grid .form-group:last-child { grid-column: 1; }
}
