/* NALQIVO ERP — Bank statements & reconciliation | كشوف البنك والتسويات
   A quiet banking workspace on the shared tokens: white cards, one violet
   accent, soft tints and tabular numbers. No new palette. */

.bankrec-app { display: block; }
.bankrec-app .page-actions { flex-wrap: wrap; }
.bankrec-app .ltr { direction: ltr; unicode-bidi: embed; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bankrec-app .small-v { font-size: 15px; }

/* ---- Hub: balances ------------------------------------------------------- */
.brecon-hero {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff 20%, var(--brand-50) 140%);
  box-shadow: var(--nq-shadow-1, 0 1px 2px rgba(25, 29, 51, .05));
}
.brecon-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.brecon-balance {
  /* kpi card lock */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.brecon-balance.soft { background: var(--surface-2); }
.brecon-balance-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.brecon-balance-ico { color: var(--brand); display: inline-flex; }
.brecon-acc {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  background: var(--brand-50); color: var(--brand-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  direction: ltr; unicode-bidi: embed;
}
.brecon-cur { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.brecon-balance-v {
  font-size: 22px; font-weight: 750; color: var(--ink);
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.brecon-balance-v.ltr {
  display: block; width: 100%; text-align: start;
  direction: ltr; unicode-bidi: isolate;
}
.brecon-balance-k { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.brecon-balance-k b { color: var(--ink-2); }

/* ---- Hub: layout --------------------------------------------------------- */
.brecon-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.brecon-list-card, .brecon-import-card { min-width: 0; }
.brecon-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 10px;
}
.brecon-card-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.brecon-card-head p { margin: 3px 0 0; }
.brecon-count {
  display: inline-grid; place-items: center; min-width: 28px; height: 24px;
  padding: 0 8px; border-radius: 99px; background: var(--surface-3);
  color: var(--muted); font-size: 11px; font-weight: 700;
}
.brecon-table-wrap { overflow-x: auto; }
.brecon-table { margin: 0; }
.brecon-table th { white-space: nowrap; font-size: 10.5px; }
.brecon-table td { vertical-align: middle; }
.brecon-table tr.clickable { cursor: pointer; }
.brecon-table tr.clickable:hover { background: var(--surface-2); }
.brecon-no { font-weight: 700; color: var(--ink); font-size: 12.5px; }
.brecon-row-go { color: var(--muted-2); text-align: end; width: 28px; }
.brecon-progress { display: flex; flex-direction: column; gap: 4px; min-width: 108px; }
.brecon-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.brecon-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2, var(--nq-primary-300))); transition: width .25s ease; }
.brecon-progress span { font-size: 10.5px; }

.brecon-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 40px 20px; color: var(--muted); text-align: center;
}
.brecon-empty svg { color: var(--brand-300, var(--nq-primary-300)); }
.brecon-empty strong { color: var(--ink-2); font-size: 13px; }
.brecon-empty span { font-size: 11.5px; max-width: 340px; line-height: 1.7; }
.brecon-empty.small { padding: 22px 12px; }

