/* ===========================
   FitTrack Pro — style.css
   =========================== */

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

:root {
  --bg:     #0a0a0f;
  --bg2:    #111118;
  --card:   #16161f;
  --card2:  #1c1c27;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --text:   #f0f0f8;
  --text2:  #8888a8;
  --text3:  #55556a;
  --orange: #ff6b35;
  --orange2:#ff8c5a;
  --teal:   #00c9a7;
  --blue:   #4a9eff;
  --purple: #9b59ff;
  --red:    #ff4757;
  --green:  #2ed573;
  --yellow: #ffd32a;
  --r:  12px;
  --r2: 16px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ── LAYOUT ── */
.shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px; min-width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sb-logo {
  padding: 22px 20px 18px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sb-logo-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), #ff3e66);
  display: flex; align-items: center; justify-content: center;
}
.sb-logo-text { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: -0.3px; }
.sb-logo-text span { color: var(--orange); }
.sb-nav { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.sb-section {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3); padding: 10px 10px 6px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text2);
  transition: all .15s; user-select: none;
}
.sb-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; transition: opacity .15s; }
.sb-item:hover { background: var(--card); color: var(--text); }
.sb-item:hover svg { opacity: 1; }
.sb-item.active { background: rgba(255,107,53,.12); color: var(--orange2); }
.sb-item.active svg { opacity: 1; }
.sb-item .badge {
  margin-left: auto; background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
}
.sb-profile { padding: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sb-profile-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.sb-profile-sub { font-size: 11px; color: var(--text2); }

/* ── MAIN ── */
.main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tb-title { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-date {
  font-size: 12px; color: var(--text2);
  background: var(--card); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 8px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.btn-orange { background: var(--orange); color: #fff; box-shadow: 0 2px 12px rgba(255,107,53,.3); }
.btn-orange:hover { background: var(--orange2); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(255,107,53,.4); }
.btn-orange:active { transform: translateY(0); }
.btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

/* ── CONTENT / PAGES ── */
.content { padding: 24px 28px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.page { display: none; }
.page.active { display: contents; }

/* ── CARDS ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.card-title { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: -0.2px; }
.card-sub { font-size: 11px; color: var(--text2); margin-top: 1px; }
.card-body { padding: 16px 20px; }

/* ── DASHBOARD: GREETING ── */
.greeting-banner {
  background: linear-gradient(135deg, #1a1225 0%, #121820 50%, #1a1a12 100%);
  border: 1px solid var(--border); border-radius: var(--r2);
  padding: 22px 26px; display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
}
.greeting-banner::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,.12), transparent 70%);
  pointer-events: none;
}
.greeting-title { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.greeting-title span { color: var(--orange); }
.greeting-sub { font-size: 13px; color: var(--text2); margin-top: 6px; }
.greeting-streak {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,107,53,.1); border: 1px solid rgba(255,107,53,.2);
  border-radius: 12px; padding: 12px 18px; flex-shrink: 0;
}
.gs-num { font-family: 'Outfit', sans-serif; font-size: 36px; font-weight: 800; color: var(--orange); line-height: 1; }
.gs-label { font-size: 11px; color: var(--text2); line-height: 1.4; }
.gs-label strong { display: block; color: var(--text); font-size: 13px; }

/* ── STAT TILES ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r2);
  padding: 18px; position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat-tile:hover { border-color: var(--border2); transform: translateY(-2px); }
.st-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 14px; }
.st-value { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.st-unit { font-size: 13px; font-weight: 500; color: var(--text2); margin-left: 2px; }
.st-label { font-size: 12px; color: var(--text2); margin-top: 5px; }
.st-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; margin-top: 6px; padding: 2px 7px; border-radius: 20px; }
.st-delta.up   { background: rgba(46,213,115,.12); color: var(--green); }
.st-delta.down { background: rgba(255,71,87,.12);  color: var(--red); }
.st-bar-wrap { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--card2); }
.st-bar { height: 100%; border-radius: 3px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }

/* ── MID GRID ── */
.mid-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }

/* Rings */
.rings-svg-area { display: flex; align-items: center; gap: 20px; padding: 16px 20px; }
.rings-svg { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.rings-svg svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke-width: 9; }
.ring-progress { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.4,0,.2,1); }
.rings-legend { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.rl-item { display: flex; align-items: center; gap: 10px; }
.rl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.rl-info { flex: 1; }
.rl-name { font-size: 11px; color: var(--text2); margin-bottom: 3px; }
.rl-bar-wrap { height: 4px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.rl-bar { height: 100%; border-radius: 4px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.rl-pct { font-size: 12px; font-weight: 700; font-family: 'Outfit', sans-serif; }

/* Heart Rate */
.hr-display { padding: 0 20px 8px; display: flex; align-items: flex-end; gap: 8px; }
.hr-num { font-family: 'Outfit', sans-serif; font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--red); }
.hr-bpm { font-size: 13px; color: var(--text2); padding-bottom: 8px; }
.hr-sparkline { padding: 0 20px 12px; height: 56px; }
.hr-sparkline svg { width: 100%; height: 100%; }
.hr-zone { display: flex; gap: 6px; padding: 0 20px 16px; flex-wrap: wrap; }
.hz { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; color: #fff; }

/* Sleep */
.sleep-display { padding: 0 20px 16px; }
.sleep-big { font-family: 'Outfit', sans-serif; font-size: 40px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.sleep-sub { font-size: 12px; color: var(--text2); margin-top: 3px; }
.sleep-bars { display: flex; height: 24px; border-radius: 8px; overflow: hidden; margin-top: 14px; gap: 2px; }
.sb-seg { border-radius: 4px; }
.sleep-legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.sl-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text2); }
.sl-dot { width: 8px; height: 8px; border-radius: 3px; }

/* Weekly Chart */
.week-chart { padding: 10px 20px 16px; height: 160px; display: flex; flex-direction: column; }
.wc-bars { flex: 1; display: flex; align-items: flex-end; gap: 8px; }
.wc-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.wc-day { font-size: 11px; color: var(--text3); font-weight: 500; }

/* ── HISTORY ── */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.hi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r2);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: all .15s;
}
.hi:hover { border-color: var(--border2); background: var(--card2); }
.hi-date {
  width: 46px; flex-shrink: 0; text-align: center; padding: 8px 6px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
}
.hi-date-day { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; line-height: 1; }
.hi-date-mon { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text2); letter-spacing: .05em; }
.hi-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hi-icon svg { width: 18px; height: 18px; }
.hi-info { flex: 1; min-width: 0; }
.hi-name { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-meta { font-size: 12px; color: var(--text2); }
.hi-stats { display: flex; gap: 18px; text-align: right; }
.his { font-size: 12px; color: var(--text2); }
.his strong { display: block; font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.2; }
.hi-tag { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }

/* ── LOG FORM ── */
.log-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.form-section { margin-bottom: 22px; }
.form-section-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.single { grid-template-columns: 1fr; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fl { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: .03em; }
.fi, .fs {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 13px; font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%; -webkit-appearance: none;
}
.fi:focus, .fs:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,107,53,.12); }
.fi::placeholder { color: var(--text3); }
.cat-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-pill {
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
  color: var(--text2); background: var(--bg2); user-select: none;
}
.cat-pill:hover { border-color: var(--border2); color: var(--text); }
.cat-pill.selected { background: rgba(255,107,53,.15); border-color: rgba(255,107,53,.4); color: var(--orange); }

