/* Notas, detalhe da nota e Clientes. */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.head-row .btn { width: auto; min-width: 0; min-height: 44px; }
.search { position: relative; }
.search input { display: block; width: 100%; min-height: var(--touch); padding: 0 var(--s3) 0 44px; background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-sm); }
.search svg { position: absolute; left: var(--s3); top: 50%; transform: translateY(-50%); color: var(--muted); }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s1); scrollbar-width: none; }
.chips::-webkit-scrollbar, .chat-quick::-webkit-scrollbar, .plans::-webkit-scrollbar { display: none; }
.chips button { flex: none; min-height: 40px; padding: 0 var(--s4); background: var(--surface); border: 1px solid var(--border-control); border-radius: var(--radius-pill); font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.list { overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.avatar-lg { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--primary); font-weight: 700; font-size: var(--fs-subtitulo); }
.avatar-sm { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--primary); font-size: var(--fs-detalhe); font-weight: 700; }
.client-row { display: flex; align-items: center; gap: var(--s3); }
.client-row .who strong { display: block; }

.detail-head { display: grid; gap: var(--s2); justify-items: start; }
.actions3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); }
.actions3 .btn, .actions3 button.btn { flex-direction: column; gap: var(--s1); min-height: 64px; width: 100%; min-width: 0; font-size: var(--fs-detalhe); }
.detail-head, .info-card, .official { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .actions3 { gap: var(--s1); } .foot-links { flex-wrap: wrap; } }
.info-card { padding: var(--s4); display: grid; gap: var(--s2); }
.info-card h2 { color: var(--muted); }
.official { background: var(--surface-2); border-color: transparent; }
.foot-links { display: flex; justify-content: space-between; gap: var(--s3); }
.danger { color: var(--status-recusada); }
.timeline { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); }
.timeline li { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-detalhe); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.radio { display: flex; align-items: center; gap: var(--s3); min-height: var(--touch); padding: 0 var(--s3); border: 1px solid var(--border-control); border-radius: var(--radius-sm); font-weight: 600; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }
.radio input { accent-color: var(--primary); width: 20px; height: 20px; }
.counter { text-align: right; font-size: var(--fs-detalhe); color: var(--muted); font-variant-numeric: tabular-nums; }

@media (min-width: 1024px) {
  .view:has(.list-wide) { max-width: 1040px; }
  .note-row { min-height: 64px; }
  .view:has(.detail-head) { max-width: 720px; }
}

/* Nota cancelada ou substituída: apagada, valor riscado. */
.note-row.is-off .who strong, .note-row.is-off .meta { color: var(--muted); font-weight: 500; }
.note-row.is-off .amount { color: var(--muted); text-decoration: line-through; font-weight: 500; }

/* Linha do tempo da nota: o último evento fica em destaque. */
.tl { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s3); }
.tl-i { display: flex; gap: var(--s3); align-items: flex-start; color: var(--muted); --tl: var(--muted); }
.tl-ic { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--tl); }
.tl-i strong { display: block; font-weight: 600; }
.tl-i .meta { display: block; font-size: var(--fs-detalhe); color: var(--muted); }
.tl-i.is-last { color: var(--fg); }
.tl-i.is-last .tl-ic { width: 36px; height: 36px; background: var(--tl); color: var(--on-primary); }
.tl-i.is-last strong { color: var(--tl); }
.tl-emitida { --tl: var(--status-emitida); }
.tl-recusada { --tl: var(--status-recusada); }
.tl-cancelada { --tl: var(--status-recusada); }
.tl-substituida { --tl: var(--status-cancelada); }
.tl-pedido, .tl-analise { --tl: var(--status-emitindo-ink); }
