/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #222534;
  --border: #2e3347;
  --accent: #6c63ff;
  --accent2: #2ecc71;
  --text: #e8eaf0;
  --text2: #8b90a4;
  --red: #e63946;
  --green: #2ecc71;
  --yellow: #f4c430;
  --blue: #3498db;
  --purple: #9b59b6;
  --radius: 10px;
  --font: 'Inter', system-ui, sans-serif;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.5; }

/* ── Login ─────────────────────────────────────────────── */
#login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem 2rem; width: 100%; max-width: 360px; }
.login-card h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.login-card p  { color: var(--text2); font-size: .85rem; margin-bottom: 1.5rem; }

/* ── App Shell ─────────────────────────────────────────── */
#app-screen { display: none; min-height: 100vh; }

header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.25rem; display: flex; align-items: center; justify-content: space-between; height: 52px; position: sticky; top: 0; z-index: 100; }
header h1 { font-size: 1rem; font-weight: 600; }
header .header-right { display: flex; align-items: center; gap: .75rem; }

nav { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; }
nav button { flex: 1; min-width: 80px; padding: .7rem .5rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text2); font-size: .8rem; font-weight: 500; cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap; }
nav button.active { color: var(--accent); border-bottom-color: var(--accent); }

main { padding: 1.25rem; max-width: 960px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }

/* ── Cards ──────────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.card .card-label { font-size: .75rem; color: var(--text2); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
.card .card-value { font-size: 1.3rem; font-weight: 700; }
.card .card-value.neutral  { color: var(--text); }
.card .card-value.positive { color: var(--green); }

/* ── Section headers ──────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; margin-top: 1.25rem; }
.section-header h2 { font-size: .95rem; font-weight: 600; }

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem 1rem; border-radius: 7px; border: none; font-size: .82rem; font-weight: 500; cursor: pointer; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-success { background: var(--green); color: #000; }
.btn-ghost   { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-danger  { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-sm      { padding: .3rem .65rem; font-size: .75rem; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .8rem; color: var(--text2); margin-bottom: .35rem; }
input, select, textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--text); padding: .55rem .75rem; font-size: .85rem; font-family: var(--font); transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
textarea { resize: vertical; min-height: 60px; }
.filter-select { width: auto; font-size: .78rem; padding: .3rem .5rem; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 480px; position: relative; }
.modal h2 { font-size: 1rem; margin-bottom: 1.25rem; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; color: var(--text2); font-size: 1.2rem; cursor: pointer; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: 7px; font-size: .82rem; margin-bottom: 1rem; }
.alert-err  { background: rgba(230,57,70,.12);  border: 1px solid rgba(230,57,70,.3);  color: var(--red); }
.alert-ok   { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); color: var(--green); }

/* ── Empty ──────────────────────────────────────────────── */
.empty { text-align: center; padding: 2rem 1rem; color: var(--text2); }
.empty .empty-icon { font-size: 2rem; margin-bottom: .5rem; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 20px; font-size: .7rem; font-weight: 600; }
.badge-alta   { background: rgba(230,57,70,.15);   color: var(--red);    }
.badge-media  { background: rgba(244,196,48,.15);  color: var(--yellow); }
.badge-baixa  { background: rgba(139,144,164,.15); color: var(--text2);  }
.badge-todo   { background: rgba(139,144,164,.15); color: var(--text2);  }
.badge-doing  { background: rgba(52,152,219,.15);  color: var(--blue);   }
.badge-done   { background: rgba(46,204,113,.15);  color: var(--green);  }

.badge-saude     { background: rgba(46,204,113,.15); color: var(--green);  }
.badge-carreira  { background: rgba(52,152,219,.15); color: var(--blue);   }
.badge-financeiro{ background: rgba(244,196,48,.15); color: var(--yellow); }
.badge-pessoal   { background: rgba(108,99,255,.15); color: var(--accent); }
.badge-outro     { background: rgba(139,144,164,.15);color: var(--text2);  }

/* ── Projects sidebar ───────────────────────────────────── */
.projects-sidebar { width: 180px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }
.project-item { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: 6px; cursor: pointer; font-size: .85rem; margin-bottom: .2rem; transition: background .15s; }
.project-item:hover { background: var(--surface2); }
.project-item.active { background: var(--surface2); font-weight: 600; }
.project-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.project-item .del-btn { margin-left: auto; opacity: 0; font-size: .8rem; color: var(--text2); background: none; border: none; cursor: pointer; padding: 0 .15rem; }
.project-item:hover .del-btn { opacity: 1; }

