/* Dashboard: one work list plus a side column. Loaded after styles.css; owned
   by js/views/net-graph.js. Classes use the dsh- prefix; the dash-* rules in
   styles.css still style the Nabu version pie (dash-versions, dash-pie, dash-legend). */

.dsh { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dsh .page-bar { margin-bottom: 0; }
.dsh-muted { color: var(--text-muted); }
.dsh-warn { color: var(--warning-dark); font-weight: 600; }
.dsh-bad { color: var(--danger); }
.dsh-ok { color: var(--success); }

/* Header */
.dsh-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dsh-headline { margin: 0; color: var(--text-muted); font-size: var(--t-body); }
.dsh-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-small); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dsh-live.is-stale { color: var(--warning-dark); }
.dsh-client { min-width: 180px; max-width: 280px; font-size: var(--t-small); padding: 5px 8px; }

/* KPI tiles */
.dsh-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dsh-kpi {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 10px 14px; text-align: left; font: inherit; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer;
}
.dsh-kpi:hover { border-color: var(--primary); }
.dsh-kpi:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.dsh-kpi.is-loading { cursor: default; }
.dsh-kpi.is-loading:hover { border-color: var(--border); }
.dsh-kpi-l { font-size: var(--t-meta); color: var(--text-muted); }
.dsh-kpi-v { font-size: var(--t-section); font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.dsh-kpi-of { font-size: var(--t-body); font-weight: 500; color: var(--text-muted); }
.dsh-kpi-s { font-size: var(--t-meta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .dsh-kpi { transition: border-color .12s; } }

/* Two columns from 1200px: queue 2/3, side panels 1/3 */
.dsh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1200px) { .dsh-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.dsh-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; outline: none; scroll-margin-top: 16px; }
.dsh-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Work-list groups: a plain heading over a bordered list */
.dsh-grp { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card-bg); }
.dsh-gh {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: var(--card-bg); border-bottom: 1px solid var(--border); cursor: pointer;
}
.dsh-grp.is-collapsed .dsh-gh { border-bottom: 0; }
.dsh-gh-t {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; padding: 2px 0; font: inherit; font-size: var(--t-small); color: var(--text);
  text-align: left; cursor: pointer;
}
.dsh-gh-t.is-static { cursor: default; }
.dsh-gh-t b { font-weight: 600; font-size: var(--t-body); min-width: 0; }
.dsh-gh-t:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.dsh-caret { color: var(--text-muted); width: 12px; text-align: center; flex: none; }
.dsh-grp.is-collapsed .dsh-rows { display: none; }

.dsh-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.dsh-rows > .dsh-row:last-child { border-bottom: 0; }
.dsh-row-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dsh-ttl { font-weight: 600; font-size: var(--t-body); overflow-wrap: anywhere; }
.dsh-ttl-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.dsh-ttl-link:hover { color: var(--link); text-decoration: underline; }
/* The printer's own words, verbatim: a quiet red code box */
.dsh-errs { display: flex; flex-wrap: wrap; gap: 4px; }
.dsh-err {
  align-self: flex-start; max-width: 100%; padding: 2px 8px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--t-meta); line-height: 1.5;
  background: var(--danger-bg); color: var(--danger-dark); overflow-wrap: anywhere;
}
.dsh-note { font-size: var(--t-small); color: var(--warning-dark); }
/* Computers an install failed on */
.dsh-hosts { display: flex; flex-direction: column; margin-top: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.dsh-host { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 6px 10px; border-top: 1px solid var(--border); font-size: var(--t-small); }
.dsh-host:first-child { border-top: 0; }
.dsh-host-n { border: 0; background: none; padding: 0; font: inherit; font-family: var(--font-mono); font-size: var(--t-small); font-weight: 500; color: var(--text); cursor: pointer; min-width: 120px; text-align: left; }
.dsh-host-n:hover { color: var(--link); text-decoration: underline; }
.dsh-host-st { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--t-meta); }
.dsh-host-e { flex: 1 1 200px; min-width: 0; color: var(--text-muted); font-family: var(--font-mono); font-size: var(--t-meta); overflow-wrap: anywhere; }
.dsh-host-more { border: 0; border-top: 1px solid var(--border); background: none; padding: 6px 10px; font: inherit; font-size: var(--t-small); color: var(--link); text-align: left; cursor: pointer; }
.dsh-host-more:hover { background: var(--hover-bg); }
.dsh-toner-line { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-small); font-weight: 600; color: var(--warning-dark); font-variant-numeric: tabular-nums; }
.dsh-toner-line.is-bad { color: var(--danger-dark); }
.dsh-toner-line .dsh-bar { width: 64px; margin: 0; height: 6px; border-radius: 3px; }
.dsh-toner-line .dsh-bar-fill { background: currentColor; border-radius: 3px; }
.dsh-where { font-weight: 400; color: var(--text-muted); }
.dsh-sub {
  font-size: var(--t-small); color: var(--text-muted); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dsh-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dsh-acts .btn svg { width: 14px; height: 14px; }
.dsh-quiet { background: transparent; border: 1px solid transparent; color: var(--text-muted); }
.dsh-quiet:hover:not(:disabled) { background: var(--hover-strong); color: var(--text); }
.dsh-more {
  display: block; width: 100%; padding: 8px 14px; border: 0; border-top: 1px solid var(--border);
  background: none; font: inherit; font-size: var(--t-small); color: var(--link); text-align: left; cursor: pointer;
}
.dsh-more:hover { background: var(--hover-bg); }

/* Pills */
.dsh-pill {
  display: inline-flex; align-items: center; flex: none; font-size: var(--t-meta); font-weight: 600;
  padding: 0 8px; line-height: 20px; border-radius: var(--radius-pill); white-space: nowrap;
}
.dsh-pill-red   { background: var(--danger-bg);  color: var(--danger-dark); }
.dsh-pill-amber { background: var(--warning-bg); color: var(--warning-dark); }
.dsh-pill-gray  { background: var(--bg-muted);   color: var(--text-btn); }
.dsh-pill-blue  { background: var(--primary-light); color: var(--primary-text); }
.dsh-pill-green { background: var(--success-bg); color: var(--success-dark); }

/* Calm state, notes, snoozed */
.dsh-calm {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); font-size: var(--t-small);
}
.dsh-calm .sdot { margin-top: 6px; }
.dsh-qnote { font-size: var(--t-small); color: var(--warning-dark); }
.dsh-qfoot { display: flex; }
.dsh-link { border: 0; background: none; padding: 2px 0; font: inherit; font-size: var(--t-small); color: var(--link); cursor: pointer; }
.dsh-link:hover { color: var(--link-hover); text-decoration: underline; }
.dsh-grp-snoozed .dsh-gh { cursor: default; }

