/* ==========================================================================
   Life OS — module layouts
   Dashboard · Gym · Food · Finance · Tasks · Habits · Learning ·
   Analytics · Reports · Settings
   ========================================================================== */

.eyebrow.on-ink { color: #9ea396; display: inline-flex; align-items: center; gap: 6px; }
.hero-title { font-size: 34px; line-height: 1.08; font-weight: 600; letter-spacing: -0.04em; margin-top: 6px; }
.hero-rest { width: 84px; height: 84px; border-radius: 28px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--accent); flex-shrink: 0; }
.accent-text { color: var(--accent-text); }
.ring-big { font-size: 26px; letter-spacing: -0.04em; font-weight: 600; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 0.6s 1; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
.tr.clickable { cursor: pointer; }
.pre-collapsed .sidebar { width: var(--sidebar-c); }
.pre-collapsed .main { margin-left: var(--sidebar-c); }

/* Date / month navigator */
.date-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.date-nav-label { min-width: 150px; text-align: center; line-height: 1.3; }
.date-nav .btn-icon[disabled] { pointer-events: none; }

/* Toolbar (search + filters) */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-input { min-width: 220px; }
.toolbar .select-wrap { flex-shrink: 0; }

/* ---------------- Dashboard ---------------- */
.today-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.today-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}
.today-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.tt-top { display: flex; align-items: center; gap: 8px; }
.tt-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.tt-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-width: 0; }
.tt-body > div:first-child { min-width: 0; }
.tt-value { font-size: 26px; font-weight: 550; letter-spacing: -0.035em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-value small { font-size: 15px; color: var(--text-3); font-weight: 500; }
.tt-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-check { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }

.dash-grid { grid-auto-flow: dense; }
.widget { display: flex; min-width: 0; animation: page-in 0.5s var(--ease) both; }
.widget > .card { flex: 1; }
.widget:nth-child(2) { animation-delay: 0.03s; } .widget:nth-child(3) { animation-delay: 0.06s; }
.widget:nth-child(4) { animation-delay: 0.09s; } .widget:nth-child(5) { animation-delay: 0.12s; }
.widget:nth-child(n + 6) { animation-delay: 0.15s; }

.w-workout { display: flex; flex-direction: column; }
.w-workout-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; }
.w-workout .hero-title { font-size: 30px; }
.w-ex { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; flex: 1; }
.w-ex-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); min-width: 0; font-size: 13.5px; }
.w-ex-row:last-child { border-bottom: 0; }
.w-ex-row .check { width: 22px; height: 22px; }
.w-ex-row.is-done .ellipsis { color: #7d8276; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
.w-habit { display: flex; align-items: center; gap: 10px; padding: 8px 0; min-width: 0; }
.w-habit .list-sub { display: flex; align-items: center; gap: 3px; }
.w-habit.is-done .list-title { color: var(--text-3); }
.w-fin-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.w-fin-spark { width: 44%; height: 58px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.w-fin-spark .spark { height: 40px; }
.w-fin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.w-fin-stats div { display: flex; flex-direction: column; gap: 2px; }
.w-fin-stats b { font-variant-numeric: tabular-nums; font-size: 15px; }
.w-learn-row { display: block; }
.w-learn-row .pbar { margin-top: 7px; }
.w-prod-body { display: flex; gap: 24px; align-items: flex-end; }
.w-prod-score { flex-shrink: 0; width: 170px; padding-bottom: 20px; }
.w-prod-score .big { font-size: 52px; margin-bottom: 8px; }
.w-prod-body .grow { min-width: 0; }

.cust-list { display: flex; flex-direction: column; gap: 4px; }
.cust-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); transition: opacity 0.2s; }
.cust-row.off .strong { color: var(--text-3); }
.cust-row .btn-icon[disabled] { opacity: 0.3; pointer-events: none; }

