/* Tổng quan tháng (docs/MONTH_OVERVIEW.md). Dùng token trong styles.css (:root); không viết mã màu trực tiếp. */

.month-toolbar { margin-bottom:12px; }
.month-toolbar h2 { margin:0; }

/* One sentence when the month is done or empty. */
.month-headline { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin:0 0 14px; padding:10px 14px; border-left:4px solid var(--line); border-radius:var(--radius-sm); background:var(--card); }
.month-headline.is-done { border-left-color:var(--green); background:var(--greenbg); color:var(--green); }
.month-error { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 12px; }

/* Four cards in work order: two columns on a laptop, four on a wide screen, one on a phone. */
.month-cards { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; align-items:start; }
/* A month not read yet: its cards empty, never another month's numbers. A month on screen being read again stays usable. */
.month-cards.is-skeleton { opacity:.55; }
.month-card-loading { margin:0; }
.month-refreshing { color:var(--muted); font-size:var(--fs-sm); }
@media (min-width: 1680px) { .month-cards { grid-template-columns:repeat(4, minmax(0, 1fr)); } }
.month-card { display:grid; gap:10px; min-width:0; padding:16px; }
.month-card-title { display:flex; align-items:center; gap:8px; margin:0; font-size:var(--fs-md); }
.month-step { display:inline-grid; place-items:center; width:22px; height:22px; flex:none; border-radius:50%; background:var(--teal2); color:var(--teal-dark); font-size:var(--fs-xs); font-weight:700; }
.month-card-title details.help { margin-left:auto; }

/* Lines: a number and what it counts; the whole line opens the place to act. */
.month-lines { display:grid; gap:2px; margin:0; padding:0; list-style:none; }
.month-line { display:flex; align-items:center; gap:4px; min-width:0; border-left:3px solid transparent; }
.month-line.is-warning { border-left-color:var(--amber); }
.month-line.is-ai { border-left-color:var(--ai); }
.month-line.is-done { border-left-color:var(--green); }
.month-link, .month-text { display:flex; align-items:baseline; gap:4px; flex:1 1 auto; min-width:0; padding:7px 8px; border:0; border-radius:var(--radius-sm); background:transparent; color:var(--ink); font:inherit; text-align:left; overflow-wrap:anywhere; }
.month-link { cursor:pointer; text-decoration:none; }
.month-link:hover { background:var(--pale); }
.month-link > .icon { margin-left:auto; align-self:center; color:var(--muted); }
.month-count { font-size:var(--fs-md); font-variant-numeric:tabular-nums; }
.month-line.is-ai .month-count { color:var(--ai); }
.month-line.is-zero .month-text { color:var(--muted); }
.month-line.is-zero .month-count { font-weight:600; }
.month-line > details.help { flex:none; }

/* The progress of the month's checks. */
.month-progress { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; gap:10px; }
.month-progress progress { width:100%; height:8px; accent-color:var(--green); }
.month-progress-text { font-weight:600; font-variant-numeric:tabular-nums; }

/* The AI action and a running batch sit at the foot of the Hạch toán card; the line above already says the count. */
.month-card .review-ai-banner { margin:0; }
.month-card .review-ai-banner > strong { display:none; }
.month-card .review-run { margin:0; }
.month-ai { display:grid; gap:8px; }
.month-ai-all { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; color:var(--muted); font-size:13px; }

/* Payments without an invoice: the count opens the list, each item its transaction. */
.month-payments { flex:1 1 auto; min-width:0; }
.month-payments > summary { list-style:none; }
.month-payments > summary::-webkit-details-marker { display:none; }
.month-payments[open] > summary > .icon { transform:rotate(180deg); }
.month-payment-list { display:grid; gap:2px; margin:4px 0 6px; padding:0 0 0 8px; list-style:none; }
.month-line:has(> .month-reasons) { flex-wrap:wrap; }
.month-reasons { flex-basis:100%; display:grid; gap:2px; margin:0 0 6px; padding:0 0 0 12px; list-style:none; font-size:.9em; }
.month-payment { display:grid; grid-template-columns:auto auto minmax(0, 1fr) auto; align-items:baseline; gap:4px 10px; width:100%; padding:5px 6px; border:0; border-radius:var(--radius-sm); background:transparent; color:var(--ink); font:inherit; font-size:var(--fs-sm); text-align:left; cursor:pointer; }
.month-payment:hover { background:var(--pale); }
.month-payment-code { font-weight:600; }
.month-payment-party { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.month-payment-amount { font-variant-numeric:tabular-nums; text-align:right; }
.month-payments > p { margin:0 0 6px 14px; font-size:var(--fs-xs); }

.month-cards + .dossier-balances-panel { margin-top:16px; }

@media (max-width: 900px) {
  .month-cards { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .month-filter-bar > * { flex:1 1 100%; max-width:none; }
  .month-payment { grid-template-columns:auto minmax(0, 1fr); }
  .month-payment-party { grid-column:1 / -1; white-space:normal; }
  .month-payment-amount { text-align:left; }
}

/* Files not read (issue #4): the count opens the list, like the payments without an invoice. */
.month-unread { flex:1 1 auto; min-width:0; }
.month-unread > summary { list-style:none; }
.month-unread > summary::-webkit-details-marker { display:none; }
.month-unread[open] > summary > .icon { transform:rotate(180deg); }
.month-unread .month-unread-file { grid-template-columns:minmax(0, max-content) minmax(0, 1fr); }
.month-unread .month-unread-file .month-payment-code { overflow-wrap:anywhere; }
/* Statement reconciliation (issue #5): one line per configured bank account, then what differs from the bank's own statement. */
.month-bank-lines { flex:1 1 auto; min-width:0; }
.month-bank-accounts { display:grid; gap:2px; margin:4px 0 4px 8px; padding:0; list-style:none; font-size:var(--fs-sm); }
.month-bank-account.is-warning > strong, .month-bank-account.is-no_statement > strong, .month-bank-account.is-unsplit > strong { color:var(--amber); }
.month-bank-item { display:block; text-decoration:none; }
.month-bank-text { white-space:normal; overflow-wrap:anywhere; }