/* ---- Importer ------------------------------------------------------------ */
.brecon-import-card { position: sticky; top: 78px; }
.brecon-form { display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; }
.brecon-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 22px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.brecon-drop svg { color: var(--brand); margin-bottom: 2px; }
.brecon-drop strong { color: var(--ink-2); font-size: 12.5px; }
.brecon-drop span { font-size: 11px; }
.brecon-drop:hover, .brecon-drop:focus-visible, .brecon-drop.is-over { border-color: var(--brand-300); background: var(--brand-50); outline: none; }
.brecon-drop.has-file { border-style: solid; border-color: var(--brand-200); background: #fff; }
.brecon-file {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  margin-top: 6px; padding: 4px 9px; border-radius: 7px;
  background: var(--brand-50); color: var(--brand-2); font-size: 10.5px; font-weight: 600;
}
.brecon-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.brecon-file em { font-style: normal; color: var(--muted); font-weight: 500; }
.brecon-fieldset { border: 0; margin: 0; padding: 0; }
.brecon-fieldset legend { font-size: 10.5px; color: var(--muted); margin-bottom: 5px; }
.brecon-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.brecon-seg label { position: relative; }
.brecon-seg input { position: absolute; opacity: 0; pointer-events: none; }
.brecon-seg span {
  display: block; text-align: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 600;
  direction: ltr; unicode-bidi: embed; cursor: pointer;
}
.brecon-seg input:checked + span { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-200); }
.brecon-more, .brecon-policy, .brecon-mapping {
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.brecon-more summary, .brecon-policy summary, .brecon-mapping summary {
  padding: 9px 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; list-style: none;
}
.brecon-more summary::-webkit-details-marker, .brecon-policy summary::-webkit-details-marker, .brecon-mapping summary::-webkit-details-marker { display: none; }
.brecon-more summary::before, .brecon-policy summary::before, .brecon-mapping summary::before {
  content: "+"; display: inline-block; width: 16px; color: var(--brand); font-weight: 700;
}
.brecon-more[open] summary::before, .brecon-policy[open] summary::before, .brecon-mapping[open] summary::before { content: "−"; }
.brecon-more > *, .brecon-policy > form { padding: 0 12px 12px; }
.brecon-policy { margin: 0 18px 18px; }
.brecon-policy > form { padding-top: 2px; }
.brecon-mapping { margin-top: 4px; }
.brecon-mapping > * { padding: 0 12px 12px; }
.brecon-more label, .brecon-policy label { font-size: 10.5px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.brecon-checks { display: grid; gap: 6px; margin: 10px 0; }
.brecon-checks label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11.5px; }
.brecon-form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.brecon-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.brecon-preview-head { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.brecon-preview-head strong { color: var(--ink); font-size: 11.5px; }
.brecon-preview-table { max-height: 230px; overflow: auto; }
.brecon-preview-table .table { margin: 0; }
.brecon-preview-table td { padding: 5px 8px; font-size: 10.5px; }
.brecon-app .in { color: var(--green); }
.brecon-app .out { color: var(--red); }

/* ---- Statement hero ------------------------------------------------------ */
.brecon-statement-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center;
  padding: 18px 20px; margin-bottom: 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--brand-50) 150%);
}
.brecon-ring {
  --p: 0;
  width: 92px; height: 92px; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; position: relative;
}
.brecon-ring::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.brecon-ring-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.brecon-ring-in .v { font-size: 19px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.brecon-ring-in small { font-size: 9px; color: var(--muted); }
.brecon-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.brecon-statement-title { font-size: 22px; font-weight: 750; color: var(--ink); letter-spacing: -.01em; }
.brecon-statement-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.brecon-proof-mini {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-size: 10.5px; color: var(--muted); min-width: 160px;
}
.brecon-proof-mini b { font-size: 16px; color: var(--ink); }
.brecon-proof-mini small { font-size: 9.5px; color: var(--muted-2); }
.brecon-proof-mini.ok { border-color: var(--green-soft); background: var(--green-soft); }
.brecon-proof-mini.ok b { color: #077a63; }
.brecon-proof-mini.gap { border-color: var(--amber-soft); background: var(--amber-soft); }
.brecon-proof-mini.gap b { color: #9c6407; }

.brecon-tiles {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
.brecon-tile {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.brecon-tile .k { font-size: 10px; color: var(--muted); }
.brecon-tile .v { font-size: 15px; font-weight: 700; color: var(--ink); }
.brecon-tile.in .v { color: #077a63; }
.brecon-tile.out .v { color: #b32e3d; }
.brecon-tile.strong { background: var(--brand-50); border-color: var(--brand-200); }
.brecon-tile.strong .v { color: var(--brand-2); }
.brecon-tile.ok .v { color: #077a63; }
.brecon-tile.gap { background: var(--amber-soft); border-color: #f3d9a3; }
.brecon-tile.gap .v { color: #9c6407; }

/* ---- Workspace ----------------------------------------------------------- */
.brecon-workspace { overflow: hidden; }
.brecon-tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.brecon-tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 12px; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.brecon-tab span {
  min-width: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--surface-3); color: var(--muted); font-size: 9.5px; line-height: 16px; text-align: center;
}
.brecon-tab:hover { color: var(--ink-2); }
.brecon-tab.active { color: var(--brand); }
.brecon-tab.active::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; border-radius: 99px 99px 0 0; background: var(--brand); }
.brecon-tab.active span { background: var(--brand-50); color: var(--brand); }
.brecon-pane { padding: 14px 16px 18px; }
.brecon-pane-loading { padding: 30px 0; }

.brecon-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.brecon-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.brecon-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
}
.brecon-filter span { font-size: 9.5px; color: var(--muted-2); font-weight: 700; }
.brecon-filter:hover { background: var(--surface-2); color: var(--ink-2); }
.brecon-filter.active { background: var(--brand-50); color: var(--brand-2); border-color: var(--brand-100); }
.brecon-filter.active span { color: var(--brand); }
.brecon-search { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); }
.brecon-search .input { min-width: 230px; height: 32px; font-size: 11.5px; }

.brecon-lines { margin: 0; }
.brecon-lines th { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.brecon-lines th.num, .brecon-lines td.num { text-align: end; }
.brecon-lines td { vertical-align: top; padding: 10px 12px; }
.brecon-line.matched { background: #fff; }
.brecon-line.ignored { background: var(--surface-2); }
.brecon-line.ignored .brecon-desc { color: var(--muted); }
.brecon-date { color: var(--muted); font-size: 11px; padding-top: 12px; }
.brecon-desc { font-size: 12px; color: var(--ink-2); line-height: 1.55; }
.brecon-ref { font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.brecon-lines td.num { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.brecon-lines td.num small { display: block; font-size: 8.5px; color: var(--muted-2); font-weight: 500; }
.brecon-match-cell { min-width: 300px; max-width: 520px; }
.brecon-auto { font-size: 9px; color: var(--muted-2); margin-top: 3px; }
.brecon-matches { display: flex; flex-direction: column; gap: 4px; }
.brecon-match-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 3px 4px 3px 8px; border: 1px solid var(--brand-100); border-radius: 7px;
  background: var(--brand-50); font-size: 10.5px;
}
.brecon-match-chip a, .brecon-match-chip > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--brand-2); text-decoration: none; }
.brecon-match-chip .bml { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brecon-match-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.brecon-x {
  display: inline-grid; place-items: center; width: 18px; height: 18px;
  border: 0; border-radius: 5px; background: transparent; color: var(--muted-2); cursor: pointer;
}
.brecon-x:hover { background: var(--red-soft); color: var(--red); }
.brecon-partial { display: flex; align-items: center; gap: 8px; margin-top: 6px; max-width: 320px; }
.brecon-partial .brecon-bar { flex: 1; }
.brecon-partial span { font-size: 9.5px; color: var(--amber); white-space: nowrap; }
.brecon-under { margin-top: 4px; }
.brecon-under .btn { font-size: 10px; padding: 2px 7px; }
.brecon-ignored { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.brecon-sugs { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.brecon-sug {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  text-align: start; cursor: pointer; font-size: 10.5px;
}
.brecon-sug:hover { border-color: var(--brand-200); background: var(--brand-50); }
.brecon-sug.exact { border-color: var(--brand-200); }
.brecon-sug .bs-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brecon-sug .bs-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brecon-sug .bs-meta { color: var(--muted); font-size: 9.5px; display: inline-flex; gap: 4px; align-items: center; }
.brecon-sug .bs-side { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--brand); }
.brecon-sug .bs-side em { font-style: normal; font-size: 9px; color: var(--muted); }
.brecon-sug.exact .bs-side em { color: var(--green); }
.brecon-sugs > .btn { align-self: flex-start; }

.brecon-filter-totals {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted);
}
.brecon-filter-totals b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---- Reconciliation statement ------------------------------------------- */
.brecon-recon-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.brecon-recon-head h3 { margin: 0; font-size: 15px; }
.brecon-recon-head p { margin: 3px 0 0; }
.brecon-recon-sign { flex-shrink: 0; }
.brecon-proof { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.brecon-proof-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-2);
}
.brecon-proof-row:last-child { border-bottom: 0; }
.brecon-proof-row b { font-size: 13px; font-variant-numeric: tabular-nums; }
.brecon-proof-row.add { background: var(--green-soft); }
.brecon-proof-row.sub { background: var(--red-soft); }
.brecon-proof-row.total { background: var(--brand-50); font-weight: 650; }
.brecon-proof-row.actual { background: var(--surface-2); }
.brecon-proof-row.balanced { background: var(--green-soft); }
.brecon-proof-row.balanced b { color: #077a63; }
.brecon-proof-row.unbalanced { background: var(--amber-soft); }
.brecon-proof-row.unbalanced b { color: #9c6407; }

.brecon-recon-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.brecon-recon-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.brecon-recon-box > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 11px; font-weight: 650; color: var(--ink-2);
}
.brecon-recon-box > header b { font-size: 10px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; }
.brecon-recon-box .table { margin: 0; }
.brecon-recon-box td { padding: 7px 10px; font-size: 10.5px; vertical-align: top; }
.brecon-recon-box th { font-size: 9.5px; }
.brecon-recon-box .num { text-align: end; }
.brecon-recon-foot {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 26px;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
}
.brecon-recon-foot > div { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--muted); }
.brecon-recon-foot b { font-size: 12px; color: var(--ink-2); }
.brecon-recon-foot .sign-line { flex: 1; min-width: 140px; gap: 14px; }
.brecon-recon-foot .sign-line i { display: block; border-bottom: 1px solid var(--line-strong); height: 18px; }

/* ---- Activity trail ------------------------------------------------------ */
.brecon-audit { display: flex; flex-direction: column; }
.brecon-audit-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.brecon-audit-row:last-child { border-bottom: 0; }
.brecon-audit-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--brand-200); box-shadow: 0 0 0 3px var(--brand-50); }
.brecon-audit-dot.strong { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.brecon-audit-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brecon-audit-main strong { font-size: 11.5px; color: var(--ink-2); }
.brecon-audit-main span { font-size: 10.5px; color: var(--muted); overflow-wrap: anywhere; }
.brecon-audit-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 10px; color: var(--muted-2); white-space: nowrap; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 1100px) {
  .brecon-grid { grid-template-columns: 1fr; }
  .brecon-import-card { position: static; }
  .brecon-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .brecon-statement-hero { grid-template-columns: auto minmax(0, 1fr); }
  .brecon-proof-mini { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; justify-content: space-between; }
  .brecon-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brecon-recon-cols { grid-template-columns: 1fr; }
  .brecon-match-cell { min-width: 230px; }
  .brecon-toolbar { align-items: stretch; }
  .brecon-search { width: 100%; }
  .brecon-search .input { width: 100%; min-width: 0; }
  .brecon-tabs { overflow-x: auto; }
  .brecon-tab { white-space: nowrap; }
}

/* ---- Print: a clean reconciliation sheet -------------------------------- */
@media print {
  body:has(.bankrec-app) .context-bar,
  body:has(.bankrec-app) .crumb-bar,
  body:has(.bankrec-app) .global-progress,
  body:has(.bankrec-app) .bottom-nav { display: none !important; }
  .bankrec-statement .no-print,
  .bankrec-statement .page-actions,
  .bankrec-statement .brecon-toolbar,
  .bankrec-statement .brecon-sugs,
  .bankrec-statement .brecon-x,
  .bankrec-statement .brecon-under,
  .bankrec-statement .brecon-partial { display: none !important; }
  .bankrec-statement .brecon-pane[hidden] { display: block !important; }
  .bankrec-statement .brecon-pane[data-pane="audit"] { display: none !important; }
  .bankrec-statement .brecon-pane { padding: 0; }
  .bankrec-statement .brecon-recon-sign { display: none !important; }
  .bankrec-statement .card { border: 1px solid #d8dbe6; box-shadow: none; break-inside: avoid; }
  .bankrec-statement .brecon-statement-hero { border: 1px solid #d8dbe6; background: #fff; break-inside: avoid; }
  .brecon-proof, .brecon-tiles, .brecon-recon-cols { break-inside: avoid; }
  .bankrec-statement .brecon-recon { break-before: page; }
  .bankrec-statement .brecon-tab span { display: none; }
  .bankrec-statement .brecon-tabs { border-bottom: 1px solid #d8dbe6; }
  .bankrec-statement .brecon-tab { color: #333; }
  .bankrec-statement .brecon-tab:not(.active) { display: none; }
  .brecon-line { break-inside: avoid; }
}

/* ---- v3 controls: aging, classification, exceptions, fees --------------- */
.brecon-aging { margin: 0 0 18px; padding: 16px 18px; }
.brecon-aging-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brecon-aging-head h3 { margin: 0 0 2px; font-size: 15px; }
.brecon-aging-buckets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.brecon-aging-cell { border: 1px solid var(--line, #e3e6ef); border-radius: 10px; padding: 8px 10px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.brecon-aging-cell.empty { opacity: .55; }
.brecon-aging-cell .k { font-size: 11px; color: var(--muted, #7a8194); }
.brecon-aging-cell b { font-size: 18px; font-variant-numeric: tabular-nums; }
.brecon-aging-cell small { font-size: 11px; color: var(--muted, #7a8194); }
.brecon-cat { margin-top: 4px; }
.brecon-age { margin-top: 4px; line-height: 1.5; }
.brecon-exc { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.brecon-line-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.brecon-line-tools .btn { padding: 3px 8px; font-size: 12px; }
.brecon-events { margin-top: 16px; border-top: 1px dashed var(--line, #e3e6ef); padding-top: 12px; }
.brecon-events h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted, #7a8194); }
.brecon-event { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; }
.brecon-event-act { font-weight: 600; }
.brecon-event-reason { color: var(--ink-2, #4a5164); }
.brecon-fees { padding: 14px 4px; }
.brecon-fees table { width: 100%; }
.brecon-fee-amount { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, #f6f7fb); }
.brecon-fee-amount b { font-size: 18px; }
.brecon-row-actions { white-space: nowrap; text-align: end; }
.brecon-exc-table { max-height: 55vh; overflow: auto; }
@media (max-width: 760px) {
  .brecon-aging-buckets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
