.bank-statement-page {
  min-width: 0;
  font-size: 12px;
}

.bank-statement-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.bank-statement-toolbar button,
.bank-statement-toolbar select,
.bank-statement-toolbar input,
.statement-pagination button,
.statement-pagination select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 7px 11px;
}

.bank-statement-toolbar button {
  cursor: pointer;
}

.bank-statement-toolbar button:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.bank-statement-toolbar button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.bank-statement-toolbar .statement-search {
  display: flex;
  min-width: min(100%, 390px);
  margin-left: auto;
}

.statement-search select {
  border-radius: 7px 0 0 7px;
}

.statement-search input {
  min-width: 0;
  flex: 1;
  border-radius: 0;
}

.statement-search button {
  border-radius: 0 7px 7px 0;
}

.statement-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 14px;
  color: #db5b1c;
  font-weight: 750;
}

.statement-balance small {
  color: var(--muted);
  font-weight: 500;
}

.statement-balance .statement-action {
  color: var(--green);
}

.statement-table-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.statement-table-help strong {
  color: var(--green);
  font-weight: 700;
}

.statement-table-scroll {
  width: 100%;
  max-height: max(320px, calc(100dvh - 270px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.statement-table {
  width: 1638px;
  min-width: 1638px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  white-space: normal;
}

.statement-table th,
.statement-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  vertical-align: middle;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.statement-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f4f8f6;
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.statement-table tbody tr {
  cursor: default;
}

.statement-table tbody tr:hover td {
  background: #f7faf8;
}

.statement-table th:first-child,
.statement-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
}

.statement-table th:nth-child(2),
.statement-table td:nth-child(2) {
  position: sticky;
  left: 38px;
  z-index: 4;
  box-shadow: 7px 0 10px -10px rgba(9, 58, 48, .55);
}

.statement-table th:last-child,
.statement-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  box-shadow: -7px 0 10px -10px rgba(9, 58, 48, .55);
}

.statement-table th:first-child,
.statement-table th:nth-child(2),
.statement-table th:last-child {
  z-index: 6;
  background: #eef5f1;
}

.statement-table td:nth-child(2),
.statement-table td:nth-child(3),
.statement-table td:nth-child(4),
.statement-table td:nth-child(5),
.statement-table td:nth-child(8),
.statement-table td:nth-child(10),
.statement-table td:nth-child(12) {
  white-space: nowrap;
}

.statement-table td:nth-child(6),
.statement-table td:nth-child(7) {
  line-height: 1.55;
}

.statement-id-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.statement-id-wrap strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.statement-copy-button {
  flex: 0 0 auto;
  min-height: 24px;
  border: 0;
  border-radius: 4px;
  background: #21b868;
  color: #fff;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.statement-copy-button:hover,
.statement-copy-button:focus-visible {
  background: #139856;
}

.statement-copy-button:focus-visible {
  outline: 2px solid #82d7ad;
  outline-offset: 2px;
}

.statement-copy-toast {
  position: fixed;
  top: 14px;
  left: calc(50% + 124px);
  z-index: 80;
  display: flex;
  align-items: stretch;
  width: min(280px, calc(100vw - 32px));
  min-height: 52px;
  border: 1px solid #dce5e0;
  background: #fff;
  color: #5f6864;
  box-shadow: 0 4px 14px rgba(22, 48, 40, .18);
  opacity: 0;
  transform: translate(-50%, -8px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.statement-copy-toast[hidden] {
  display: none;
}

.statement-copy-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.statement-copy-toast-icon {
  display: grid;
  place-items: center;
  width: 48px;
  flex: 0 0 48px;
  background: #32c875;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.statement-copy-toast [data-statement-copy-message] {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.statement-table input[type=checkbox] {
  width: 16px;
  height: 16px;
}

.statement-amount {
  font-weight: 750;
  white-space: nowrap;
}

.statement-amount.incoming {
  color: var(--green);
}

.statement-amount.outgoing {
  color: #a74339;
}

.statement-description {
  line-height: 1.55;
}

.statement-muted {
  color: var(--muted);
}

.statement-action {
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 5px 8px;
  cursor: pointer;
  font-size: 11px;
}

.statement-action:hover {
  border-color: var(--green);
  color: var(--green);
}

.statement-manual-description {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statement-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 0;
}

.statement-pagination span {
  color: var(--muted);
}

.bank-statement-dialog {
  width: min(94vw, 620px);
  max-height: 88vh;
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 24px 70px #0b2a2440;
  color: var(--ink);
}

.bank-statement-dialog::backdrop {
  background: #10251f99;
}

.bank-statement-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.bank-statement-dialog header h2 {
  margin: 0;
  font-size: 16px;
}

.bank-statement-dialog header button {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.bank-statement-dialog form,
.bank-statement-dialog .statement-dialog-body {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.bank-statement-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.bank-statement-dialog input,
.bank-statement-dialog select,
.bank-statement-dialog textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.bank-statement-dialog textarea {
  min-height: 120px;
  resize: vertical;
}

.statement-dialog-note,
.statement-dialog-error,
.statement-dialog-success {
  margin: 0;
  padding: 12px;
  border-radius: 9px;
  line-height: 1.65;
}

.statement-dialog-note {
  background: #f3f8f5;
  color: var(--muted);
}

.statement-dialog-error {
  background: var(--red-bg);
  color: var(--red);
}

.statement-dialog-success {
  background: var(--mint);
  color: var(--green);
}

.statement-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.statement-dialog-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 17px;
  cursor: pointer;
  font: inherit;
}

.statement-dialog-actions button[type=submit] {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.statement-dialog-actions button:disabled {
  opacity: .5;
  cursor: wait;
}

@media (max-width: 1450px) {
  .bank-statement-toolbar .statement-search {
    order: 2;
    width: 100%;
    margin-left: 0;
  }

  .statement-table-scroll {
    max-height: max(300px, calc(100dvh - 315px));
  }
}

@media (max-width: 760px) {
  .statement-copy-toast {
    left: 50%;
  }

  .statement-table-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .statement-table-scroll {
    max-height: max(280px, calc(100dvh - 350px));
  }

  .bank-statement-dialog {
    width: 96vw;
  }
}
