.bankbook-modern-container.bankbook-compact {
  max-width: none;
  padding: 4px 0 12px;
}

.bankbook-compact .bankbook-page-header {
  margin-bottom: 5px;
}

.bankbook-compact .bankbook-grid-full > .bb-card {
  padding: 7px 8px 8px;
}

.bankbook-compact .bb-transactions-toolbar {
  justify-content: flex-start;
  gap: 5px 8px;
  margin-bottom: 6px;
}

.bankbook-compact .bb-select-account-wrap {
  flex: 1 1 250px;
  min-width: min(100%, 225px);
  max-width: 390px;
}

.bankbook-compact .bb-date-filter-wrap,
.bankbook-compact .bb-ledger-exports {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.bankbook-compact .bb-ledger-exports { margin-inline-start: auto; }
.bankbook-compact .bb-date-filter-wrap > label { display: grid; gap: 2px; margin: 0; }
.bankbook-compact .bb-transactions-toolbar label { font-size: 0.75rem; line-height: 1.25; color: #334155; font-weight: 600; }
.bankbook-compact .bb-select-account-wrap label { margin-bottom: 2px; }
.bankbook-compact .bb-date-filter-wrap input { width: 136px; }

.bankbook-compact :is(.bankbook-page-header, .bb-transactions-toolbar) .bb-btn-ghost,
.bankbook-compact .bb-transactions-toolbar .bb-select {
  box-sizing: border-box;
  min-height: 30px;
  height: 30px;
  padding: 3px 8px;
  white-space: nowrap;
}

.bankbook-compact .bb-table-wrapper {
  --bb-header-height: 28px;
  min-height: 0;
  max-height: max(230px, calc(100dvh - 230px));
  border-color: #cbd7e6;
  border-radius: 5px;
}

.bankbook-compact .bb-table {
  table-layout: fixed;
  min-width: 1200px;
}

.bankbook-compact.cashbook-compact .bb-table { min-width: 1100px; }
.bankbook-compact.cashbook-compact .bb-order-column { width: 30px; }

.bankbook-compact .bb-table :is(th, td) {
  box-sizing: border-box;
  border-right: 1px solid #d7e0ec;
  border-bottom: 1px solid #d7e0ec;
  padding: 3px 6px !important;
  line-height: 1.25;
}

.bankbook-compact .bb-table :is(th, td):last-child { border-right: 0; }

.bankbook-compact .bb-table thead th {
  height: var(--bb-header-height);
  background: #e8eff7;
  color: #284360;
  font-size: 0.6875rem;
  box-shadow: none;
}

.bankbook-compact .bb-table .bb-order-column { width: 56px; }
.bankbook-compact .bb-table .bb-date-column { width: 120px; }
.bankbook-compact .bb-table .bb-type-column { width: 121px; }
.bankbook-compact .bb-table .bb-purpose-column { width: 126px; }
.bankbook-compact .bb-table .bb-reference-column { width: 140px; }
.bankbook-compact .bb-table .bb-amount-col { width: 107px; }
.bankbook-compact .bb-table .bb-balance-column { width: 124px; }
.bankbook-compact .bb-table .bb-actions-column { width: 170px; }

.bankbook-compact .bb-entry-row td {
  top: var(--bb-header-height);
  background: #f1f6fc;
  border-top: 0;
  border-bottom: 1px solid #a7bbd5;
  box-shadow: none;
}

.bankbook-compact .bb-entry-row .bb-inline-input { height: 26px; }

.bankbook-compact .bb-table tbody tr.bb-transaction-row td {
  height: 29px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.bankbook-compact .bb-transaction-row:nth-child(odd) td { background: #f6f8fc; }
.bankbook-compact .bb-table tbody tr.bb-transaction-row:hover td { background: #eaf2ff; }

.bankbook-compact .bb-table .bb-table-grip { text-align: center; padding-inline: 3px !important; }
.bankbook-compact .bb-move-controls { flex-direction: row; justify-content: center; gap: 3px; }
.bankbook-compact .bb-move-btn { width: 21px; height: 24px; min-height: 24px; }
.bankbook-compact .bb-row-actions > button { min-height: 22px; padding: 2px 5px; }
.bankbook-compact .bb-entry-row .bb-row-actions { flex-wrap: wrap; }
.bankbook-compact .bb-reference-cell { overflow: hidden; text-overflow: ellipsis; }

.bankbook-compact .bb-particulars-link {
  display: block;
  width: 100%;
  min-height: 24px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.bankbook-compact .bb-summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  width: auto;
  padding: 5px 8px;
}

.bankbook-compact .bb-summary-card .bb-summary-row {
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.75rem;
}

.bankbook-compact .bb-summary-row strong { font-size: 0.8125rem; }

.transaction-links-dialog[open] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #172c40;
  overflow: hidden;
}
.transaction-links-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: #173f5f;
  color: #fff;
}
.transaction-links-header h2 { margin: 0 0 3px; color: inherit; font-size: 1rem; }
.transaction-links-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.transaction-links-body { flex: 1; overflow: auto; padding: 10px 16px; font-size: .8125rem; }
.transaction-links-body :is(h3,h4) { margin: 10px 0 6px; font-size: .875rem; }
.transaction-links-body p { margin: 6px 0; }
.transaction-links-summary {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  background: #f2f6fa;
  border: 1px solid #d5e1ed;
}
.transaction-links-summary dt { color: #52657d; font-size: .6875rem; font-weight: 700; }
.transaction-links-summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.transaction-link-grid { overflow: auto; max-height: 55dvh; border: 1px solid #cbd7e6; margin-bottom: 8px; }
.transaction-link-grid > table { width: 100%; min-width: 26rem; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .75rem; }
.transaction-link-grid :is(th,td) {
  box-sizing: border-box;
  height: 30px;
  padding: 2px 6px;
  border-right: 1px solid #d7e0ec;
  border-bottom: 1px solid #d7e0ec;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.transaction-link-grid thead th { position: sticky; top: 0; z-index: 1; text-align: left; background: #e8eff7; color: #284360; }
.transaction-link-grid :is(th,td):last-child { border-right: 0; }
.transaction-link-grid tbody tr:nth-child(even) td { background: #f6f8fc; }
.transaction-link-grid tbody tr:hover td { background: #eaf2ff; }
.transaction-link-grid tfoot :is(td,th) { background: #ecf2f9; font-weight: 700; }
.transaction-link-grid .transaction-link-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transaction-link-bills > table { min-width: 48rem; }
.transaction-link-review > table { min-width: 76rem; }
.transaction-link-bills th.transaction-link-action { width: 4.75rem; }
.transaction-link-bills th.transaction-link-vendor { width: 19%; }
.transaction-link-bills th.transaction-link-category { width: 12%; }
.transaction-link-bills th.transaction-link-invoice { width: 9.5rem; }
.transaction-link-bills th.transaction-link-date { width: 5.5rem; }
.transaction-link-bills th.transaction-link-number { width: 7rem; }
.transaction-link-bills th.transaction-link-file { width: 4.25rem; }
.transaction-link-bills th.transaction-link-receipt { width: 7rem; }
.transaction-link-review th.transaction-link-action { width: 5rem; }
.transaction-link-review th.transaction-link-voucher { width: 5rem; }
.transaction-link-review th.transaction-link-vendor { width: 11%; }
.transaction-link-review th:is(.transaction-link-category,.transaction-link-invoice) { width: auto; }
.transaction-link-review th.transaction-link-tax { width: 5.25rem; }
.transaction-link-grid button.secondary.small { min-height: 24px; padding: 0 6px; white-space: nowrap; }
.transaction-link-row-actions { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.transaction-link-grid .file-link-actions.compact-file-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  width: max-content;
  vertical-align: middle;
}
.transaction-link-grid .compact-file-actions :is(.link-button,.file-download-button) {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  margin: 0;
}
.transaction-link-grid input[type='checkbox'] { height: 16px; width: 16px; min-height: 0; margin: 0; padding: 0; vertical-align: middle; }
.transaction-links-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.transaction-links-filters input { max-width: 25rem; }
.transaction-links-filters select { width: auto; }
.transaction-link-error { color: #9f2029; }
.transaction-links-body > .transaction-link-error { position: sticky; top: 0; z-index: 2; padding: 6px 8px; background: #fff1f2; }
@media (max-width: 750px) {
  .transaction-links-header { flex-wrap: wrap; }
  .transaction-links-summary { grid-template-columns: 1fr; }
  /* The app's mobile table and button rules use important declarations. */
  .transaction-link-grid :is(th,td) { padding: 2px 6px !important; }
  .transaction-link-grid button.secondary.small { min-height: 24px !important; padding: 0 6px !important; }
}