/* Exercise Table */
.ex-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.ex-table th {
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3); padding: 8px 14px;
  background: var(--bg2); border-bottom: 1px solid var(--border);
}
.ex-table td { padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ex-table tr:last-child td { border-bottom: none; }
.ex-table tr:hover td { background: var(--bg2); }
.ex-muscle-tag { font-size: 10px; color: var(--text2); background: var(--card2); padding: 2px 7px; border-radius: 5px; font-weight: 600; }
.ex-diff-bar { display: flex; gap: 3px; }
.edb { width: 18px; height: 4px; border-radius: 2px; background: var(--card2); }
.edb.on { background: var(--orange); }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 18px; line-height: 1; padding: 4px; border-radius: 6px; transition: all .15s; }
.icon-btn:hover { color: var(--red); background: rgba(255,71,87,.1); }
.add-ex-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 8px; padding: 12px 14px; background: var(--bg2);
  border-top: 1px solid var(--border); align-items: center;
}
.add-ex-row .fi { padding: 8px 10px; font-size: 12px; }

/* Log Sidebar */
.log-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.summary-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); overflow: hidden; }
.sc-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 700; }
.sc-stat { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.sc-stat:last-child { border-bottom: none; }
.sc-stat-label { font-size: 12px; color: var(--text2); }
.sc-stat-val { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 700; }
.sc-stat-unit { font-size: 11px; color: var(--text2); }

/* ── HISTORY LAYOUT ── */
.history-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.history-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-pill {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
  color: var(--text2); background: var(--card); user-select: none;
}
.filter-pill:hover { border-color: var(--border2); color: var(--text); }
.filter-pill.active { background: rgba(255,107,53,.15); border-color: rgba(255,107,53,.4); color: var(--orange); }

/* ── CALENDAR ── */
.cal-nav-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.cal-month-title { font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; }
.cal-btn {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: 16px; transition: all .15s;
}
.cal-btn:hover { border-color: var(--orange); color: var(--orange); }
.cal-grid-wrap { padding: 0 14px 14px; }
.cal-dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: .05em; padding: 4px 0; }
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day {
  aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; position: relative; color: var(--text2);
}
.cal-day:hover { background: var(--card2); color: var(--text); }
.cal-day.other { color: var(--text3); }
.cal-day.today { background: rgba(255,107,53,.15); color: var(--orange); font-weight: 700; border: 1px solid rgba(255,107,53,.3); }
.cal-day.worked::after {
  content: ''; position: absolute; bottom: 4px; left: 50%;
  transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--teal);
}

