/* ==========================================================================
   GELEX HUB — Today (Dashboard) — Concept 4: Today + Week Peek
   Override today cũ. Sáng trọng, bất đối xứng, 1 gradient accent (đóng góp).
   ========================================================================== */

/* ---------- Shell ---------- */
.today-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--content-pad-y) var(--content-pad-x) 140px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "hero      contrib"
    "main      side"
    "banner    banner";
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .today-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "hero" "contrib" "main" "side" "banner";
  }
}

/* ---------- HERO (greeting + week peek) ---------- */
.today-hero {
  grid-area: hero;
  position: relative;
  padding: 22px 24px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* bỏ gradient đỏ to + shadow nặng cũ */
.th-greet {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.th-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-dim);
}
.th-meta {
  margin-top: 10px;
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.th-meta b { color: var(--text); font-weight: 600; }
.th-meta .is-danger { color: var(--danger); font-weight: 600; }
.th-meta .sep { width: 1px; height: 14px; background: var(--border); }

/* Streak chip (trong hero, không ở menubar nữa) */
.th-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d97706;
  font-weight: 600;
}
.th-streak strong { font-size: 15px; }
.th-flame { font-size: 17px; line-height: 1; }

/* ---------- WEEK PEEK (khe 7 ngày) ---------- */
.week-peek {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.wp-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.wp-title-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.wp-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.wp-nav-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wp-nav-btn:hover { background: var(--surface-2); color: var(--text); }
.wp-nav-range { font-size: 11.5px; color: var(--text-faint); margin: 0 4px; min-width: 92px; text-align: center; }

.wp-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.wp-day {
  position: relative;
  padding: 8px 6px 9px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--ease) 140ms, background var(--ease) 140ms, box-shadow var(--ease) 140ms;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wp-day:hover { border-color: var(--border-strong); background: var(--surface-2); }
.wp-day-dow { font-size: 10px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.wp-day-num { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.1; }
.wp-day-count {
  font-size: 9.5px;
  color: var(--text-faint);
  margin-top: auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-2);
}
.wp-day-count.has { color: var(--text-dim); background: var(--border-subtle); }
.wp-day-count.overdue { color: var(--danger); background: var(--danger-light); font-weight: 600; }
.wp-day-count.done-all { color: var(--success); background: var(--success-light); font-weight: 600; }

.wp-day.is-today {
  border-color: var(--brand);
  background: var(--brand-tint);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.wp-day.is-today .wp-day-num { color: var(--brand); }
.wp-day.is-today .wp-day-dow { color: var(--brand-dark); }
.wp-day.is-today::after {
  content: "HÔM NAY";
  position: absolute;
  top: -7px; left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--brand);
  padding: 1px 5px;
  border-radius: 999px;
  white-space: nowrap;
}
.wp-day.is-selected { border-color: var(--brand-dark); box-shadow: 0 0 0 2px var(--brand-tint-strong); }
.wp-day.is-empty { opacity: 0.55; }
.wp-day.is-future { background: transparent; }
.wp-day.has-overdue { border-color: rgba(220, 38, 38, 0.35); }

/* ---------- Card đóng góp (gradient accent — duy nhất có gradient) ---------- */
.today-contrib {
  grid-area: contrib;
  position: relative;
  padding: 20px 20px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(216, 35, 42, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.today-contrib::before {
  content: "";
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.tc-contrib-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.tc-contrib-num {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}
.tc-contrib-num small { font-size: 16px; font-weight: 600; opacity: 0.85; margin-left: 4px; }
.tc-contrib-sub { font-size: 12.5px; color: rgba(255, 255, 255, 0.82); margin-top: 4px; }
.tc-contrib-note { font-size: 10.5px; color: rgba(255, 255, 255, 0.55); margin-top: 8px; line-height: 1.4; }
.tc-contrib-link {
  margin-top: auto;
  padding-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.tc-contrib-link:hover { color: rgba(255, 255, 255, 0.85); }
.tc-contrib-link svg { width: 14px; height: 14px; }

/* ---------- MAIN (danh sách hôm nay, phân nhóm) ---------- */
.today-main { grid-area: main; min-width: 0; }
.today-side { grid-area: side; display: flex; flex-direction: column; gap: 18px; }
.today-banner-area { grid-area: banner; }

.today-card {
  padding: 18px 20px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.today-card.mini { padding: 16px 18px; }
.tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}
.tc-head h2 { font-size: 14px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tc-head h2 .tc-date { color: var(--text-faint); font-weight: 500; }
.tc-count {
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 600;
}
.tc-count.danger { color: var(--danger); background: var(--danger-light); }
.tc-overdue {
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-light);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 500;
}

/* Tiến độ ngày */
.tc-day-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.tc-day-progress-label { font-size: 11px; color: var(--text-dim); font-weight: 500; white-space: nowrap; }
.tc-day-progress-track { flex: 1; height: 4px; background: var(--border-subtle); border-radius: 999px; overflow: hidden; }
.tc-day-progress-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width var(--ease) 300ms; }
.tc-day-progress-pct { font-size: 11.5px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* Section header trong list */
.tc-section-head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-section-head:first-child { margin-top: 0; }
.tc-section-head .tc-section-badge {
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger-light);
  color: var(--danger);
  font-weight: 700;
}

/* Task row trong today (gọn hơn dt-task cũ) */
.dt-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid transparent;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background var(--ease) 140ms, border-color var(--ease) 140ms;
}
.dt-task:hover { background: var(--surface-2); border-color: var(--border); }
.dt-task.is-done .dt-title { text-decoration: line-through; opacity: 0.5; }
.dt-task.is-overdue { border-color: rgba(220, 38, 38, 0.2); }
.dt-task.is-overdue .dt-due { color: var(--danger); font-weight: 600; }
.dt-check {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background var(--ease) 140ms, border-color var(--ease) 140ms;
}
.dt-check:hover { border-color: var(--brand); }
.dt-task.is-done .dt-check { background: var(--success); border-color: var(--success); }
.dt-check svg { width: 11px; height: 11px; }
.dt-prio {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
}
.dt-title {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dt-due {
  font-size: 11px;
  color: var(--text-dim);
  flex: none;
  font-variant-numeric: tabular-nums;
}
.tc-empty { color: var(--text-dim); padding: 18px 4px; font-size: 13px; text-align: center; }
.tc-empty .emoji { font-size: 22px; display: block; margin-bottom: 6px; opacity: 0.7; }

/* ---------- SIDE: thống kê gọn ---------- */
.stat-list { display: flex; flex-direction: column; }
.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 0;
  gap: 8px;
}
.stat + .stat { border-top: 1px solid var(--border-subtle); }
.stat-num { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-lbl { font-size: 12px; color: var(--text-dim); text-align: right; }

/* Vinh danh gần đây */
.recog-list { display: flex; flex-direction: column; gap: 2px; }
.recog-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
}
.recog-row.is-new { background: var(--brand-tint); }
.recog-row.is-new .recog-new {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 999px;
  background: var(--brand); color: #fff; letter-spacing: 0.04em;
}
.recog-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.recog-body { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); }
.recog-body b { font-weight: 600; }
.recog-body .recog-meta { color: var(--text-faint); font-size: 11px; }
.recog-points { color: var(--brand-dark); font-weight: 700; font-size: 13px; flex: none; }
.recog-empty { color: var(--text-faint); font-size: 12px; padding: 12px 4px; }

/* ---------- Onboarding first-run ---------- */
.today-onboard {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.today-onboard-ic { font-size: 32px; flex: none; line-height: 1.2; }
.today-onboard-body { flex: 1; }
.today-onboard-body b { font-size: 15px; font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; }
.today-onboard-body p { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.today-onboard-body kbd {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text-dim);
}
.today-onboard-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.onboard-btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: background var(--ease) 140ms;
}
.onboard-btn:hover { background: var(--surface-2); color: var(--text); }
.onboard-btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.onboard-btn.primary:hover { background: var(--brand-dark); }

/* ---------- Banner Y Tưởng (mảnh, không gradient to) ---------- */
.today-ytuong-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--ease) 140ms, box-shadow var(--ease) 140ms;
}
.today-ytuong-banner:hover { border-color: var(--border-strong); box-shadow: var(--shadow-card-hover); }
.today-ytuong-banner .yt-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--brand-tint);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  font-size: 17px;
}
.today-ytuong-banner .yt-text { flex: 1; }
.today-ytuong-banner .yt-text b { font-weight: 600; }
.today-ytuong-banner .yt-text small { display: block; color: var(--text-dim); font-size: 11.5px; }
.today-ytuong-arrow {
  color: var(--brand);
  font-size: 16px;
  font-weight: 600;
  transition: transform var(--ease) 160ms;
}
.today-ytuong-banner:hover .today-ytuong-arrow { transform: translateX(3px); }
