/* Dashboard view (SPEC §13): CLI account cards. Dark theme via base.css tokens. LF line endings. */

.dashboard-view {
  height: 100%;
  overflow-y: auto;
  padding: 16px 20px 32px;
}
/* mounted on #view-root itself, whose `overflow: hidden` (an id rule) would otherwise win */
#view-root.dashboard-view { overflow-y: auto; }

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.dashboard-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.dashboard-toolbar .dashboard-asof { margin-left: auto; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
  align-items: start;
}

/* ---- card ------------------------------------------------------------- */

.account-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.account-card.is-pending { opacity: 0.55; }
.account-head .badge.runner-codex { background: color-mix(in srgb, var(--accent-codex) 16%, transparent); }

.account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.account-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.account-id {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11px;
}

.account-row {
  display: grid;
  grid-template-columns: 56px auto 1fr;
  align-items: start;
  gap: 4px 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.account-row-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}
.account-row-body {
  min-width: 0;
  font-size: 12px;
  line-height: 20px;
}

/* Follow-up slots, hidden while empty:
 * .account-usage — plan-limit bars (Claude usage, #11); .account-spend — Boxer's own spend (#12). */
.account-slot:empty { display: none; }
.account-usage,
.account-spend { grid-template-columns: 56px 1fr; }

.account-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
}

/* ---- pieces ----------------------------------------------------------- */

.acct-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.acct-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.acct-chip.tone-ok { color: var(--ok); }
.acct-chip.tone-warn { color: var(--warn); }
.acct-chip.tone-danger { color: var(--danger); }
.acct-chip.tone-muted { color: var(--muted); }

.acct-meta { color: var(--text); overflow-wrap: anywhere; }
.acct-path {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-error { color: var(--danger); overflow-wrap: anywhere; }
.acct-muted,
.acct-asof { color: var(--muted); font-size: 12px; }
.acct-source {
  color: var(--muted-2);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-hint { color: var(--warn); }

/* ---- usage meters (#11): fill = severity, track = a dim step of the same hue -------- */

.usage-limit + .usage-limit { margin-top: 8px; }
.usage-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.usage-label { color: var(--text); font-weight: 600; }
.usage-pct { color: var(--text); font-variant-numeric: tabular-nums; }
.usage-flag {
  color: var(--muted);
  font-size: 11px;
  text-transform: lowercase;
}
.usage-resets {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.usage-bar {
  --tone: var(--accent);
  height: 6px;
  margin-top: 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tone) 22%, transparent);
  overflow: hidden;
}
.usage-bar.tone-warn { --tone: var(--warn); }
.usage-bar.tone-danger { --tone: var(--danger); }
.usage-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--tone);
}
.usage-extra,
.usage-asof {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}
.acct-code {
  display: block;
  margin-top: 4px;
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text);
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---- Boxer spend (#12) ------------------------------------------------ */

.acct-spend-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.acct-spend-period {
  font-size: 11px;
  padding: 1px 4px;
}