/* ── Quick add bar ──────────────────────────────────────── */
.quick-add-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.quick-add-bar input { flex: 1; }

/* ── Tasks ──────────────────────────────────────────────── */
.task-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .5rem; display: flex; align-items: center; gap: .75rem; transition: opacity .2s; }
.task-item.done { opacity: .5; }
.task-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.task-check.checked { background: var(--green); border-color: var(--green); }
.task-check.checked::after { content: "✓"; color: #000; font-size: .65rem; font-weight: 700; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: .88rem; font-weight: 500; }
.task-item.done .task-title { text-decoration: line-through; }
.task-meta { display: flex; gap: .4rem; align-items: center; margin-top: .2rem; flex-wrap: wrap; }
.task-meta span { font-size: .72rem; color: var(--text2); }
.task-project-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.task-actions { display: flex; gap: .3rem; opacity: 0; transition: opacity .15s; }
.task-item:hover .task-actions { opacity: 1; }
.task-due-overdue { color: var(--red) !important; font-weight: 600; }

/* ── Dashboard Tasks ────────────────────────────────────── */
.dash-task-item { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); transition: opacity .2s; }
.dash-task-item:last-child { border-bottom: none; }
.dash-task-item.dash-task-done { opacity: .45; }
.dash-task-pri { width: 4px; flex-shrink: 0; border-radius: var(--radius) 0 0 var(--radius); }
.dash-task-body { flex: 1; padding: .65rem .9rem; min-width: 0; }
.dash-task-title { font-size: .875rem; font-weight: 500; margin-bottom: .2rem; }
.dash-task-done .dash-task-title { text-decoration: line-through; }
.dash-task-meta { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.dash-task-actions { display: flex; align-items: center; padding-right: .5rem; opacity: 0; transition: opacity .15s; }
.dash-task-item:hover .dash-task-actions { opacity: 1; }
.dash-status-btn { background: none; border: none; cursor: pointer; padding: .1rem .3rem; border-radius: 4px; font-size: .72rem; }
.dash-status-btn:hover { background: var(--border); }
.btn-xs { padding: .2rem .4rem; font-size: .75rem; }
@media (min-width: 600px) {
  .dash-task-body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .dash-task-title { margin-bottom: 0; }
  .dash-task-meta { flex-shrink: 0; }
}

/* ── Dashboard Metas ────────────────────────────────────── */
.dash-kr-card { margin-bottom: .75rem; padding: .75rem 1rem; }
.dash-kr-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .2rem; }
.dash-kr-title { font-size: .875rem; font-weight: 600; }
.dash-kr-value-row { display: flex; align-items: center; gap: .35rem; }
.dash-kr-input { width: 70px; padding: .2rem .4rem; font-size: .82rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); text-align: right; }
.dash-tactics-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.dash-tactic-item { display: flex; align-items: center; gap: .5rem; }
.dash-tactic-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); cursor: pointer; font-size: .7rem; display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; }
.dash-tactic-btn.done { background: var(--green); border-color: var(--green); color: #fff; }
.dash-tactic-btn.partial { background: #f4a261; border-color: #f4a261; color: #fff; }
.dash-tactic-name { font-size: .8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tactic-count { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }

/* ── Color picker ───────────────────────────────────────── */
.color-picker { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.color-swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, transform .1s; }
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: white; }
.emoji-picker { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .5rem; }
.emoji-opt { font-size: 1.4rem; cursor: pointer; padding: .15rem .25rem; border-radius: 6px; border: 2px solid transparent; transition: border-color .15s, transform .1s; line-height: 1; }
.emoji-opt:hover { transform: scale(1.2); }
.emoji-opt.selected { border-color: var(--accent); background: rgba(108,99,255,.15); }

/* ── Habits ─────────────────────────────────────────────── */
.habit-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.habit-chip { display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem; border-radius: 20px; border: 1.5px solid var(--border); cursor: pointer; font-size: .82rem; font-weight: 500; transition: all .15s; background: var(--surface); }
.habit-chip.done { border-color: transparent; color: #000; font-weight: 600; }
.habit-chip:hover { opacity: .85; }

.habit-grid-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.habit-card { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; text-align: center; transition: all .15s; position: relative; }
.habit-card.done { border-color: transparent; }
.habit-card:hover { transform: translateY(-1px); }
.habit-icon { font-size: 2rem; margin-bottom: .35rem; }
.habit-name { font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.habit-streak { font-size: .72rem; color: var(--text2); }
.habit-del { position: absolute; top: .4rem; right: .4rem; background: none; border: none; color: var(--text2); cursor: pointer; opacity: 0; font-size: .85rem; }
.habit-card:hover .habit-del { opacity: 1; }

/* ── Habit calendar ─────────────────────────────────────── */
/* unified calendar */
.ucal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ucal-header { font-size: .65rem; text-align: center; color: var(--text2); padding-bottom: 4px; font-weight: 600; }
.ucal-day { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .25rem .2rem; min-height: 52px; display: flex; flex-direction: column; gap: 2px; }
.ucal-day.empty { background: transparent; border-color: transparent; }
.ucal-day.is-today { border-color: var(--accent); }
.ucal-day.all-done { background: rgba(108,99,255,.08); }
.ucal-num { font-size: .65rem; color: var(--text2); font-weight: 600; line-height: 1; }
.ucal-day.is-today .ucal-num { color: var(--accent); }
.ucal-icons { display: flex; flex-wrap: wrap; gap: 2px; }
.ucal-icon { font-size: .75rem; border-radius: 4px; padding: 1px 2px; line-height: 1; }
.ucal-legend-item { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text2); }
.habits-totals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; margin-top: .5rem; }
.habit-total-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem .5rem; }
.habit-total-info { display: flex; flex-direction: column; gap: .15rem; }
.habit-total-name { font-size: .82rem; font-weight: 600; color: var(--text1); }
.habit-total-nums { font-size: .75rem; color: var(--text2); line-height: 1.4; }
/* legacy per-habit calendar (kept for reference) */
.habit-calendar-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }
.habit-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; font-size: .88rem; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { width: 100%; aspect-ratio: 1; border-radius: 4px; background: var(--surface2); }
.cal-day.done { background: var(--green); }
.cal-day.today-marker { outline: 2px solid var(--accent); }
.cal-label { font-size: .65rem; text-align: center; color: var(--text2); margin-bottom: 2px; }