/* ── NUTRITION ── */
.nutrition-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; }
.cal-donut { padding: 16px 20px; display: flex; align-items: center; gap: 20px; }
.donut-svg { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.donut-svg svg { transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-val { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.donut-unit { font-size: 11px; color: var(--text2); }
.macro-list { flex: 1; display: flex; flex-direction: column; gap: 11px; }
.macro-header { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; }
.macro-name { color: var(--text2); font-weight: 500; }
.macro-val { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 13px; }
.macro-bar-bg { height: 5px; background: var(--card2); border-radius: 4px; overflow: hidden; }
.macro-bar { height: 100%; border-radius: 4px; transition: width 1s ease; }

/* Water */
.water-grid { padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.water-cup {
  width: 32px; height: 38px; border-radius: 5px 5px 8px 8px;
  border: 2px solid var(--border2); cursor: pointer; position: relative; overflow: hidden; transition: border-color .15s;
}
.water-cup.filled { border-color: var(--blue); }
.water-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, rgba(74,158,255,.4), rgba(74,158,255,.7));
  border-radius: 0 0 6px 6px; transition: height .4s cubic-bezier(.4,0,.2,1);
}

/* Meals */
.meal-list { display: flex; flex-direction: column; }
.meal-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); transition: background .15s; }
.meal-row:last-child { border-bottom: none; }
.meal-row:hover { background: var(--card2); }
.meal-icon { width: 38px; height: 38px; background: var(--bg2); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.meal-icon svg { width: 20px; height: 20px; }
.meal-info { flex: 1; }
.meal-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.meal-time { font-size: 11px; color: var(--text2); }
.meal-macros { display: flex; gap: 10px; text-align: right; }
.mm { font-size: 11px; color: var(--text2); }
.mm strong { display: block; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); }

/* ── GOALS ── */
.goals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goal-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r2); padding: 20px; transition: all .2s; }
.goal-card:hover { border-color: var(--border2); }
.gc-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.gc-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.gc-icon svg { width: 18px; height: 18px; }
.gc-pct { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.gc-title { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.gc-sub { font-size: 12px; color: var(--text2); }
.gc-progress { height: 8px; background: var(--card2); border-radius: 8px; overflow: hidden; margin: 14px 0 10px; }
.gc-bar { height: 100%; border-radius: 8px; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.gc-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); }
.gc-footer strong { color: var(--text); font-weight: 600; }

/* ── MODAL ── */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 200; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card); border: 1px solid var(--border2); border-radius: 20px;
  padding: 28px; width: 440px; max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  transform: scale(.96) translateY(10px);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.modal-bg.open .modal { transform: scale(1) translateY(0); }
.modal-title { font-family: 'Outfit', sans-serif; font-size: 18px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ── TOAST ── */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2); border: 1px solid var(--border2); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; font-weight: 500; min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  animation: slideToast .3s cubic-bezier(.34,1.56,.64,1) forwards, fadeOut .3s ease 2.7s forwards;
}
.toast-icon { font-size: 18px; }

/* ── UTILITIES ── */
.section-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.link-btn { font-size: 12px; font-weight: 600; color: var(--orange); cursor: pointer; background: none; border: none; padding: 0; font-family: 'Inter', sans-serif; }
.link-btn:hover { opacity: .7; }
.empty-state { text-align: center; padding: 30px 20px; color: var(--text3); font-size: 13px; }

/* ── ANIMATIONS ── */
@keyframes slideToast { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut    { to   { transform: translateX(60px); opacity: 0; } }
@keyframes fadeUp     { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse      { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.3); } }

.fade-up { animation: fadeUp .4s ease both; }
.fade-up:nth-child(1) { animation-delay: .05s; }
.fade-up:nth-child(2) { animation-delay: .10s; }
.fade-up:nth-child(3) { animation-delay: .15s; }
.fade-up:nth-child(4) { animation-delay: .20s; }
.fade-up:nth-child(5) { animation-delay: .25s; }
.fade-up:nth-child(6) { animation-delay: .30s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .mid-grid       { grid-template-columns: 1fr 1fr; }
  .nutrition-grid { grid-template-columns: 1fr; }
  .log-layout     { grid-template-columns: 1fr; }
  .history-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sidebar            { width: 60px; min-width: 60px; }
  .sb-logo-text,
  .sb-item span:not(.badge),
  .sb-profile-name,
  .sb-profile-sub     { display: none; }
  .topbar             { padding: 12px 16px; }
  .content            { padding: 16px; gap: 14px; }
  .stats-grid         { grid-template-columns: 1fr 1fr; }
  .mid-grid           { grid-template-columns: 1fr; }
  .greeting-banner    { flex-direction: column; gap: 16px; }
}
