/* ============================================================
   Bullet · Accountant view — page-scoped styles.
   Tokens, topbar, chips, btn-mini, notlive-note all come from
   dashboard.css (shared). This file only lays out this page.
   Visual rule: quiet when fine, loud when not.
   ============================================================ */

.acc-sub { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }

/* ---- Agent runs needing attention (loud strip) ---- */
.acc-runs { border: 1px solid var(--bad-line-1); background: var(--bad-bg-1); border-radius: var(--r-lg); padding: 18px 20px; }
.acc-runs .h2 { color: var(--bad); margin-bottom: 10px; }
.acc-runs__list { display: flex; flex-direction: column; gap: 10px; }
.acc-run {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--bad-line-1);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.acc-run__main { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.acc-run__main strong { font-size: 14px; }
.acc-run__meta { font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- Actions needed ---- */
.acc-actions__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acc-action {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.acc-action__dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; }
.acc-action--bad  .acc-action__dot { background: var(--bad); }
.acc-action--warn .acc-action__dot { background: var(--warn); }
.acc-action--bad  { border-color: var(--bad-line-1); }
.acc-action__main { flex: 1; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; min-width: 0; }
.acc-action--bad .acc-action__main span:nth-child(2) { color: var(--bad); font-weight: 600; }
.acc-action--warn .acc-action__main span:nth-child(2) { color: var(--warn); font-weight: 600; }
.acc-action__detail { font-size: 12px; color: var(--muted) !important; font-weight: 400 !important; }
.acc-actions__empty { font-size: 13.5px; color: var(--good); font-weight: 600; }
.acc-actions__empty[hidden] { display: none; }

/* ---- Monthly health check table ---- */
.acc-sweep__tag {
  font-size: 12px; font-weight: 600; color: var(--muted);
  font-family: var(--font-body); font-style: italic; margin-left: 6px;
}
.acc-sweep__scroll { overflow-x: auto; }
.acc-sweep__table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  font-size: 12.5px;
}
.acc-sweep__table th, .acc-sweep__table td { border-bottom: 1px solid var(--hairline); }
.acc-sweep__table th {
  padding: 10px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--faint);
  text-align: center;
  max-width: 86px;
}
.acc-th--client { text-align: left !important; padding-left: 14px !important; }
.acc-td--client { padding: 10px 8px 10px 14px; white-space: nowrap; }
.acc-td--client strong { display: block; font-size: 13px; }
.acc-td--client span { font-size: 11.5px; color: var(--muted); }
.acc-cell { text-align: center; padding: 10px 8px; }
/* Quiet when fine: green ticks recede… */
.acc-ok { color: var(--good-line-3); font-weight: 700; }
/* …problems draw the eye. */
.acc-bad {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bad-bg-1); color: var(--bad); font-weight: 800;
}
tr.is-attention { background: var(--warm-bg-0); }
tr.is-target td { background: var(--accent-bg-2); }   /* deep-linked client */
.acc-sweep__table tr:last-child td { border-bottom: 0; }

/* Everything links (Peter's rule) — name links stay ink, underline on hover */
.acc-td--client a, .acc-run__main a, .acc-action__main a, .acc-report .h2 a, [data-acc-report-title] a {
  color: inherit; text-decoration: none;
}
.acc-td--client a:hover, .acc-run__main a:hover, .acc-action__main a:hover,
[data-acc-report-title] a:hover { text-decoration: underline; }

/* Amber "needs judgement" cell state */
.acc-flag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--warn-bg-2); color: var(--warn); font-weight: 800;
}
.acc-cell__hit { display: inline-flex; text-decoration: none; }
.acc-cell__hit:hover .acc-ok { color: var(--good); }
.acc-cell__hit:hover .acc-bad, .acc-cell__hit:hover .acc-flag { transform: scale(1.12); }

/* ---- Sweep report ---- */
.acc-report { border: 1px solid var(--hairline); background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px; }
.acc-report[hidden] { display: none; }
.acc-report__body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.acc-rep-group { border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg); }
.acc-rep-group summary {
  cursor: pointer; padding: 10px 14px; font-size: 13.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  list-style: none;
}
.acc-rep-group summary::-webkit-details-marker { display: none; }
.acc-rep-group__state { font-size: 11.5px; font-weight: 600; color: var(--good); }
.acc-rep-group--flag { border-color: var(--warn-line-1); }
.acc-rep-group--flag .acc-rep-group__state { color: var(--warn); }
.acc-rep-group--fail { border-color: var(--bad-line-1); }
.acc-rep-group--fail .acc-rep-group__state { color: var(--bad); }
.acc-rep-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--hairline);
  background: var(--surface); font-size: 12.5px;
}
.acc-rep-check__chip {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; margin-top: 1px;
}
.acc-rep-check--pass .acc-rep-check__chip { color: var(--good-line-3); }
.acc-rep-check--flag .acc-rep-check__chip { background: var(--warn-bg-2); color: var(--warn); }
.acc-rep-check--fail .acc-rep-check__chip { background: var(--bad-bg-1); color: var(--bad); }
.acc-rep-check__main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acc-rep-check__cmp { color: var(--faint); font-size: 11px; }
.acc-rep-check__reason { color: var(--ink-soft); }
.acc-rep-check--fail .acc-rep-check__reason { color: var(--bad); font-weight: 600; }
.acc-rep-check--flag .acc-rep-check__reason { color: var(--warn); font-weight: 600; }
.acc-rep-check--pass { opacity: 0.72; }
.acc-rep-check .btn-mini { white-space: nowrap; }

