/* BB_DESIGN_2026 | Sneat V2 — Voucher edit (modal / ajax) */

body.bb-theme-v2 .view_modal .bb-sn-voucher-edit.modal-dialog,
body.bb-theme-v2 .bb-sn-voucher-edit.modal-dialog {
  max-width: min(920px, calc(100vw - 1.5rem));
  margin: 1rem auto;
}

body.bb-theme-v2 .bb-sn-voucher-edit .bb-sn-modal__content {
  border-radius: var(--bb-v2-radius-lg, 0.75rem);
  border: 1px solid var(--bb-v2-border, #e7e7ef);
  overflow: hidden;
}

body.bb-theme-v2 .bb-sn-voucher-edit__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--bb-v2-border, #e7e7ef);
  background: var(--bb-v2-surface, #fff);
}

body.bb-theme-v2 .bb-sn-voucher-edit__header-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit__header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.6rem;
  background: rgba(105, 108, 255, 0.14);
  color: #696cff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit__header-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--bb-v2-muted, #a1acb8);
  font-weight: 500;
}

body.bb-theme-v2 .bb-sn-voucher-edit__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--bb-v2-surface-2, #f5f5f9);
  max-height: min(78vh, 52rem);
  overflow-y: auto;
}

/* KPI */
body.bb-theme-v2 .bb-sn-voucher-edit-kpi {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--bb-v2-radius-md, 0.5rem);
  border: 1px solid var(--bb-v2-border, #e7e7ef);
  background: var(--bb-v2-surface, #fff);
  min-width: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.45rem;
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__card--amount .bb-sn-voucher-edit-kpi__icon {
  background: rgba(105, 108, 255, 0.14);
  color: #696cff;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__card--date .bb-sn-voucher-edit-kpi__icon {
  background: rgba(255, 171, 0, 0.16);
  color: #ffab00;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__card--method .bb-sn-voucher-edit-kpi__icon {
  background: rgba(113, 221, 55, 0.16);
  color: #71dd37;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--bb-v2-muted, #a1acb8);
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bb-v2-heading, #384551);
  word-break: break-word;
}

body.bb-theme-v2 .bb-sn-voucher-edit-kpi__card--amount .bb-sn-voucher-edit-kpi__value {
  font-size: 1.15rem;
}

/* Context */
body.bb-theme-v2 .bb-sn-voucher-edit__context-card .bb-sn-data-card__body,
body.bb-theme-v2 .bb-sn-voucher-edit__form-card .bb-sn-data-card__body {
  padding-top: 0.65rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit__info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit .bb-sn-info-card {
  background: var(--bb-v2-surface-2, #f8f9fc);
  border: 1px solid var(--bb-v2-border, #e7e7ef);
  border-radius: 0.55rem;
  padding: 0.75rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.65;
  min-width: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit .bb-sn-info-card__numbers div {
  margin-bottom: 0.25rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit .bb-sn-info-card__numbers div:last-child {
  margin-bottom: 0;
}

/* Form grid */
body.bb-theme-v2 .bb-sn-voucher-edit__fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  width: 100%;
}

body.bb-theme-v2 .bb-sn-voucher-edit__fields .bb-sn-field {
  min-width: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit__fields .bb-sn-field--full {
  grid-column: 1 / -1;
}

body.bb-theme-v2 .bb-sn-voucher-edit__fields .form-group {
  margin-bottom: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit__fields .bb-sn-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bb-v2-muted, #697a8d);
}

body.bb-theme-v2 .bb-sn-voucher-edit .input-group-addon {
  background: var(--bb-v2-surface-2, #f1f5f9);
  border-color: var(--bb-v2-border, #e2e8f0);
  color: var(--bb-v2-muted, #64748b);
}

body.bb-theme-v2 .bb-sn-voucher-edit .form-control,
body.bb-theme-v2 .bb-sn-voucher-edit .select2-container--default .select2-selection--single {
  border-color: var(--bb-v2-border, #e2e8f0);
}

body.bb-theme-v2 .bb-sn-voucher-edit__help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--bb-v2-muted, #a1acb8);
}

body.bb-theme-v2 .bb-sn-voucher-edit__denom {
  margin-top: 0.5rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit__denom-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.5rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit__denom-table-wrap table {
  min-width: 28rem;
  margin-bottom: 0;
}

body.bb-theme-v2 .bb-sn-voucher-edit__type-details {
  grid-column: 1 / -1;
  width: 100%;
}

body.bb-theme-v2 .bb-sn-voucher-edit__type-details .payment_details_div .form-group {
  margin-bottom: 0.75rem;
}

body.bb-theme-v2 .bb-sn-voucher-edit__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--bb-v2-border, #e7e7ef);
  background: var(--bb-v2-surface, #fff);
}

/* Hide legacy modal chrome inside voucher edit */
body.bb-theme-v2 .bb-sn-voucher-edit.receipt-voucher-modal .modal-header[style*="gradient"] {
  background: transparent !important;
}

@media (max-width: 991.98px) {
  body.bb-theme-v2 .bb-sn-voucher-edit-kpi,
  body.bb-theme-v2 .bb-sn-voucher-edit__info-grid,
  body.bb-theme-v2 .bb-sn-voucher-edit__fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  body.bb-theme-v2 .bb-sn-voucher-edit-kpi,
  body.bb-theme-v2 .bb-sn-voucher-edit__info-grid,
  body.bb-theme-v2 .bb-sn-voucher-edit__fields-grid {
    grid-template-columns: 1fr;
  }

  body.bb-theme-v2 .bb-sn-voucher-edit__footer .bb-sn-btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
  }
}
