/* Overview (#/overview): status groups, needs attention, migration, app requests, recent activity.
   Page-specific rules only: shared components live in app.css and charts.css, colors in tokens.css.
   Prefix every selector with this page's root class (see js/README.md, "CSS conventions"). */

/* ---------- Status: four groups in one section, separated by hairlines (never cards in a card) ---------- */

.page-overview .status-group {
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.page-overview .status-group-title { font-size: 14px; font-weight: 600; }

.page-overview .status-group-note {
  display: flex; gap: var(--space-2); align-items: flex-start;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  font-size: var(--text-secondary); color: var(--ink);
  background: var(--info-wash);
  overflow-wrap: anywhere;
}
.page-overview .status-group-note.is-critical { background: var(--critical-wash); }
.page-overview .status-group-note.is-warning { background: var(--warning-wash); }
.page-overview .status-group-note .status-icon { margin-top: 2px; }
.page-overview .status-group-empty { font-size: var(--text-secondary); color: var(--ink-3); }

.page-overview .status-rows { display: flex; flex-direction: column; }

/* A row is one link: icon | name and word, then the fact | chevron. The hover wash bleeds into the gutter. */
.page-overview .component-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px;
  gap: var(--space-2); align-items: start;
  margin: 0 calc(-1 * var(--space-2));
  padding: var(--space-2);
  border-radius: var(--radius-control);
  color: var(--ink); text-decoration: none;
}
.page-overview a.component-row:hover { background: var(--hover); }
.page-overview .component-row > .status-icon { margin-top: 3px; }
.page-overview .component-main { display: flex; flex-direction: column; min-width: 0; }
.page-overview .component-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--space-2); }
.page-overview .component-name { font-weight: 500; }
.page-overview .component-word { font-size: var(--text-secondary); color: var(--ink-2); }
.page-overview .component-fact { font-size: var(--text-secondary); color: var(--ink-2); overflow-wrap: anywhere; }
.page-overview .component-chevron { margin-top: 3px; color: var(--ink-3); }
.page-overview a.component-row:hover .component-name { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Needs attention ---------- */

/* Actions carry commands and setting names (docker logs food-api-api-v2-1, MAXMIND_LICENSE_KEY): let them wrap */
.page-overview .attention-item { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; overflow-wrap: anywhere; }
.page-overview .attention-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.page-overview .attention-head .status-word { font-weight: 600; }
.page-overview .attention-title { font-weight: 600; min-width: 0; }
.page-overview .attention-action { color: var(--ink-2); }
.page-overview .attention-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  font-size: var(--text-meta); color: var(--ink-3);
}
.page-overview .attention-open { font-size: var(--text-secondary); }
.page-overview .attention-more { padding-top: var(--space-3); }
.page-overview .attention-none { color: var(--ink-2); }
.page-overview .attention-skipped {
  margin-top: var(--space-4); padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.page-overview .attention-skipped-item { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-secondary); color: var(--ink-2); overflow-wrap: anywhere; }
.page-overview .attention-skipped-item .status-icon { margin-top: 2px; }
.page-overview .attention-checked { margin-top: var(--space-3); font-size: var(--text-meta); color: var(--ink-3); }

/* ---------- Migration to v2 and App requests: side by side from 1024 px (grid-2) ---------- */

.page-overview .migration-apps { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); }
.page-overview .migration-row .meter-head { flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); }
.page-overview .migration-row .meter-value { color: var(--ink-2); }
.page-overview .migration-app { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.page-overview .migration-app-name { font-weight: 600; font-size: var(--text-body); }
.page-overview .migration-note { margin-top: var(--space-4); font-size: var(--text-meta); color: var(--ink-3); }

/* ---------- Recent activity: time | icon | sentence; on small phones the time sits above the sentence ---------- */

.page-overview .activity-item {
  /* At least 7.5em so times line up; wider for the odd "12 Oct 2025, 14:00" from another year */
  display: grid; grid-template-columns: minmax(7.5em, max-content) 16px minmax(0, 1fr);
  grid-template-areas: "time icon text";
  gap: var(--space-1) var(--space-3); align-items: start;
}
.page-overview .activity-time {
  grid-area: time;
  font-size: var(--text-secondary); color: var(--ink-3);
  white-space: nowrap;
}
.page-overview .activity-item > svg { grid-area: icon; margin-top: 3px; }
.page-overview .activity-icon { color: var(--ink-3); }
.page-overview .activity-text { grid-area: text; min-width: 0; overflow-wrap: anywhere; }
.page-overview .activity-actor { font-size: var(--text-meta); color: var(--ink-3); }

@media (max-width: 479px) {
  .page-overview .activity-item {
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-areas: "icon time" "icon text";
    gap: 0 var(--space-3);
  }
}

/* ---------- Phones: 44 px touch targets ---------- */

@media (max-width: 767px) {
  .page-overview .component-row { min-height: var(--touch); }
  .page-overview .attention-open { display: inline-flex; align-items: center; min-height: var(--touch); }
  .page-overview .migration-app-name { display: inline-flex; align-items: center; min-height: var(--touch); }
  .page-overview .activity-text a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

@media (forced-colors: active) {
  .page-overview .status-group-note { border: 1px solid CanvasText; }
}
