.erp-page {
  min-height: 100%;
  padding: 22px clamp(14px, 2vw, 28px);
  background: #f5f7fb;
  color: #0f172a;
}

.erp-toolbar {
  position: sticky;
  top: 10px;
  z-index: 1050;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 24px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .06);
}

.erp-toolbar .d-flex.align-items-center > i {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-inline-end: 12px !important;
  color: #fff !important;
  background: linear-gradient(135deg, #334155, #64748b);
  border-radius: 16px;
}

.erp-toolbar h5 {
  color: #111827;
  font-size: 1.18rem;
  font-weight: 900 !important;
}

.erp-toolbar small {
  color: #64748b !important;
  font-weight: 700;
}

.erp-toolbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-right: 6px;
  flex-wrap: wrap;
}

.erp-toolbar .form-control,
.erp-toolbar .form-select {
  min-height: 44px;
  border-radius: 14px;
  border-color: #dbe3ef;
  font-weight: 700;
}

.erp-toolbar .btn {
  min-height: 42px;
  border-radius: 14px;
  font-weight: 800;
}

.erp-table-card {
  margin-top: 16px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 24px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .05);
  overflow: hidden;
}

.erp-table-container {
  height: calc(100vh - 285px);
  overflow: auto;
  background: #fff;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.table {
  --bs-table-hover-bg: #f8fbff;
}

table.dataTable tbody tr:hover {
  background-color: #f8fbff;
  transition: .15s;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #475569;
  background: #f8fafc !important;
  border-color: rgba(148, 163, 184, .18) !important;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
  vertical-align: middle;
}

.table tbody td {
  padding: 13px 12px;
  border-color: rgba(148, 163, 184, .14) !important;
  vertical-align: middle;
}

.table tbody td:nth-child(2) {
  color: #111827;
  font-weight: 900;
}

.table tbody td.text-end {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.voucher-list-actions {
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.voucher-list-actions .btn {
  min-height: 34px;
  margin: 0 !important;
  border-radius: 12px;
  font-weight: 800;
}

.dataTables_length,
.dataTables_paginate {
  padding: 8px 10px;
  color: #64748b;
  font-weight: 700;
}

.dataTables_length select {
  border-radius: 10px;
  border-color: #dbe3ef;
}

.pagination .page-link {
  border-radius: 10px;
  margin-inline: 2px;
}

.erp-summary-bar {
  position: sticky;
  bottom: 0;
  z-index: 1050;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 24px;
  box-shadow: 0 -12px 34px rgba(15, 23, 42, .07);
}

.erp-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.erp-summary-card {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.erp-summary-card .label {
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
}

.erp-summary-card .value {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .2px;
}

@media (max-width: 992px) {
  .erp-toolbar {
    position: static;
  }

  .erp-toolbar-actions {
    justify-content: flex-start;
  }

  .erp-table-container {
    height: auto;
    max-height: 62vh;
  }

  .erp-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .erp-page {
    padding: 12px;
  }

  .erp-summary-grid {
    grid-template-columns: 1fr;
  }

  .erp-toolbar .btn:not(.icon-btn) {
    width: 100%;
  }

  .erp-toolbar-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .erp-toolbar-actions a.btn {
    grid-column: span 3;
  }
}

.voucher-select-cell {
  width: 42px;
}

.voucher-entry-loading,
.voucher-entry-error {
  margin: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.voucher-entry-loading {
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.voucher-entry-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.voucher-entry-preview {
  margin: 10px 8px 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, .08);
}

.voucher-entry-head {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf6;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.voucher-entry-head strong {
  margin-inline: 8px;
  color: #0f172a;
}

.voucher-entry-head small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.voucher-entry-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.chip-preview {
  color: #92400e;
  background: #fef3c7;
}

.chip-posted {
  color: #166534;
  background: #dcfce7;
}

.voucher-entry-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.voucher-entry-totals span {
  display: inline-flex;
  min-width: 118px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  gap: 6px;
  justify-content: space-between;
}

.voucher-entry-table-wrap {
  overflow-x: auto;
}

.voucher-entry-table {
  min-width: 850px;
}

.voucher-entry-table thead th {
  color: #475569;
  background: #eef6ff;
  border-color: #dbeafe;
  font-size: 12px;
}

.voucher-entry-table td {
  border-color: #e8eef6;
  vertical-align: middle;
}

.voucher-entry-table .account-code {
  color: #1d4ed8;
  direction: ltr;
}

tr.shown > td {
  background: #f8fbff !important;
}

@media (max-width: 768px) {
  .voucher-entry-head {
    align-items: stretch;
    flex-direction: column;
  }

  .voucher-entry-totals {
    justify-content: stretch;
  }

  .voucher-entry-totals span {
    flex: 1 1 140px;
  }
}
.voucher-select-cell {
  cursor: pointer;
}

#journalTable tbody tr.voucher-row-selected > td {
  background: #e8f2ff !important;
  box-shadow: inset 0 1px #b9d8ff, inset 0 -1px #b9d8ff;
}

#journalTable tbody tr.voucher-row-selected > td:first-child {
  box-shadow: inset 3px 0 #2479d3, inset 0 1px #b9d8ff, inset 0 -1px #b9d8ff;
}

.voucher-selected-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-inline-start: 5px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #795000;
  background: rgba(255, 255, 255, .72);
  font-size: .75rem;
  font-weight: 950;
}

#bulkPostBtn:disabled,
#bulkApproveBtn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