/* Side panels */
.dsh-panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-bg); overflow: hidden; min-width: 0; }
.dsh-panel-h {
  margin: 0; padding: 10px 16px; font-size: var(--t-body); font-weight: 600; color: var(--text);
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.dsh-panel-note { font-size: var(--t-meta); font-weight: 400; color: var(--text-muted); }
.dsh-panel-b { display: flex; flex-direction: column; padding: 4px 0; max-height: 420px; overflow: auto; }
.dsh-empty { padding: 10px 14px; font-size: var(--t-small); color: var(--text-muted); }

.dsh-li {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  padding: 7px 14px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer;
}
.dsh-li:hover { background: var(--hover-bg); }
.dsh-li.is-static { cursor: default; }
.dsh-li.is-static:hover { background: none; }
.dsh-li .sdot { margin-top: 6px; }
.dsh-li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dsh-li-t { font-size: var(--t-small); font-weight: 600; overflow-wrap: anywhere; }
.dsh-li-s { font-size: var(--t-meta); color: var(--text-muted); overflow-wrap: anywhere; }
.dsh-bar { display: block; height: 4px; border-radius: 2px; background: var(--bg-muted); overflow: hidden; }
.dsh-bar-fill { display: block; height: 100%; border-radius: 2px; }

/* Nabu rollout card */
.dsh-panel-h .dsh-pill { margin-left: auto; }
.dsh-roll-b { padding: 0; }
.dsh-roll-in { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.dsh-roll-t { margin: 0; font-size: var(--t-small); color: var(--text-btn); }
.dsh-progress { height: 8px; border-radius: 4px; background: var(--bg-muted); overflow: hidden; }
.dsh-progress > span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
@media (prefers-reduced-motion: no-preference) { .dsh-progress > span { transition: width .4s ease; } }
.dsh-roll-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; font-size: var(--t-meta); color: var(--text-muted); }
.dsh-roll-stats b { display: block; font-size: var(--t-card); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dsh-roll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--t-meta); }

.dsh-ev {
  display: grid; grid-template-columns: 56px 8px minmax(0, 1fr); gap: 8px; align-items: center;
  width: 100%; padding: 6px 14px; border: 0; background: none; font: inherit; font-size: var(--t-small);
  color: var(--text); text-align: left; cursor: pointer;
}
.dsh-ev:hover { background: var(--hover-bg); }
.dsh-ev-time { color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dsh-ev-text { overflow-wrap: anywhere; }

.dsh-network > summary { cursor: pointer; list-style: none; border-bottom: 0; }
.dsh-network > summary::-webkit-details-marker { display: none; }
.dsh-network > summary::before { content: '▸'; color: var(--text-muted); width: 10px; }
.dsh-network[open] > summary { border-bottom: 1px solid var(--border); }
.dsh-network[open] > summary::before { content: '▾'; }
.dsh-network .dsh-panel-b { padding: 10px 14px; max-height: none; }
.dsh-network .dash-versions { grid-template-columns: 120px minmax(0, 1fr); }

.dsh-copy { width: 100%; font-family: var(--font-mono); font-size: var(--t-small); resize: vertical; }

/* Narrow screens */
@media (max-width: 900px) {
  .dsh-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dsh-client { max-width: none; flex: 1 1 100%; }
  .dsh-kpi { padding: 8px 12px; }
  .dsh-kpi-v { font-size: var(--t-section); }
  .dsh-gh { flex-wrap: wrap; padding: 8px 12px; }
  .dsh-gh-t { flex: 1 1 calc(100% - 30px); }
  .dsh-gh-t b { font-size: var(--t-small); }
  .dsh-caret { order: 1; }
  .dsh-gh > .btn { order: 2; }
  .dsh-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 9px 12px; }
  .dsh-acts { justify-content: flex-start; }
  .dsh-network .dash-versions { grid-template-columns: 1fr; justify-items: center; }
}