/* ---- How-tos wanted ---- */
.acc-howtos { border: 1px solid var(--warn-line-1); background: var(--warn-bg-1); border-radius: var(--r-lg); padding: 18px 20px; }
.acc-howtos[hidden] { display: none; }
.acc-howtos__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.acc-howtos__list li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.acc-howtos__list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--surface); border: 1px solid var(--warn-line-1); border-radius: 4px; padding: 2px 7px;
}
.acc-howtos__list span { color: var(--muted); }

/* Button pairs on run/action rows */
.acc-btns { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.acc-btns .btn-mini { white-space: nowrap; }
.acc-btns [data-relogin][disabled] { color: var(--good); border-color: var(--good-line-2); background: var(--good-bg-2); cursor: default; }

@media (max-width: 900px) {
  .acc-run, .acc-action { flex-wrap: wrap; }
}

/* Who fixes it + what to do on every action row. */
.acc-own {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-pill); margin-left: 8px;
}
.acc-own--us   { background: var(--info-bg-2); color: var(--info-ink); }
.acc-own--them { background: var(--warn-bg-2); color: var(--warn); }
.acc-action__todo {
  margin-top: 4px; padding-top: 5px;
  border-top: 1px dashed rgba(0,0,0,0.08);
  font-size: 12px; color: var(--ink-soft) !important; font-weight: 400 !important;
}
.acc-action__todo b { color: var(--ink); }

/* ---- Figure notes: the working-papers ledger ---- */
.acc-notes__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.acc-notes__years { display: inline-flex; gap: 4px; }
.acc-year {
  appearance: none; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 3px 12px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.acc-year:hover { color: var(--ink); }
.acc-year.is-active { background: var(--ink); border-color: var(--ink); color: var(--ink-contrast); }
.acc-notes__body { display: flex; flex-direction: column; gap: 14px; }
.acc-noteline {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.acc-noteline__ref { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; margin: 0 0 8px; }
.acc-note { padding: 8px 0; border-top: 1px solid var(--hairline); }
.acc-note:first-of-type { border-top: 0; padding-top: 0; }
.acc-note__top { display: flex; align-items: baseline; gap: 10px; font-size: 12px; }
.acc-note__period { font-weight: 700; color: var(--ink); }
.acc-note__src { font-weight: 600; border: 1px dashed var(--hairline-strong); border-radius: var(--r-pill); padding: 0 8px; font-size: 11px; color: var(--muted); }
.acc-note__src--edited { border-color: var(--warn-line-2); color: var(--warn); }
.acc-note__date { margin-left: auto; color: var(--faint); font-size: 11.5px; }
.acc-note__text { margin: 3px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

/* Quiet count on the client row — a link when there are notes, a dash when not. */
.acc-th--notes { white-space: nowrap; }
.acc-cell--notes { white-space: nowrap; }
.acc-notes__count { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.acc-notes__count:hover { color: var(--ink); }
.acc-notes__none { color: var(--faint); }

/* Print / export: the ledger alone on paper. */
@media print {
  body.is-printing-notes .topbar,
  body.is-printing-notes .notlive-note,
  body.is-printing-notes .acc-runs,
  body.is-printing-notes .acc-actions,
  body.is-printing-notes .acc-sweep,
  body.is-printing-notes .acc-report,
  body.is-printing-notes .acc-howtos,
  body.is-printing-notes [data-acc-notes-print],
  body.is-printing-notes .acc-notes__years { display: none !important; }
}

/* Counts that drill in (Feature 2). */
.acc-countlink { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.acc-countlink--bad { color: var(--bad); }
.acc-countlink--warn { color: var(--warn); }
.acc-countlink.is-on { background: var(--chip-bg); border-radius: var(--r-sm); padding: 0 6px; text-decoration: none; }
.acc-action[hidden], .acc-rep-check[hidden] { display: none; }

/* The client's money beside the checks (9 Sep). */
.acc-money { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
/* The customer's own note on a failing line. */
.acc-rep-check__note { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-soft); background: var(--accent-bg-1); border: 1px solid var(--accent-line-1); border-radius: var(--r-sm); padding: 6px 8px; }
.acc-rep-check__note em { color: var(--muted); font-style: normal; }
.acc-rep-check__note a { margin-left: 6px; font-weight: 600; }
.h2 .info--inline { vertical-align: middle; margin-left: 4px; }

/* A narrowed health-check table (an Ask card landed here) says so. */
.acc-sweep__narrow { margin: 6px 0 10px; font-size: 12.5px; color: var(--muted); }
.acc-sweep__narrow a { color: inherit; }