/* ── OKRs ───────────────────────────────────────────────── */
/* ── Metas — Sub-nav ────────────────────────────────────── */
.metas-subnav { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.subnav-btn { padding: .45rem 1rem; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2); font-size: .82rem; cursor: pointer; transition: all .15s; font-weight: 500; }
.subnav-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,.1); }
.mview { display: none; }
.mview.active { display: block; }

/* ── Ciclo ──────────────────────────────────────────────── */
.cycle-header { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.cycle-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cycle-title { font-weight: 700; font-size: 1rem; }
.cycle-weeks { font-size: .8rem; color: var(--text2); }
.cycle-time-bar { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: .75rem; }
.cycle-time-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.exec-score { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 20px; font-size: .82rem; font-weight: 600; }
.exec-green  { background: rgba(46,204,113,.15); color: var(--green); }
.exec-yellow { background: rgba(244,162,97,.2);  color: #f4a261; }
.exec-red    { background: rgba(230,57,70,.15);  color: var(--red); }

/* ── Key Results no ciclo ───────────────────────────────── */
.kr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem; }
.kr-card-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.kr-card-title { font-weight: 600; font-size: .88rem; flex: 1; }
.kr-card-pct { font-size: .8rem; color: var(--text2); white-space: nowrap; }
.kr-bar-bg { height: 7px; background: var(--surface2); border-radius: 4px; overflow: hidden; margin-bottom: .6rem; }
.kr-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.kr-value-row { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text2); margin-bottom: .6rem; }
.kr-value-row input { width: 80px; font-size: .82rem; padding: .2rem .4rem; text-align: right; }
.kr-obj-tag { font-size: .72rem; color: var(--text2); margin-bottom: .5rem; font-style: italic; }

/* ── Táticas ────────────────────────────────────────────── */
.tactics-list { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.tactic-item { display: flex; align-items: center; gap: .6rem; }
.tactic-check { display: flex; align-items: center; gap: .4rem; }
.tactic-check-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); cursor: pointer; font-size: .8rem; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.tactic-check-btn.done { background: var(--green); border-color: var(--green); color: #fff; }
.tactic-check-btn.partial { background: #f4a261; border-color: #f4a261; color: #fff; }
.tactic-name { flex: 1; font-size: .82rem; color: var(--text1); }
.tactic-badge { font-size: .72rem; color: var(--text2); white-space: nowrap; }

/* ── Objetivos e Visões ─────────────────────────────────── */
.obj-card, .vision-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem; display: flex; align-items: flex-start; gap: .75rem; }
.obj-card-body, .vision-card-body { flex: 1; }
.obj-card-title, .vision-card-title { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.vision-card-desc { font-size: .8rem; color: var(--text2); margin-top: .25rem; line-height: 1.5; }

/* ── Health ─────────────────────────────────────────────── */
.health-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.health-tab-btn { padding: .4rem .9rem; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2); font-size: .82rem; cursor: pointer; transition: all .15s; font-weight: 500; }
.health-tab-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,.08); }
.health-section { display: none; }
.health-section.active { display: block; }

