/*
 * Giving → Transactions (templates/donation/list.html.twig), "tx-". Builds on the shell tokens
 * in shell.css. Fund colors come from the page (--fc), matching the Giving Overview charts.
 */
.tx { --tx-ink: #1e293b; --tx-muted: #64748b; --tx-line: #e2e8f0; --tx-blue: #1663d6; color: var(--tx-ink); }
.tx .gv-svg { flex: none; }

/* ---- Header ------------------------------------------------------------------------------ */
.tx-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.tx-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.tx-head p { margin: 3px 0 0; color: var(--tx-muted); font-size: 14px; }
.tx-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tx .tx-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #cbd5e1; background: #fff; color: var(--tx-ink); border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none; }
.tx .tx-btn::-webkit-details-marker { display: none; }
.tx .tx-btn:hover { border-color: #93c5fd; background: #fafcff; }
.tx .tx-btn.primary { background: var(--tx-blue); border-color: var(--tx-blue); color: #fff; }
.tx .tx-btn.primary:hover { background: #0f55bd; }
.tx .tx-btn.small { padding: 6px 12px; font-size: 13px; }
.tx .tx-icon-btn { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 8px; color: #334155; cursor: pointer; list-style: none; }
.tx .tx-icon-btn::-webkit-details-marker { display: none; }
.tx .tx-icon-btn:hover { background: #e2e8f0; }
.tx-menu { position: relative; display: inline-block; }
.tx-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 190px; background: #fff; border: 1px solid var(--tx-line); border-radius: 9px; box-shadow: 0 10px 25px #0f172a22; padding: 5px; text-align: left; }
.tx-menu-list a, .tx-menu-list button { display: block; width: 100%; text-align: left; padding: 7px 10px; border-radius: 6px; color: var(--tx-ink); text-decoration: none; background: none; border: 0; font-size: 13px; }
.tx-menu-list a:hover, .tx-menu-list button:hover { background: #f1f5f9; }
.tx-menu-list form { margin: 4px 0 0; border-top: 1px solid var(--tx-line); padding-top: 4px; }
.tx-menu-list .danger { color: #b91c1c; }

/* ---- Period bar -------------------------------------------------------------------------- */
.tx-periodbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.tx-seg, .tx-view { display: inline-flex; background: #fff; border: 1px solid var(--tx-line); border-radius: 10px; padding: 4px; gap: 2px; }
.tx .tx-seg a, .tx .tx-view a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px; border-radius: 7px; color: #334155; text-decoration: none; font-weight: 500; font-size: 14px; }
.tx .tx-seg a:hover, .tx .tx-view a:hover { background: #f1f5f9; }
.tx .tx-seg a.active { background: var(--tx-blue); color: #fff; box-shadow: 0 2px 6px rgba(22, 99, 214, .3); }
.tx-stepper { display: inline-flex; align-items: stretch; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; overflow: hidden; }
.tx .tx-stepper a { display: inline-flex; align-items: center; padding: 0 12px; color: #334155; }
.tx .tx-stepper a:hover { background: #f1f5f9; }
.tx-stepper-label { display: inline-flex; align-items: center; gap: 8px; min-width: 210px; justify-content: center; padding: 9px 14px; font-weight: 700; border-left: 1px solid var(--tx-line); border-right: 1px solid var(--tx-line); }
.tx-range { margin-left: auto; color: var(--tx-muted); font-size: 15px; }

/* ---- KPI strip --------------------------------------------------------------------------- */
.tx-kpis { display: grid; grid-template-columns: minmax(250px, 1.5fr) minmax(150px, .9fr) repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tx-kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px; border: 1px solid; text-decoration: none; color: var(--tx-ink); min-width: 0; }
.tx-kpi > div { min-width: 0; }
.tx-kpi b { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -.3px; }
.tx-kpi small { display: block; color: #475569; font-size: 13px; }
.tx-kpi-icon { display: flex; flex: none; }
.tx-kpi.total { background: #e8f0fc; border-color: #c6d8f5; }
.tx-kpi.total .tx-kpi-icon { color: #1d5fc4; }
.tx-kpi.total b { font-size: 25px; }
.tx-kpi.count { background: #fff; border-color: var(--tx-line); }
.tx-kpi.count .tx-kpi-icon { color: #1d5fc4; }
.tx-kpi.fund { background: color-mix(in srgb, var(--fc) 9%, #fff); border-color: color-mix(in srgb, var(--fc) 35%, #fff); transition: transform .1s; }
.tx-kpi.fund:hover { color: var(--tx-ink); transform: translateY(-1px); }
.tx-kpi.fund.current { border-width: 2px; border-color: var(--fc); }
.tx-kpi.fund .tx-kpi-icon { color: var(--fc); }
.tx-kpi.fund small:first-child { font-weight: 500; color: var(--tx-ink); font-size: 14px; }
.tx-change { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.tx-change.up { color: #15803d; }
.tx-change.down { color: #b91c1c; }

/* ---- Filters ----------------------------------------------------------------------------- */
.tx-filters { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--tx-line); }
.tx-search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; border: 1px solid #cbd5e1; background: #fff; border-radius: 9px; padding: 0 14px; color: #475569; margin: 0; }
.tx-search:focus-within { border-color: #86b7fe; box-shadow: 0 0 0 .2rem #0d6efd22; }
.tx-search input { border: 0; outline: 0; flex: 1; padding: 10px 0; min-width: 0; background: transparent; }
.tx-filter { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 14px; color: #334155; }
.tx-filter .form-select { min-width: 170px; border-radius: 9px; border-color: #cbd5e1; }
.tx-filter .form-select.is-set { border-color: var(--tx-blue); box-shadow: 0 0 0 1px var(--tx-blue); }
.tx-more { position: relative; }
.tx-more-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; display: grid; gap: 10px; background: #fff; border: 1px solid var(--tx-line); border-radius: 10px; box-shadow: 0 10px 25px #0f172a22; padding: 14px; }
.tx-more-panel label { display: grid; gap: 4px; font-size: 13px; color: #334155; margin: 0; }
.tx .tx-reset { color: var(--tx-blue); font-weight: 600; text-decoration: none; padding: 9px 4px; }
.tx .tx-reset:hover { text-decoration: underline; }

/* ---- Transactions card ------------------------------------------------------------------- */
.tx-card { background: #fff; border-radius: 12px; border: 1px solid var(--tx-line); box-shadow: 0 1px 3px #0f172a14; }
.tx-card-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; }
.tx-card-head h2 { margin: 0; font-size: 21px; font-weight: 700; }
.tx-total { background: #eef2f7; border-radius: 9px; padding: 5px 14px; font-size: 14px; }
.tx-filtered { color: var(--tx-blue); font-size: 12px; font-weight: 600; background: #e8f0fc; border-radius: 20px; padding: 3px 10px; }
.tx-card-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tx .tx-view a { padding: 6px 16px; font-weight: 600; font-size: 13px; }
.tx .tx-view a.active { background: #e8f0fc; color: var(--tx-blue); }
.tx-sort { width: auto; min-width: 180px; border-radius: 9px; border-color: #cbd5e1; }

.tx-bulk { display: flex; align-items: center; gap: 14px; margin: 0 18px 10px; padding: 8px 14px; border-radius: 9px; background: #e8f0fc; font-size: 14px; font-weight: 600; color: #1e3a5f; }
.tx-bulk[hidden] { display: none; }
.tx-table-wrap { overflow-x: auto; padding: 0 12px; }
.tx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.tx-table thead th { background: #eef2f7; padding: 11px 12px; font-weight: 700; white-space: nowrap; text-align: left; }
.tx-table thead th:first-child { border-radius: 9px 0 0 9px; }
.tx-table thead th:last-child { border-radius: 0 9px 9px 0; }
.tx .tx-table thead a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tx-table td { padding: 8px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.tx-table tbody tr:hover { background: #f7faff; }
.tx-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-check { width: 44px; }
.tx-check input { width: 17px; height: 17px; accent-color: var(--tx-blue); vertical-align: middle; }
.tx-date { white-space: nowrap; }
.tx .tx-table td a { color: var(--tx-blue); text-decoration: underline; text-underline-offset: 2px; }
.tx-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 10px; vertical-align: 0; }
.tx-type { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.tx-type .gv-svg { color: #334155; }
.tx-amount { font-weight: 700; }
.tx-row-menu { width: 48px; text-align: center; }
.tx-closed { font-size: 11px; background: #eef1f4; color: #66778a; border-radius: 20px; padding: 2px 8px; }
.tx-empty { text-align: center; color: var(--tx-muted); padding: 30px !important; }

.tx-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 16px 18px; margin-top: 8px; border-top: 1px solid var(--tx-line); }
.tx-per { display: flex; align-items: center; gap: 10px; margin: 0; color: #334155; }
.tx-per .form-select { width: auto; border-radius: 8px; }
.tx-showing { color: #475569; text-align: center; }
.tx-pages { display: flex; gap: 6px; justify-content: flex-end; }
.tx .tx-pages a, .tx-pages span { min-width: 40px; height: 38px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5e1; border-radius: 8px; color: #334155; text-decoration: none; background: #fff; }
.tx .tx-pages a:hover { border-color: #93c5fd; }
.tx .tx-pages a.current { background: var(--tx-blue); border-color: var(--tx-blue); color: #fff; font-weight: 600; }
.tx-pages .off { color: #cbd5e1; }

.tx-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 4px 18px 20px; }
.tx-summary h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.tx-bar { display: block; height: 6px; margin-top: 6px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.tx-bar span { display: block; height: 100%; border-radius: 4px; }

@media (max-width: 1100px) {
    .tx-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
    .tx-range { margin-left: 0; width: 100%; }
    .tx-summary { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .tx-head h1 { font-size: 23px; }
    .tx-stepper { flex: 1; } .tx-stepper-label { min-width: 0; flex: 1; }
    .tx-filter { flex: 1 1 100%; }
    .tx-card-tools { margin-left: 0; }
    .tx-foot { grid-template-columns: 1fr; justify-items: center; }
    .tx-pages { justify-content: center; flex-wrap: wrap; }
    .tx .tx-seg a { padding: 7px 12px; }
}
