/*
 * Giving Account profile (templates/donation_account/show.html.twig), "ap-". Tables, menus, buttons
 * and the pager come from transactions.css ("tx-").
 */
.ap-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tx .ap-back { display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center; border-radius: 50%; background: #fff; border: 1px solid var(--tx-line); color: var(--tx-ink); }
.tx .ap-back:hover { background: #f1f5f9; }
.ap-head-title { flex: 1; min-width: 220px; }
.ap-head-title h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
.ap-head-title p { margin: 2px 0 0; color: var(--tx-muted); font-size: 14px; }

/* ---- Identity + KPIs --------------------------------------------------------------------- */
.ap-top { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(0, 2fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.ap-identity { display: flex; gap: 18px; padding: 18px 20px; background: #fff; border: 1px solid var(--tx-line); border-radius: 12px; box-shadow: 0 1px 3px #0f172a14; }
.ap-avatar { width: 64px; height: 64px; flex: none; border-radius: 14px; display: grid; place-items: center; background: #e3edfb; color: #2a6fd6; }
.ap-number { font-size: 15px; color: #334155; }
.ap-identity h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 10px; font-size: 24px; font-weight: 700; }
.ap-status { font-size: 13px; font-weight: 600; color: #15803d; background: #dcfce7; border-radius: 8px; padding: 3px 10px; }
.ap-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ap-contact li { display: flex; align-items: flex-start; gap: 10px; }
.ap-contact .gv-svg { color: #475569; margin-top: 2px; }
.tx .ap-contact a { color: var(--tx-ink); text-decoration: none; }
.tx .ap-contact a:hover { color: var(--tx-blue); text-decoration: underline; }

.ap-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ap-kpi { display: flex; gap: 14px; padding: 16px; border-radius: 12px; border: 1px solid; min-width: 0; }
.ap-kpi > div { min-width: 0; }
.ap-kpi small { display: block; font-size: 13px; font-weight: 600; color: #334155; }
.ap-kpi b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.3px; margin: 3px 0 2px; white-space: nowrap; }
.ap-kpi span:not(.ap-kpi-icon) { font-size: 14px; color: #334155; }
.ap-kpi em { font-style: normal; font-weight: 600; }
.ap-kpi em.up { color: #15803d; }
.ap-kpi em.down { color: #b91c1c; }
.ap-kpi-icon { width: 46px; height: 46px; flex: none; border-radius: 11px; display: grid; place-items: center; }
.ap-kpi.green { background: #ecf8f1; border-color: #c4e8d3; } .ap-kpi.green .ap-kpi-icon { background: #cdeedb; color: #15803d; }
.ap-kpi.purple { background: #f4effd; border-color: #ddd0f6; } .ap-kpi.purple .ap-kpi-icon { background: #e6daf9; color: #7c3aed; }
.ap-kpi.blue { background: #edf3fd; border-color: #cbdcf6; } .ap-kpi.blue .ap-kpi-icon { background: #d6e4fa; color: #1d5fc4; }
.ap-kpi.orange { background: #fef5e8; border-color: #f6dcb4; } .ap-kpi.orange .ap-kpi-icon { background: #fde5bf; color: #c26a06; }

/* ---- Tabs -------------------------------------------------------------------------------- */
.ap-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.tx .ap-tabs a { display: inline-flex; align-items: center; gap: 9px; padding: 10px 26px; border-radius: 10px; background: #fff; border: 1px solid var(--tx-line); color: #1e293b; font-weight: 600; font-size: 14px; text-decoration: none; }
.tx .ap-tabs a:hover { border-color: #93c5fd; }
.tx .ap-tabs a.active { background: var(--tx-blue); border-color: var(--tx-blue); color: #fff; box-shadow: 0 3px 8px rgba(22, 99, 214, .3); }

/* ---- Overview panels --------------------------------------------------------------------- */
.ap-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, .85fr); gap: 18px; margin-bottom: 18px; }
.ap-panel { padding: 16px 18px; min-width: 0; }
.ap-panel h3 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.ap-chart { position: relative; height: 210px; }
.ap-funds { display: flex; align-items: center; gap: 16px; }
.ap-donut { position: relative; flex: none; width: 170px; height: 170px; }
.ap-fund-table { flex: 1; min-width: 0; border-collapse: collapse; font-size: 14px; }
.ap-fund-table td { padding: 6px 3px; }
.ap-fund-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ap-share { color: var(--tx-muted); }
.ap-details { margin: 0; display: grid; }
.ap-details > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid #edf0f4; font-size: 14px; }
.ap-details > div:last-child { border-bottom: 0; }
.ap-details dt { display: flex; align-items: center; gap: 10px; font-weight: 500; color: #334155; }
.ap-details dt .gv-svg { color: #475569; }
.ap-details dd { margin: 0; font-weight: 600; }
.tx .ap-details a { color: var(--tx-blue); text-decoration: none; }
.tx .ap-details a:hover { text-decoration: underline; }

/* ---- Transactions ------------------------------------------------------------------------ */
.ap-tx-head h2 { font-size: 19px; }
.ap-select { width: auto; min-width: 190px; border-radius: 9px; border-color: #cbd5e1; }
.ap-select.is-set { border-color: var(--tx-blue); }
.ap-range summary { font-weight: 500; }
.ap-row-actions { width: 96px; white-space: nowrap; text-align: right; }
.ap-row-actions .tx-menu { vertical-align: middle; }
.tx .ap-boxed { width: 34px; height: 34px; border: 1px solid var(--tx-line); background: #fff; }
.ap-statement-links { text-align: right; white-space: nowrap; }
.tx .ap-statement-links a { margin-left: 16px; color: var(--tx-blue); font-weight: 600; text-decoration: none; }
.tx .ap-statement-links a:hover { text-decoration: underline; }
.ap-note { color: var(--tx-muted); font-size: 14px; margin: 0 0 12px; }

@media (max-width: 1350px) {
    .ap-top { grid-template-columns: 1fr; }
    .ap-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ap-row > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .ap-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ap-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ap-kpis { grid-template-columns: 1fr; }
    .ap-identity { flex-direction: column; }
    .ap-funds { flex-direction: column; align-items: stretch; }
    .ap-donut { align-self: center; }
    .ap-select { min-width: 0; flex: 1; }
    .tx .ap-tabs a { padding: 9px 14px; }
}