/* ── Workout views ──────────────────────────────────────── */
.workout-subnav { display: flex; gap: .5rem; margin-bottom: .75rem; }
.wsubnav-btn { padding: .35rem .8rem; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text2); font-size: .8rem; cursor: pointer; transition: all .15s; }
.wsubnav-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,.08); }
.wview { display: none; }
.wview.active { display: block; }

/* ── Active Workout Overlay ─────────────────────────────── */
#active-workout-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 200; overflow-y: auto; padding: 1rem; }
.active-workout-header { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: 1rem; position: sticky; top: 0; z-index: 10; }

/* ── Workout Exercise Card ──────────────────────────────── */
.wex-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; margin-bottom: .75rem; }
.wex-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.wex-name { font-weight: 700; font-size: .92rem; }
.wex-muscle { font-size: .72rem; color: var(--text2); }
.sets-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.sets-table th { text-align: center; color: var(--text2); font-weight: 500; padding: .2rem .4rem; font-size: .75rem; }
.sets-table td { text-align: center; padding: .3rem .25rem; }
.sets-table input { width: 60px; text-align: center; font-size: .82rem; padding: .2rem; }
.set-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface2); cursor: pointer; font-size: .75rem; }
.set-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.set-row.done-row td { opacity: .6; }

/* ── Workout History Card ───────────────────────────────── */
.workout-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem; }
.workout-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.workout-card-name { font-weight: 600; font-size: .9rem; }
.workout-card-meta { font-size: .75rem; color: var(--text2); }
.workout-exercises-summary { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.wex-chip { font-size: .72rem; background: var(--surface2); border-radius: 12px; padding: .15rem .55rem; color: var(--text2); }

/* ── Routine Card ───────────────────────────────────────── */
.routine-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .6rem; }
.routine-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.routine-card-name { font-weight: 600; font-size: .9rem; }
.routine-exs { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ── Exercise Picker ────────────────────────────────────── */
.ex-pick-item { display: flex; align-items: center; justify-content: space-between; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; transition: background .12s; }
.ex-pick-item:hover { background: var(--surface2); }
.ex-pick-name { font-size: .85rem; font-weight: 500; }
.ex-pick-sub { font-size: .72rem; color: var(--text2); }
.muscle-filter-btn { padding: .2rem .6rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: .72rem; cursor: pointer; color: var(--text2); transition: all .12s; }
.muscle-filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(108,99,255,.1); }

/* ── Body chart (simples canvas-like com barras) ────────── */
.body-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: .5rem 0; }
.body-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.body-bars { display: flex; gap: 2px; align-items: flex-end; width: 100%; justify-content: center; }
.body-bar { width: 10px; border-radius: 3px 3px 0 0; min-height: 4px; }
.bar-weight   { background: var(--blue); }
.bar-fat      { background: var(--yellow); }
.bar-lean     { background: var(--green); }
.body-chart-label { font-size: .58rem; color: var(--text2); margin-top: 2px; }

/* ── Sleep chart ────────────────────────────────────────── */
.sleep-chart { display: flex; align-items: flex-end; gap: 4px; height: 100px; padding: .5rem 0; }
.sleep-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 2px; }
.sleep-bar { width: 100%; border-radius: 3px 3px 0 0; min-height: 4px; background: var(--purple); }
.sleep-bar-label { font-size: .58rem; color: var(--text2); }

/* ── Progress bar ───────────────────────────────────────── */
.progress-bar { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .4s; }

/* ── Water ──────────────────────────────────────────────── */
.water-cups-grid { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 1rem; }
.water-cup { font-size: 1.4rem; opacity: .25; transition: opacity .2s; }
.water-cup.filled { opacity: 1; }

/* ── Workout / Sleep / Body logs list ─────────────────────── */
.log-item { display: flex; align-items: center; justify-content: space-between; padding: .6rem .75rem; border-bottom: 1px solid var(--border); font-size: .84rem; }
.log-item:last-child { border-bottom: none; }
.log-date { color: var(--text2); font-size: .75rem; width: 90px; flex-shrink: 0; }
.log-main { flex: 1; }
.log-sub { font-size: .75rem; color: var(--text2); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .projects-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .habit-grid-big { grid-template-columns: 1fr 1fr; }
}
