body.home-page {
  max-width: 1200px;
}

.home-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
}

.home-hero .subtitle {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

.home-dash-side {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }
}

.dash-widget {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dash-widget-planner {
  min-height: 22rem;
}

.dash-widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.dash-widget-head h2 {
  margin: 0;
  font-size: 0.98rem;
}

.dash-planner-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
}

.dash-day-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.dash-day-nav-btn,
.dash-day-nav-today {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  padding: 0.28rem 0.45rem;
}

.dash-day-nav-btn {
  min-width: 1.7rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--muted);
}

.dash-day-nav-today {
  min-width: 3.6rem;
  padding: 0.3rem 0.55rem;
  color: var(--muted);
}

.dash-day-nav-today.is-current {
  background: #e0e7ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.dash-day-nav-btn:hover,
.dash-day-nav-today:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.dash-day-nav-today.is-current:hover {
  background: #c7d2fe;
  color: #312e81;
}

.dash-day-nav-btn:focus-visible,
.dash-day-nav-today:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.dash-widget-head a {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.dash-widget-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.dash-widget-head-actions .btn {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
}

.dash-widget-idea {
  background:
    linear-gradient(145deg, rgba(238, 242, 255, 0.85) 0%, rgba(255, 255, 255, 0.98) 42%, #fff 100%);
  border-color: #c7d2fe;
}

.dash-widget-idea .dash-widget-head h2 {
  color: #312e81;
}

.dash-widget-idea .dash-idea-body {
  gap: 0.9rem;
}

.dash-idea-copy {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
}

.dash-idea-cta {
  align-self: stretch;
  justify-content: center;
  padding: 0.72rem 1.05rem;
  font-size: 0.94rem;
  font-weight: 800;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-idea-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.26);
}

/* Edit / New task overlay — full-viewport iframe (modal + dimmer live inside) */
.dash-task-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

.dash-task-overlay.hidden {
  display: none !important;
}

.dash-task-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.dash-task-frame {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color-scheme: normal;
}

.dash-widget-body {
  flex: 1;
  padding: 0.75rem 0.95rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dash-loading,
.dash-empty,
.dash-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.dash-error {
  color: var(--danger);
}

/* Day-view style task chips (match /tasks/ Day) */
.dash-day-bucket {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.dash-day-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.dash-day-cards {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-task-chip-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
}

.dash-task-star {
  flex-shrink: 0;
  width: 1.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.dash-task-star:hover {
  color: #ca8a04;
  border-color: #facc15;
}

.dash-task-star.is-starred {
  color: #ca8a04;
  background: #fef9c3;
  border-color: #fde047;
}

.dash-task-done {
  flex-shrink: 0;
  align-self: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text, #0f172a);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

.dash-task-done:hover:not(:disabled) {
  border-color: #16a34a;
  color: #15803d;
  background: #f0fdf4;
}

.dash-task-done:disabled,
.dash-task-done.is-blocked {
  opacity: 0.55;
  cursor: not-allowed;
}

.dash-task-chip {
  flex: 1;
  min-width: 0;
  display: block;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: inherit;
  background: var(--surface-hover);
  text-align: left;
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
}

.dash-task-chip:hover {
  border-color: var(--accent);
  color: inherit;
  text-decoration: none;
}

.dash-task-chip.is-done {
  opacity: 0.55;
}

.dash-task-chip.is-spanning {
  background: var(--accent-muted);
}

.dash-task-chip.is-starred {
  background: #fffbeb;
}

.dash-task-chip.is-fixed-overdue {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #ef4444;
  color: #b91c1c;
}

.dash-task-chip-time {
  display: inline-block;
  min-width: 3.25rem;
  margin-right: 0.5rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dash-task-chip-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.1rem;
  font-weight: 500;
}

.dash-ar-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border-radius: 0.65rem;
  border: 1px solid #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
}

.dash-ar-group.all-done {
  border-color: var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.dash-ar-group-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.1rem 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.dash-ar-group-chevron {
  display: inline-flex;
  width: 1rem;
  justify-content: center;
  font-size: 0.7rem;
  color: #c2410c;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.dash-ar-group.collapsed .dash-ar-group-chevron {
  transform: rotate(-90deg);
}

.dash-ar-group-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #9a3412;
  flex: 1;
}

.dash-ar-group.all-done .dash-ar-group-title,
.dash-ar-group.all-done .dash-ar-group-chevron {
  color: var(--muted);
}

.dash-ar-group-count {
  font-size: 0.68rem;
  font-weight: 650;
  color: #9a3412;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.dash-ar-group.all-done .dash-ar-group-count {
  color: var(--muted);
}

.dash-ar-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-ar-group.collapsed .dash-ar-group-body {
  display: none;
}

.dash-ar-group .dash-task-chip {
  background: #fff;
}

.dash-priority-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.dash-priority-starred {
  border-color: #fde047;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.dash-priority-section-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-priority-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #92400e;
  flex: 1;
}

.dash-priority-other .dash-priority-section-title {
  color: var(--muted);
}

.dash-priority-section-count {
  font-size: 0.65rem;
  font-weight: 650;
  color: #92400e;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

.dash-priority-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-name-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.dash-name-card {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  min-width: 7.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.dash-name-card .label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--text);
}

.dash-name-card strong {
  color: var(--text);
  font-weight: 700;
}

.dash-name-card.is-total {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.dash-name-card.is-total .label {
  font-weight: 800;
}

.dash-section-label {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dash-next-close,
.dash-overdue {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
}

.dash-next-close {
  background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--border));
}

.dash-overdue {
  background: var(--danger-bg, #fef2f2);
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
}

.dash-next-close span,
.dash-overdue span {
  color: var(--muted);
}

.dash-overdue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dash-overdue-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.8rem;
}

.dash-overdue-list .when {
  color: var(--danger);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dash-sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dash-sub-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.dash-sub-list .sub-end {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dash-sub-list .sub-end.is-soon {
  color: var(--warn);
  font-weight: 700;
}

.dash-cash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.dash-cash-stat {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  text-align: center;
}

.dash-cash-stat .k {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.dash-cash-stat .v {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dash-cash-stat.is-in .v { color: var(--success); }
.dash-cash-stat.is-out .v { color: var(--danger); }
.dash-cash-stat.is-net .v { color: var(--text); }

.dash-cash-meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.home-quick {
  margin-top: 0.25rem;
}

.home-quick h3 {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.home-quick-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.home-quick-grid a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.home-quick-grid a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
