/* Transactions list, entry form and AI capture */

/* ------------------------------------------------------------ chooser */
.tx-chooser { display: flex; flex-direction: column; gap: 10px; }
.tx-choice {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; min-height: 76px; text-align: left;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.tx-choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.tx-choice:active { transform: scale(.99); }
.tx-choice-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--primary); color: var(--primary-contrast); }
.tx-choice-icon .icon { width: 24px; height: 24px; }
.tx-choice-anexo .tx-choice-icon { background: #0e9384; color: #fff; }
.tx-choice-texto .tx-choice-icon { background: #7a5af8; color: #fff; }
.tx-choice-manual .tx-choice-icon { background: var(--surface-3); color: var(--text); }
.tx-choice-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tx-choice-arrow { color: var(--subtle); }
.tx-note { display: flex; align-items: flex-start; gap: 6px; }
.tx-note.center { justify-content: center; }
.tx-note .icon { flex: none; margin-top: 2px; }

/* --------------------------------------------------------------- form */
.tx-details { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.tx-details > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
.tx-details > summary::-webkit-details-marker { display: none; }
.tx-details > summary::after { content: "▾"; margin-left: auto; transition: transform .15s; }
.tx-details[open] > summary::after { transform: rotate(180deg); }
.tx-details-body, .tx-details > div { padding-bottom: 12px; }
.tx-missing { border-color: var(--warn) !important; background: var(--warn-bg); }
.tx-missing-field .input, .tx-missing-field .select { border-color: var(--warn); background: var(--warn-bg); }
.tx-dup-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------- capture */
.tx-text-input { min-height: 130px; font-size: 16px; }
.tx-jobs { gap: 14px; }
.tx-job { padding: 14px; display: flex; flex-direction: column; gap: 14px; box-shadow: none; }
.tx-job-head { display: flex; gap: 12px; align-items: center; }
.tx-job-preview { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.tx-job-preview img { width: 100%; height: 100%; object-fit: cover; }
.tx-job-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tx-job-status { display: flex; align-items: center; gap: 8px; }
.tx-inline-spinner { width: 16px; height: 16px; border-width: 2px; flex: none; }
.tx-review { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.tx-card-actions { gap: 8px; }
.tx-saved { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- list */
.tx-searchbar { gap: 8px; }
.tx-searchbar .input-group { min-width: 0; }
.tx-custom .input { width: auto; min-height: 40px; }
.tx-filter-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tx-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; overflow: hidden; }
.tx-total { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.tx-total strong { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 720px) {
  .tx-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tx-total { border-bottom: 0; }
  .tx-total:last-child { border-right: 0; }
}
.tx-table td { vertical-align: middle; }
.tx-desc-cell { width: 34%; max-width: 0; }
.tx-bank-cell { white-space: nowrap; }
.tx-kind-line { gap: 6px; }
.tx-ai-mark { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 650; }
.tx-ai-mark .icon { width: 12px; height: 12px; }
.tx-tags { gap: 4px; }
.tx-card { align-items: flex-start; }
.tx-card .list-item-side { align-self: center; }
.tx-card-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 48px; flex: none; padding-top: 2px; font-variant-numeric: tabular-nums; }
.tx-card .tx-tags { margin-top: 4px; }
@media (min-width: 900px) { .tx-cards { display: none; } }
@media (max-width: 899px) { .tx-table { display: none !important; } }

/* -------------------------------------------------------------- detail */
.tx-detail-head { display: flex; flex-direction: column; gap: 6px; }
.tx-detail-head .amount { font-size: 1.8rem; }
.tx-detail-desc { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-weight: 550; overflow-wrap: anywhere; }
.tx-history { list-style: none; margin: 0; padding: 0 0 6px; display: flex; flex-direction: column; gap: 10px; }
.tx-history li { padding-left: 12px; border-left: 2px solid var(--border-strong); }
