.et-voucher-detail-grid-shell {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.et-voucher-detail-grid-toolbar {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-width: 0;
}

.et-voucher-detail-grid-toolbar > div {
  display: inline;
  gap: 0.15rem;
  min-width: 0;
}

.et-voucher-detail-grid-toolbar__actions {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.5rem;
}

.et-voucher-detail-grid-toolbar__actions .et-button--icon-only {
  min-height: 2.5rem;
  padding: 0;
  width: 2.5rem;
}

.et-voucher-detail-grid-toolbar__actions .et-button--danger {
  background: var(--et-danger);
  color: #fff;
}

.et-voucher-detail-grid-toolbar__actions .et-button--danger:hover {
  background: #b91c1c;
}

.et-voucher-detail-grid-toolbar strong {
  color: var(--et-text);
  font-size: 0.95rem;
  font-weight: 700;
}

.et-voucher-detail-grid-toolbar span {
  color: var(--et-text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.et-voucher-detail-empty {
  border: 1px dashed var(--et-border-strong);
  border-radius: 0.875rem;
  padding: 1rem;
}

.et-voucher-fast-grid {
  table-layout: fixed;
  width: 96.75rem;
  min-width: 96.75rem;
}

.et-voucher-fast-grid th,
.et-voucher-fast-grid td {
  padding: 0.35rem 0.4rem;
  white-space: nowrap;
}

.et-voucher-fast-grid td {
  overflow: visible;
}

.et-voucher-fast-grid .et-field {
  display: block;
}

.et-voucher-fast-grid .et-field__control,
.et-voucher-fast-grid .et-lookup {
  width: 100%;
}

.et-voucher-fast-grid .et-field__control {
  position: relative;
}

.et-voucher-fast-grid .et-field__help {
  display: none;
}

.et-voucher-fast-grid thead th {
  background: var(--et-surface-muted);
  position: sticky;
  top: 0;
  z-index: 2;
}

.et-voucher-fast-grid tfoot td {
  background: var(--et-surface-muted);
  border-top: 1px solid var(--et-border-strong);
  color: var(--et-text);
  font-weight: 700;
}

.et-voucher-fast-grid .et-field > label {
  display: none;
}

.et-voucher-fast-grid .et-input {
  border-radius: 0.35rem;
  min-height: 2rem;
  padding: 0.25rem 0.45rem;
  width: 100%;
}

.et-voucher-fast-grid .et-field--invalid .et-input {
  padding-inline-end: 1.55rem;
  padding-right: 1.55rem;
}

.et-voucher-fast-grid .et-field__validation-icon {
  font-size: 0.68rem;
  height: 1.15rem;
  inset-inline-end: 0.35rem;
  line-height: 1;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
}

.et-voucher-detail-skeleton {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
}

.et-voucher-detail-skeleton .et-skeleton-line {
  animation: et-skeleton-pulse 1.4s ease-in-out infinite;
  background: linear-gradient(90deg, var(--et-surface-muted, #f1f5f9) 0%, var(--et-primary-50, #eff6ff) 45%, var(--et-surface-muted, #f1f5f9) 100%);
  background-size: 220% 100%;
  border-radius: 0.4rem;
  min-height: 2.4rem;
}

.et-voucher-fast-grid .et-lookup__panel {
  min-width: 16rem;
  z-index: 80;
}

.et-voucher-fast-grid tbody tr:nth-last-child(-n + 2) .et-lookup__panel {
  bottom: calc(100% + 0.35rem);
  margin-bottom: 6px;
  margin-top: 0;
  top: auto;
}

.et-voucher-fast-grid .et-lookup__input {
  padding-inline-start: 1.45rem;
  padding-inline-end: 1.45rem;
}

.et-voucher-fast-grid .et-field__error {
  white-space: normal;
}

.et-voucher-fast-grid__row--invalid {
  background: var(--et-warning-soft);
}

.et-voucher-row-number {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.et-voucher-row-error {
  align-items: center;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  color: #b91c1c;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  height: 1.25rem;
  justify-content: center;
  width: 1.25rem;
}

.et-voucher-cell-error {
  color: #b91c1c;
  display: block;
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 0.25rem;
}

.et-voucher-grid-input {
  min-width: 0;
  width: 100%;
}

.et-voucher-grid-lookup {
  min-width: 0;
}

.et-voucher-col-actions {
  width: 5.25rem;
}

.et-voucher-col-reno {
  width: 4rem;
}

.et-voucher-col-paymethod {
  width: 8rem;
}

.et-voucher-col-target {
  width: 14rem;
}

.et-voucher-col-currency {
  width: 9rem;
}

.et-voucher-col-amount,
.et-voucher-col-rate,
.et-voucher-col-local {
  width: 8.5rem;
}

.et-voucher-col-reference {
  width: 10rem;
}

.et-voucher-col-description {
  width: 21rem;
}

.et-voucher-col-description .et-input {
  display: block;
  min-width: 100%;
}

.et-voucher-grid-actions-header {
  inset-inline-start: 0;
  position: sticky;
  z-index: 3;
}

.et-voucher-grid-actions {
  background: var(--et-surface);
  border-inline-end: 1px solid var(--et-border);
  inset-inline-start: 0;
  min-width: 5.25rem;
  position: sticky;
  text-align: center;
  z-index: 1;
}

.et-voucher-grid-actions__inner {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.et-voucher-grid-actions__inner .et-grid-action-button {
  align-items: center;
  display: inline-flex;
  height: 2.125rem;
  justify-content: center;
  min-width: 2.125rem;
  padding: 0;
  width: 2.125rem;
}

.et-voucher-grid-actions__inner .et-grid-action-button i {
  font-size: 0.88rem;
  line-height: 1;
}

.et-grid-action-button--danger {
  color: #b91c1c;
}

.et-grid-action-button--danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.et-voucher-detail-card-list {
  display: none;
}

.et-voucher-detail-card {
  background: var(--et-surface);
  border: 1px solid var(--et-border);
  border-radius: 0.875rem;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.875rem;
}

.et-voucher-detail-card--invalid {
  background: var(--et-warning-soft);
  border-color: var(--et-warning);
}

/* This file loads after app.css. Keep every fixed detail-grid surface semantic
   here as the final cascade authority for voucher, accounting, inventory and
   opening-balance grids. */
html.dark .et-detail-grid-scroll--fixed-1 > .et-voucher-fast-grid > thead > tr > th:nth-child(1),
html.dark .et-detail-grid-scroll--fixed-2 > .et-voucher-fast-grid > thead > tr > th:nth-child(1),
html.dark .et-detail-grid-scroll--fixed-2 > .et-voucher-fast-grid > thead > tr > th:nth-child(2),
html.dark .et-voucher-fast-grid > thead > tr > th.et-voucher-grid-actions-header {
  background: var(--et-surface-muted);
  border-color: var(--et-border-strong);
  color: var(--et-text-muted);
}

html.dark .et-detail-grid-scroll--fixed-1 > .et-voucher-fast-grid > tbody > tr > td:nth-child(1),
html.dark .et-detail-grid-scroll--fixed-2 > .et-voucher-fast-grid > tbody > tr > td:nth-child(1),
html.dark .et-detail-grid-scroll--fixed-2 > .et-voucher-fast-grid > tbody > tr > td:nth-child(2),
html.dark .et-voucher-fast-grid > tbody > tr > td.et-voucher-grid-actions {
  background: var(--et-surface);
  border-color: var(--et-border);
  color: var(--et-text);
}

html.dark .et-voucher-fast-grid > tfoot,
html.dark .et-voucher-fast-grid > tfoot > tr,
html.dark .et-voucher-fast-grid > tfoot > tr > td,
html.dark .et-detail-grid__footer,
html.dark .et-openbalance-summary-footer {
  background: var(--et-surface-muted);
  border-color: var(--et-border-strong);
  color: var(--et-text);
}

html.dark .et-openbalance-summary-card,
html.dark .et-voucher-summary-grid > div,
html.dark .et-salesbill__summary-item {
  background: var(--et-surface);
  border-color: var(--et-border);
  color: var(--et-text);
}

.et-voucher-detail-card header,
.et-voucher-detail-card footer {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  min-width: 0;
}

.et-voucher-detail-card header strong {
  color: var(--et-primary-strong);
  font-weight: 750;
}

.et-voucher-detail-card header span {
  color: var(--et-text-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.et-voucher-detail-card footer .et-grid-action-button {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  justify-content: center;
}

.et-voucher-detail-card-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.et-voucher-detail-card-grid label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.et-voucher-detail-card-grid label > span {
  color: var(--et-text-muted);
  font-size: 0.78rem;
  font-weight: 650;
}

@media (max-width: 767.98px) {
  .et-voucher-detail-grid-toolbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .et-voucher-detail-grid-toolbar__actions {
    justify-content: flex-end;
  }

  .et-voucher-detail-grid {
    display: none;
  }

  .et-voucher-detail-card-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
  }

  .et-voucher-detail-card footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .et-voucher-detail-card footer .et-grid-action-button {
    min-height: 2.5rem;
  }
}
