/* components/totals.css — totais por situação acima das listas e barra de ações com os itens marcados */
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.totals.totals-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.totals.totals-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.total-card {
    display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; border: 1px solid var(--border);
    border-left-width: 4px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.total-card:hover { border-color: var(--border-strong); text-decoration: none; }
.total-card.is-active { box-shadow: var(--ring); }
.total-card strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.total-label { font-size: .84rem; }
.total-issued { border-left-color: var(--success); }
.total-cancelled { border-left-color: var(--danger); }
.total-draft { border-left-color: var(--border-strong); }
.total-pending { border-left-color: var(--warning); }

.batch-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.batch-actions [data-batch-count] { margin-right: auto; font-size: .87rem; }
.batch-actions select, .batch-actions input[type="month"] { width: auto; height: 34px; }
/* Histórico de envios por e-mail (tela da nota) */
.mail-log { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--border); }
.mail-log li { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.mail-log .mail-error { flex-basis: 100%; }

.has-receivable { display: inline-flex; vertical-align: middle; color: var(--success); }
.has-receivable .icon { width: 16px; height: 16px; }
.no-email { display: inline-flex; vertical-align: middle; color: var(--warning); }
.no-email .icon { width: 16px; height: 16px; }
.mail-sent { display: inline-flex; vertical-align: middle; color: var(--muted); }
.mail-sent .icon { width: 16px; height: 16px; }
/* Último e-mail não saiu ou a nota foi recusada: a mensagem no título */
.mail-failed, .issue-failed { display: inline-flex; vertical-align: middle; color: var(--danger); cursor: help; }
.mail-failed .icon, .issue-failed .icon { width: 16px; height: 16px; }

.col-check { width: 36px; }
.col-action { width: 44px; text-align: right; }
.icon-link {
    display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: var(--radius-sm); color: var(--muted);
}
.icon-link:hover { background: var(--surface-2); color: var(--primary); text-decoration: none; }
.icon-link .icon { width: 18px; height: 18px; }
.col-check input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--primary); }

@media (max-width: 600px) {
    .totals, .totals.totals-4, .totals.totals-5 { grid-template-columns: 1fr; }
}

/* Andamento da fatura: um ícone por etapa (feita, falta, erro, aguardando o banco) e o próximo passo */
.progress-cell { white-space: nowrap; }
.steps { display: inline-flex; gap: .3rem; vertical-align: middle; margin-right: .4rem; }
.step { display: inline-flex; cursor: help; }
.step .icon { width: 16px; height: 16px; }
.step-done { color: var(--success); }
.step-todo { color: var(--muted); opacity: .55; }
.step-error { color: var(--danger); }
.step-wait { color: var(--warning); }
.step-next { font-size: .85rem; vertical-align: middle; }
.step-next.step-todo { opacity: 1; color: var(--text); }
/* Na fatura: as etapas em linha, o próximo passo destacado */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.timeline li { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.timeline li > div { min-width: 0; }
.timeline strong, .timeline .small { display: block; }
.timeline .step { cursor: default; margin-top: .1rem; }
.timeline li.is-next { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.timeline form { margin-top: .45rem; }
.timeline form button { min-height: 30px; padding: .25rem .6rem; font-size: .82rem; }
h2 .step-next { margin-left: .5rem; font-weight: 600; }