/* ---------------- Gym ---------------- */
.gym-hero { padding: 26px; height: 100%; display: flex; flex-direction: column; }
.gym-hero-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.gym-hero .hero-title { font-size: 40px; }
.gym-side { display: grid; grid-auto-rows: 1fr; gap: var(--gap); }
.gym-hero .wk { margin-top: auto; padding-top: 18px; }
.gym-side > .kpi { justify-content: space-between; }
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.wk-day {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 9px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid transparent; color: #cfd3c7; min-width: 0; transition: all 0.18s var(--ease);
}
.wk-day:hover { background: rgba(255, 255, 255, 0.09); }
.wk-day.sel { border-color: rgba(212, 245, 91, 0.6); background: rgba(212, 245, 91, 0.08); }
.wk-name { font-size: 11.5px; font-weight: 600; color: #9ea396; letter-spacing: 0.02em; }
.wk-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: rgba(255, 255, 255, 0.08); color: #9ea396; }
.wk-title { font-size: 11px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #9ea396; }
.wk-day.is-done .wk-dot { background: var(--accent); color: var(--accent-ink); }
.wk-day.is-missed .wk-dot { background: rgba(240, 106, 100, 0.18); color: #f06a64; }
.wk-day.is-partial .wk-dot { background: rgba(227, 165, 42, 0.2); color: #e3a52a; }
.wk-day.is-rest .wk-dot { background: transparent; border: 1px dashed rgba(255, 255, 255, 0.18); }
.wk-day.is-now .wk-name { color: var(--accent); }
.wk-day.is-today .wk-dot { border: 2px solid var(--accent); background: transparent; }
.ex-row { gap: 14px; padding: 14px 4px; }
.ex-row .list-title { font-size: 15px; transition: color 0.2s; }
.ex-row.is-done .list-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-2); }
.session-strip { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.session-strip > div { display: flex; flex-direction: column; flex: 1; min-width: 80px; }
.session-strip b { font-size: 18px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.session-strip b small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.sched-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.sched-day { display: flex; flex-direction: column; }
.sched-day .card-head { margin-bottom: 10px; }
.sched-day .list { flex: 1; }
.sched-day.is-today { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.sched-day.is-rest { background: var(--surface-2); }
.sched-title { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.sched-rest { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); min-height: 110px; border: 1px dashed var(--border-2); border-radius: 18px; }
.sched-ex { padding: 9px 0; gap: 10px; }
.sched-n { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-2); flex-shrink: 0; }
.sched-day .card-foot { margin-top: auto; padding-top: 12px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--gap); }
.pr-card { text-align: left; padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.pr-card.sel { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft); }
.pr-spark { height: 40px; margin: 8px 0 6px; }

/* ---------------- Food ---------------- */
.nutri-top { display: flex; align-items: center; gap: 24px; margin-bottom: 22px; }
.nutri-stats { display: flex; flex-direction: column; gap: 12px; }
.nutri-stats .mid { font-size: 24px; }
.macros { display: flex; flex-direction: column; gap: 14px; }
.macros.compact { gap: 10px; }
.macro .pbar { margin-top: 7px; }
.macro-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 550; }
.macro-label i { width: 8px; height: 8px; border-radius: 3px; }
.micro-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.micro { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.meals { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.meal { padding: 18px; }
.meal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.meal .list-row.hoverable { padding-top: 10px; padding-bottom: 10px; }
.meal-empty { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 64px; border-radius: 16px; border: 1.5px dashed var(--border-2); color: var(--text-3); font-weight: 500; font-size: 13px; transition: all 0.15s; }
.meal-empty:hover { border-color: var(--text-3); color: var(--text); background: var(--surface-2); }
.legend-list { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- Finance ---------------- */
.cat-list { gap: 10px; }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.budget-mini { display: flex; flex-direction: column; gap: 16px; }
.bm-row .pbar { margin-top: 8px; }
.tx-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.tx-summary > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tx-summary b { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tx-group + .tx-group { margin-top: 18px; }
.tx-date { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.tx-row .list-title { font-size: 14px; }
.budget-sum .ring { margin: 4px auto 18px; }
.budget-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.budget-stats > div { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.budget-stats b { font-size: 17px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--gap); align-content: start; }
.budget-card { cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; padding: 20px; }
.budget-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.budget-card .mid { font-size: 24px; }
.budget-add, .learn-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; border: 1.5px dashed var(--border-2); background: transparent; box-shadow: none; color: var(--text-3); font-weight: 550; transition: all 0.15s; }
.budget-add:hover, .learn-add:hover { color: var(--text); border-color: var(--text-3); background: var(--surface); }
.inv-preview { height: 42px; display: flex; align-items: center; font-variant-numeric: tabular-nums; }

/* ---------------- Tasks ---------------- */
.tasks-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.tasks-nav { position: sticky; top: calc(var(--topbar) + 8px); display: flex; flex-direction: column; gap: 4px; }
.tn-group { display: flex; flex-direction: column; gap: 2px; }
.tn-item { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; font-size: 14px; transition: background 0.15s, color 0.15s; min-width: 0; }
.tn-item:hover { background: var(--surface-hover); color: var(--text); }
.tn-item.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tn-item.active > svg { color: var(--accent-text); }
.tn-count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tn-count.alert { color: #fff; background: var(--bad); border-radius: 10px; padding: 0 7px; line-height: 20px; }
.tn-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 6px 6px 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.tasks-main { min-width: 0; }
.tasks-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.tasks-head > div:first-child { flex: 1; min-width: 0; }
.tasks-title { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; }
.tasks-progress { display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.tasks-progress .ring-label strong { font-size: 12px; }
.quick-add {
  display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3); box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quick-add:focus-within { border-color: var(--accent-2); box-shadow: var(--focus); color: var(--text); }
.quick-add input { flex: 1; border: 0; outline: 0; background: none; font-size: 14.5px; height: 100%; min-width: 0; }
.quick-add input::placeholder { color: var(--text-3); }
.quick-add.sm { height: 42px; border-radius: 14px; background: var(--surface-2); box-shadow: none; padding: 0 12px; }
.qa-preview { display: flex; gap: 6px; flex-wrap: wrap; min-height: 10px; padding: 8px 4px 0; }
.qa-preview:empty { min-height: 8px; padding: 0; }
.task-sections { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ts-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); padding: 14px 4px 8px; user-select: none; }
.ts-head[role='button'] { cursor: pointer; }
.ts-head.bad-text { color: var(--bad); }
.task-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 8px; box-shadow: var(--shadow-xs); }
.card .task-list { background: none; border: 0; padding: 0; box-shadow: none; }
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 8px; border-radius: 14px; position: relative; min-width: 0;
  transition: background 0.15s, opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.task + .task::before { content: ''; position: absolute; top: 0; left: 44px; right: 8px; height: 1px; background: var(--border); }
.task:hover { background: var(--surface-hover); }
.task:hover + .task::before, .task:hover::before { opacity: 0; }
.task .check { margin-top: 1px; }
.task-grip { position: absolute; left: -16px; top: 16px; color: var(--text-3); opacity: 0; cursor: grab; transition: opacity 0.15s; }
.task:hover .task-grip { opacity: 1; }
.task[draggable='true'] { cursor: grab; }
.task.dragging { opacity: 0.4; }
.task.drop-before { box-shadow: inset 0 2px 0 var(--accent-2); }
.task.drop-after { box-shadow: inset 0 -2px 0 var(--accent-2); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 500; font-size: 14.5px; line-height: 1.4; word-break: break-word; transition: color 0.3s; }
.task.is-done .task-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--border-2); }
.task.completing .task-title { color: var(--text-3); text-decoration: line-through; }
.task.completing { animation: task-out 0.45s var(--ease) 0.15s forwards; }
@keyframes task-out { to { opacity: 0.35; transform: translateX(6px); } }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.tmeta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tmeta.bad-text { color: var(--bad); font-weight: 550; }
.tmeta.accent-text { color: var(--good); font-weight: 550; }
.ttag { color: var(--text-2); }
.prio { flex-shrink: 0; margin-top: 3px; }
.prio-urgent { color: var(--bad); } .prio-high { color: var(--c2); } .prio-medium { color: var(--c1); }
.task.compact { padding: 9px 4px; gap: 10px; }
.task.compact + .task::before { left: 38px; }
.task.compact .check { width: 22px; height: 22px; }
.task.compact .task-title { font-size: 14px; }
.subs { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sub { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 3px 0; text-align: left; }
.sub.done { color: var(--text-3); text-decoration: line-through; }
.sub .mini-check { width: 16px; height: 16px; border-radius: 5px; }

/* ---------------- Habits ---------------- */
.habit-hero { display: flex; align-items: center; gap: 28px; padding: 26px; }
.habit-hero .hero-title { font-size: 30px; }
.habit-hero-text p { color: #9ea396; }
.habit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.habit {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 18px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-xs); transition: border-color 0.25s, background 0.25s, transform 0.2s var(--ease);
}
.habit:hover { border-color: var(--border-2); }
.habit.is-done { background: color-mix(in srgb, var(--hc) 7%, var(--surface)); border-color: color-mix(in srgb, var(--hc) 30%, var(--surface)); }
.habit.is-off { opacity: 0.6; }
.habit-top { display: flex; align-items: center; gap: 12px; padding-right: 64px; min-width: 0; }
.habit-top .btn-icon { position: absolute; top: 12px; right: 12px; }
.habit-top .list-main { cursor: pointer; }
.habit-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.habit-top .list-sub { display: flex; align-items: center; gap: 3px; }
.habit-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 64px; }
.habit-week { display: flex; gap: 5px; }
.hw { width: 26px; height: 26px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--text-3); transition: all 0.15s; }
.hw:hover:not(.off) { transform: scale(1.1); }
.hw.ok { background: var(--hc); color: #fff; }
.hw.part { background: color-mix(in srgb, var(--hc) 30%, var(--surface)); color: var(--text); }
.hw.off { background: transparent; border: 1px dashed var(--border-2); cursor: default; }
.hw.now { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text-3); }
.habit-streak { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--c2); font-size: 14px; }
.habit-streak.zero { color: var(--text-3); }
.habit-tap { position: absolute; right: 16px; bottom: 16px; border-radius: 50%; transition: transform 0.2s var(--spring); }
.habit-tap:hover { transform: scale(1.06); }
.habit-tap:active { transform: scale(0.94); }
.tap-circle { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--border-2); color: var(--text-3); transition: all 0.25s var(--ease); }
.habit-tap:hover .tap-circle { border-color: var(--hc); color: var(--hc); border-style: solid; }
.habit-tap.on .tap-circle { background: var(--hc); border: 2px solid var(--hc); color: #fff; box-shadow: 0 6px 18px -6px var(--hc); }
.habit-tap.pop { animation: pop 0.45s var(--spring); }
.habit-tap .ring-label strong { font-size: 13px; }
.habit-off { position: absolute; right: 16px; bottom: 22px; }
.mini-heat { display: flex; gap: 2px; }
.mini-heat i { width: 7px; height: 16px; border-radius: 2px; background: var(--surface-3); display: block; }
.mini-heat i.ok { background: var(--hc); }
.mini-heat i.off { background: transparent; }
.habit-kpis { margin-bottom: 0; }

/* ---------------- Learning ---------------- */
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.learn-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; position: relative; overflow: hidden; }
.learn-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--lc); opacity: 0.8; }
.learn-card.is-done { background: var(--surface-2); }
.learn-title { font-size: 19px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; cursor: pointer; }
.learn-title:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-2); }
.learn-notes { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-list { display: flex; flex-direction: column; gap: 4px; }
.res { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.res:hover { color: var(--text); text-decoration: underline; }
.learn-progress { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.learn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.learn-foot .muted { display: inline-flex; align-items: center; gap: 4px; }
.tint-chip { background: var(--surface-2); border: 1px solid var(--border); }

/* ---------------- Analytics & reports ---------------- */
.balance { display: flex; flex-direction: column; gap: 16px; }
.bal-row { display: flex; gap: 12px; align-items: flex-start; }
.bal-row .pbar { margin-top: 6px; }
.bal-row .mt-8 { margin-top: 4px; }
.rep-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; padding: 28px; }
.rep-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rep-highlights li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #d8dcd0; }
.rep-highlights b { color: #fff; }
.rh-ic { width: 28px; height: 28px; border-radius: 9px; background: rgba(212, 245, 91, 0.12); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.rep-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rep-stat { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rep-stat b { font-size: 20px; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-stat .xs { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Settings ---------------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--border); }
.card-head + .set-row { border-top: 0; padding-top: 0; }
.set-text { min-width: 0; }
.set-control { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.data-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.data-counts > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.data-counts b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1280px) {
  .today-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gym-side { grid-auto-rows: auto; grid-template-columns: repeat(3, 1fr); }
  .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meals { grid-template-columns: 1fr 1fr; }
  .rep-hero { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .tasks-layout { grid-template-columns: 1fr; gap: 12px; }
  .tasks-nav { position: static; flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; margin: 0 -24px; padding: 2px 24px; }
  .tasks-nav::-webkit-scrollbar { display: none; }
  .tasks-nav .tn-group { flex-direction: row; gap: 6px; }
  .tn-item { flex-shrink: 0; height: 36px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-pill); font-size: 13px; }
  .tn-item.active { background: var(--accent); border-color: var(--accent-2); color: var(--accent-ink); box-shadow: none; }
  .tn-item.active > svg { color: var(--accent-ink); }
  .tn-head { padding: 0 0 0 10px; border-left: 1px solid var(--border); }
  .tn-head span { display: none; }
  .task-grip { display: none; }
  .settings { grid-template-columns: 1fr; }
  .w-prod-body { flex-direction: column; align-items: stretch; gap: 0; }
  .w-prod-score { width: auto; padding-bottom: 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .w-prod-score .big { margin-bottom: 0; }
  .w-prod-score p { margin: 0 !important; }
}
@media (max-width: 760px) {
  .today-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
  .today-tile { padding: 14px; gap: 10px; border-radius: 20px; }
  .tt-value { font-size: 22px; }
  .hero-title, .gym-hero .hero-title { font-size: 28px; }
  .gym-hero, .habit-hero, .rep-hero { padding: 20px; }
  .gym-hero-top .ring { width: 88px !important; height: 88px !important; }
  .gym-hero-top .ring svg { width: 88px; height: 88px; }
  .gym-side { grid-template-columns: 1fr 1fr; }
  .gym-side > .kpi:first-child { grid-column: span 2; }
  .wk { gap: 4px; margin-top: 16px; }
  .wk-day { padding: 8px 2px; border-radius: 14px; }
  .wk-title { display: none; }
  .wk-dot { width: 26px; height: 26px; }
  .meals { grid-template-columns: 1fr; }
  .nutri-top { gap: 16px; }
  .nutri-top .ring { width: 136px !important; height: 136px !important; }
  .nutri-top .ring svg { width: 136px; height: 136px; }
  .tx-summary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .toolbar .search-input { min-width: 100%; }
  .toolbar .seg { overflow-x: auto; max-width: 100%; }
  .tasks-nav { margin: 0 -16px; padding: 2px 16px; }
  .tasks-head { flex-wrap: wrap; }
  .tasks-title { font-size: 22px; }
  .tasks-progress { padding: 6px 12px 6px 6px; }
  .quick-add { height: 48px; }
  .quick-add input { font-size: 16px; }
  .task-list { padding: 2px 6px; border-radius: 20px; }
  .habit-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .habit-hero .ring { width: 104px !important; height: 104px !important; }
  .habit-hero .ring svg { width: 104px; height: 104px; }
  .habit-grid, .learn-grid, .sched-grid, .rep-grid { grid-template-columns: 1fr; }
  .pr-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .budget-grid { grid-template-columns: 1fr; }
  .data-counts { grid-template-columns: repeat(3, 1fr); }
  .set-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .set-control { width: 100%; }
  .set-control .seg { width: 100%; }
  .set-control .seg-btn { flex: 1; justify-content: center; }
  .hide-sm { display: none !important; }
  .date-nav-label { min-width: 0; flex: 1; }
  .input, .search-input .input { font-size: 16px; } /* avoid iOS zoom */
  .w-ex-row { font-size: 14px; }
}

/* six-up KPI row (analytics) */
.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis.six { grid-template-columns: 1fr 1fr; } }
.kpis.six .kpi-label .kpi-icon { display: none; }

/* ---------------- Dashboard calendar ---------------- */
.w-cal { display: flex; flex-direction: column; }
.cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-3); padding-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-day {
  position: relative; height: 44px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 13.5px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--text); transition: background 0.15s, color 0.15s;
}
.cal-day:hover { background: var(--surface-hover); }
.cal-day.out { color: var(--text-3); opacity: 0.55; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent-2); }
.cal-day.sel { background: var(--ink); color: var(--ink-text); opacity: 1; }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dots i, .cal-legend i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.cd-work { background: var(--c3); }
.cd-task { background: var(--c1); }
.cd-late { background: var(--bad); }
.cd-habit { background: var(--chart-hl); box-shadow: 0 0 0 1px var(--accent-2); }
.cal-day.sel .cd-habit { box-shadow: none; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 11.5px; color: var(--text-3); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 7px; height: 7px; }
.cal-agenda { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.cal-agenda .task-list { background: none; border: 0; padding: 0; box-shadow: none; }
@media (max-width: 760px) {
  .cal-day { height: 46px; }
  .cal-grid { gap: 2px; }
}

/* productivity chart stretches to match its row (e.g. next to the calendar) */
.w-prod { display: flex; flex-direction: column; }
.w-prod-body { flex: 1; align-items: stretch; }
.w-prod-score { align-self: flex-end; }
.w-prod-body > .grow { display: flex; flex-direction: column; }
.chart.fill { flex: 1; position: relative; }
.chart.fill svg { position: absolute; left: 0; top: 0; }
@media (max-width: 1024px) { .w-prod-score { align-self: stretch; } }

/* Day agenda sheet */
.ag-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ag-stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; transition: border-color 0.15s; }
.ag-stat:hover { border-color: var(--border-2); }
.ag-stat .kpi-icon { margin-bottom: 4px; }
.ag-stat b { font-size: 16px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.agenda .task-list { background: none; border: 0; box-shadow: none; padding: 0; }
.agenda .modal-foot .btn.block { flex: 1; }
.chart.fill svg { max-height: 100%; }
@media (max-width: 760px) { .ag-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chart.fill svg { top: auto; bottom: 0; }
