#bank-invoice-panel{margin-bottom:20px}.bi-header,.bi-actions,.bi-period-line,.bi-coverage,.bi-linked-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.bi-actions{justify-content:flex-start}.bi-actions label,.bi-credit-form label,.bi-fields label,.bi-review-form>label,.bi-link-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;min-width:0}.bi-actions select,.bi-actions input,.bi-credit-form input,.bi-fields input,.bi-fields select,.bi-review-form textarea,.bi-review-form>label input,.bi-review-form fieldset>label select,.bi-link-form select,.bi-bank-filter select{border:1px solid #ccd4db;border-radius:7px;padding:9px;background:var(--card-bg,#fff);color:var(--text,#1f2937);max-width:100%;font:inherit}.bi-period-line{font-size:13px;margin-bottom:15px;color:#526174}.bi-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.bi-kpis>div{padding:18px;border:1px solid #dce3ea;border-radius:10px;background:#f8fafc;display:flex;flex-direction:column;gap:12px}.bi-kpis span{font-size:12px;color:#465467}.bi-kpis strong{font-size:clamp(20px,2.1vw,29px);line-height:1.2;color:#1e293b;font-variant-numeric:tabular-nums}.bi-kpis .bi-payable{background:#fff8ed;border-color:#f3d3a0}.bi-kpis .bi-credit{background:#f0f9f5;border-color:#bddfcf}.bi-coverage{justify-content:flex-start;font-size:12px;margin-top:16px;color:#586678}.bi-coverage span{padding:5px 9px;border-radius:5px;background:#f1f4f7}.bi-estimate-note,.bi-field-help{font-size:12px;line-height:1.6;color:#617083}.bi-help{margin:18px 0;border-top:1px solid #e1e6ec;padding-top:14px}.bi-help p{font-size:13px;line-height:1.6}.bi-help summary,.bi-register summary{cursor:pointer;font-weight:600}.bi-credit-form{display:grid;grid-template-columns:1fr 1.5fr auto;align-items:end;gap:12px}.bi-register-toolbar{margin:16px 0}.bi-doc-table{width:100%;border-collapse:collapse;min-width:690px}.bi-doc-table td,.bi-doc-table th{padding:12px 9px;text-align:left;border-bottom:1px solid #e6eaf0;font-size:13px}.bi-doc-table small{display:block;color:#6b7280;margin-top:5px}.bi-badge{display:inline-block;padding:5px 8px;border-radius:6px;font-size:11px;line-height:1.5;font-weight:600;white-space:normal}.bi-missing,.bi-draft{background:#fff2d9;color:#855107}.bi-confirmed{background:#e9f7ee;color:#216442}.bi-void{background:#edf0f3;color:#687383}.bi-bank-cell{min-width:162px;max-width:220px}.bi-bank-cell .btn{display:block;margin-top:7px;font-size:12px}.bi-bank-filter{display:flex;gap:8px;align-items:center}.bi-notice{padding:12px 14px;background:#edf5ff;color:#254667;border:1px solid #d2e3f7;border-radius:8px;margin:0 0 16px;font-size:13px;line-height:1.55;white-space:pre-line}.bi-notice[hidden]{display:none}.bi-error{color:#923629;background:#fff0ec;border-color:#f1c6bc}#bi-dialog{width:min(1220px,95vw);max-width:95vw;max-height:92dvh;border:1px solid #d7dee6;border-radius:14px;padding:24px;background:#fff;color:#243244;box-shadow:0 20px 80px #0005}#bi-dialog::backdrop{background:#162231a6}.bi-dialog-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px}.bi-dialog-header h2{font-size:21px;margin:0}.bi-review-layout{display:grid;grid-template-columns:minmax(260px,.85fr) minmax(400px,1.3fr);gap:24px}.bi-preview{min-width:0;align-self:start;position:sticky;top:0}.bi-preview iframe{width:100%;height:65vh;border:1px solid #d5dce5;border-radius:8px;margin-top:10px}.bi-preview img{width:100%;height:auto;max-height:65vh;object-fit:contain;margin-top:10px}.bi-preview p{overflow-wrap:anywhere;font-size:12px;color:#6b7280}.bi-review-form{min-width:0;display:flex;flex-direction:column;gap:14px}.bi-review-form fieldset{border:1px solid #dce3ea;border-radius:8px;padding:14px;min-width:0}.bi-review-form legend{font-size:13px;font-weight:650;padding:0 6px}.bi-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.bi-totals{grid-template-columns:repeat(3,minmax(0,1fr));margin:15px 0}.bi-review-form input,.bi-review-form select,.bi-review-form textarea{box-sizing:border-box;width:100%}.bi-review-form .bi-check{display:flex;flex-direction:row;align-items:flex-start;font-size:12px;line-height:1.6;padding:12px;background:#f6f8fb;border-radius:8px}.bi-check input{width:18px;min-width:18px;height:18px;flex-shrink:0;margin-top:2px}.bi-tax-table{width:100%;min-width:430px;border-collapse:collapse;margin-bottom:10px}.bi-tax-table th{font-size:11px;text-align:left}.bi-tax-table td{padding:5px 4px}.bi-tax-table input{min-width:65px;border:1px solid #ccd4db;border-radius:5px;padding:8px;font-size:13px}.bi-tax-table td:last-child{width:30px}.bi-review-actions{display:flex;gap:9px;flex-wrap:wrap;padding:12px 0}.bi-review-actions button{font-size:12px}.bi-upload{border:2px dashed #b8cce1;background:#f8fbff;border-radius:10px;padding:20px;margin:18px 0}.bi-file-label{font-weight:600;display:flex;flex-direction:column;gap:14px}.bi-file-label input{max-width:100%}.bi-upload p,.bi-bank-context p{font-size:13px;color:#627286;line-height:1.6}.bi-bank-context{background:#f4f6f8;border-radius:8px;padding:12px;font-size:13px}.bi-linked-row{border-bottom:1px solid #e5eaf0;padding:12px 0;justify-content:flex-start}.bi-linked-row span{flex:1;min-width:150px}.bi-link-form{display:flex;gap:10px;align-items:end}.bi-link-form label{flex:1}#bi-dialog button:disabled{opacity:.55;cursor:wait}#bi-events p{font-size:12px;border-bottom:1px solid #e5eaf0;padding-bottom:8px}
@media(max-width:850px){.bi-kpis{grid-template-columns:1fr 1fr}.bi-credit-form{grid-template-columns:1fr}.bi-review-layout{grid-template-columns:1fr}.bi-preview{position:static}.bi-preview iframe{height:300px}.bi-preview img{max-height:350px}.bi-header{align-items:flex-start}#bi-dialog{padding:16px}.bi-link-form{flex-wrap:wrap}}@media(max-width:480px){.bi-fields{grid-template-columns:1fr}.bi-totals{grid-template-columns:1fr}.bi-kpis>div{padding:12px}.bi-kpis strong{font-size:21px}.bi-actions{gap:9px}.bi-actions label{width:100%}.bi-actions .btn{font-size:12px}.bi-dialog-header h2{font-size:18px}.bi-review-actions .btn{width:100%}}
/* Match the app's dark surfaces and keep the invoice action visible while scrolling. */
#bank-invoice-panel .bi-period-line,#bank-invoice-panel .bi-estimate-note,#bank-invoice-panel .bi-doc-table small{color:var(--text-muted,#bfbfbf)}
#bank-invoice-panel .bi-help{border-color:var(--border-subtle,#3a3a3a)}
#bi-dialog{background:var(--bg-elevated,#262626);color:var(--text-main,#fff)}
#bi-dialog .bi-dialog-header{position:sticky;top:-24px;background:var(--bg-elevated,#262626);z-index:4;padding:12px 0;border-bottom:1px solid var(--border-subtle,#3a3a3a)}
#bi-dialog .bi-bank-context,#bi-dialog .bi-check{background:var(--bg-elevated-soft,#2e2e2e)}
#bi-dialog .bi-field-help,#bi-dialog .bi-preview p,#bi-dialog .bi-bank-context p{color:var(--text-muted,#bfbfbf)}
#bi-dialog fieldset{border-color:var(--border-subtle,#444)}
#bi-dialog .bi-upload{color:#213642}#bi-dialog #bi-file{color:#213642}
#bi-dialog .bi-review-form>label input{background:var(--bg-elevated-soft,#2e2e2e);color:var(--text-main,#fff)}
/* Override the legacy two-column rule, which is marked !important in styles.css. */
#view-bank-expenses .statistics-bank-grid{grid-template-columns:minmax(0,1fr) !important}
#view-bank-expenses .statistics-bank-table-card{order:0}
#view-bank-expenses .statistics-bank-entry-card{order:1}
#view-bank-expenses .statistics-bank-table-wrap{max-height:540px;overflow:auto}
#view-bank-expenses .statistics-bank-table{min-width:1440px;table-layout:fixed}
#view-bank-expenses .statistics-bank-table th:last-child,#view-bank-expenses .bi-bank-cell{position:sticky;right:0;z-index:1;width:180px;background:var(--bg-elevated,#262626);box-shadow:-3px 0 8px #0002}
#view-bank-expenses .statistics-bank-table thead th{position:sticky;top:0;background:var(--bg-elevated,#262626);z-index:2}
#view-bank-expenses .statistics-bank-table thead th:last-child{z-index:3}
#bank-invoice-panel .bi-register>.table-wrapper{max-height:420px;overflow:auto}
@media(max-width:850px){#bi-dialog .bi-dialog-header{top:-16px}}

/* A full-width ledger, followed by the import form. Keep filter controls on their own rows. */
#view-bank-expenses .statistics-bank-grid > .card {
  height: auto;
  width: 100%;
  min-width: 0;
}
#view-bank-expenses .statistics-bank-table-card > .card-header {
  align-items: center;
  flex-wrap: wrap;
}
#view-bank-expenses .statistics-bank-summary { white-space: normal; }
#view-bank-expenses .statistics-bank-kpis {
  grid-template-columns: repeat(4,minmax(0,1fr));
}
#view-bank-expenses .statistics-bank-kpi strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: clamp(1.1rem,1.45vw,1.4rem);
}
#view-bank-expenses .statistics-bank-filters {
  grid-template-columns: minmax(0,1.5fr) repeat(3,minmax(0,1fr));
  align-items: end;
}
#view-bank-expenses .statistics-bank-filters > label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
#view-bank-expenses .statistics-bank-filter-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}
#view-bank-expenses .statistics-bank-table th,
#view-bank-expenses .statistics-bank-table td { padding: 12px 10px; }
#view-bank-expenses .statistics-bank-table th:nth-child(1),
#view-bank-expenses .statistics-bank-table td:nth-child(1) { width: 104px; }
#view-bank-expenses .statistics-bank-table th:nth-child(2),
#view-bank-expenses .statistics-bank-table td:nth-child(2) { width: 142px; }
#view-bank-expenses .statistics-bank-table th:nth-child(3),
#view-bank-expenses .statistics-bank-table td:nth-child(3) { width: auto; overflow-wrap: anywhere; }
#view-bank-expenses .statistics-bank-table th:nth-child(4),
#view-bank-expenses .statistics-bank-table td:nth-child(4) { width: 210px; }
#view-bank-expenses .statistics-bank-table th:nth-child(5),
#view-bank-expenses .statistics-bank-table td:nth-child(5) { width: 166px; }
#view-bank-expenses .statistics-bank-table th:nth-child(6),
#view-bank-expenses .statistics-bank-table td:nth-child(6) { width: 128px; }
#view-bank-expenses .statistics-bank-table th:nth-child(7),
#view-bank-expenses .statistics-bank-table td:nth-child(7) { width: 140px; }
#view-bank-expenses .statistics-bank-table th:nth-child(8),
#view-bank-expenses .statistics-bank-table td:nth-child(8) { width: 76px; }
#view-bank-expenses .statistics-bank-table th:nth-child(9),
#view-bank-expenses .statistics-bank-table td:nth-child(9) { width: 184px; }
#view-bank-expenses .statistics-bank-status-pill {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
@media(max-width:1100px) {
  #view-bank-expenses .statistics-bank-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #view-bank-expenses .statistics-bank-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:540px) {
  #view-bank-expenses .statistics-bank-filters { grid-template-columns: minmax(0,1fr); }
  #view-bank-expenses .statistics-bank-filter-actions .btn { flex: 1 1 100%; white-space: normal; }
  #view-bank-expenses .statistics-bank-kpi { padding: 12px; }
  #view-bank-expenses .statistics-bank-kpi strong { font-size: 1rem; }
}
