/* Plan Dashboard — three-card "what needs my attention" page */

/* Topline -- where the program sits in its cycle, what ends or starts
   next, this week's session count, and the same ranked headline chips
   the weekly planner's brief shows. Reuses .week-brief-clear,
   .week-brief-more, and .brief-chip* from weekly_planner.css, which
   loads on every page -- only the elements unique to this strip get a
   .plan-topline* class. */
.plan-topline {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  background: var(--surface-white);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-topline-where {
  display: flex;
  gap: 0.875rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.plan-topline-program {
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.plan-topline-cycle {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.plan-topline-next {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  border-left: 1px solid var(--border);
  padding-left: 0.875rem;
}

.plan-topline-sessions {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  margin-left: auto;
}

.plan-topline-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.plan-topline-chips-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 0.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.plan-topline-chips-label:hover {
  text-decoration: underline;
}

.plan-dashboard-work {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 1024px) {
  .plan-dashboard-work {
    grid-template-columns: 1fr 1.25fr;
  }
}


/* Cycle Outlook — gap row distinction */
.plan-dashboard-gap-row {
  background-color: var(--light-gray, #f8f9fa);
  color: var(--medium-gray, #6c757d);
  font-style: italic;
}

.plan-dashboard-gap-row td:first-child {
  font-weight: 500;
}

/* Next Up -- the queue table. Each row's tint is a hint, not a badge: a
   subtle background for "act today" and a warmer one for an uncovered
   gap, so the eye can triage the list without reading every cell. */
.next-up-today {
  background: var(--surface-muted);
}

.next-up-gap {
  background: var(--alert-warning-bg);
}

.next-up-more td {
  text-align: center;
  color: var(--text-muted);
}

.next-up-when,
.next-up-action {
  width: 1%;
  white-space: nowrap;
}

/* Cycle Outlook -- per-week coverage strip in the Weeks column, the status
   badge folded into the name cell, indented child rows, and a whole-row
   click target (row-link controller opens the cycle; the action link
   itself stops propagation so it never double-navigates). */
.coverage-strip {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.coverage-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.coverage-cell-planned {
  background: var(--success-color);
}

.coverage-cell-drafting {
  background: var(--badge-warning);
}

.coverage-cell-unplanned {
  background: transparent;
  border: 1px solid var(--border);
}

.cycle-outlook-row {
  cursor: pointer;
}

.cycle-outlook-title {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.cycle-outlook-status {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  white-space: nowrap;
}

.cycle-outlook-status-ending_soon {
  color: var(--alert-warning-text);
}

.cycle-outlook-dates,
.cycle-outlook-action {
  width: 1%;
  white-space: nowrap;
}

.cycle-outlook-child .cycle-outlook-name {
  padding-left: 1.25rem;
}

.cycle-outlook-child-mark {
  flex: none;
  color: var(--text-muted);
}

.cycle-outlook-count {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.cycle-outlook-drafts {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.cycle-outlook-weeks {
  width: 1%;
  white-space: nowrap;
}

/* Direction row -- four tiles (Stimulus, Equipment, Elements, Muscles)
   previewing Analytics::DirectionReport on the dashboard, each linking to
   its Analysis tab. Same card surface as .plan-topline. */
.plan-direction {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.plan-direction-tile {
  box-sizing: border-box;
  min-width: 0;
  background: var(--surface-white);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.plan-direction-tile-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.plan-direction-tile-link {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--primary-color);
  white-space: nowrap;
}

.plan-direction-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.125rem 0;
  font-size: 0.75rem;
}

.plan-direction-item-label {
  /* A grid item's min-width is auto, so without this the label widens
     its track instead of truncating. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-direction-item-count {
  color: var(--text-muted);
  font-size: 0.6875rem;
  white-space: nowrap;
}

.plan-direction-delta {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.plan-direction-delta-up {
  color: var(--load-moderate);
}

.plan-direction-delta-down {
  color: var(--load-rest);
}

.plan-direction-delta-flat {
  color: var(--text-muted);
}

.plan-direction-foot {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 0.375rem 0 0;
  padding-top: 0.375rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
  .plan-direction {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .plan-direction {
    grid-template-columns: 1fr;
  }
}
