.kbsa-app {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 16px;
}

.kbsa-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
}

.kbsa-card + .kbsa-card {
  margin-top: 20px;
}

.kbsa-login-wrap #loginform,
.kbsa-login-wrap form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kbsa-login-wrap label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.kbsa-login-wrap input[type="text"],
.kbsa-login-wrap input[type="password"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  box-sizing: border-box;
}

.kbsa-login-wrap .login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbsa-login-wrap .button,
.kbsa-button-secondary {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kbsa-login-wrap .button,
.kbsa-button-secondary {
  background: #111827;
  color: #fff;
}

.kbsa-toolbar {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.kbsa-cta-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.kbsa-register-wrap {
  border-top: 1px solid #e5e7eb;
  padding-top: 18px;
}

.kbsa-register-wrap h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.kbsa-register-wrap p {
  margin: 0 0 16px;
  color: #4b5563;
}

.kbsa-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.kbsa-stats-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kbsa-stats-grid-seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.kbsa-stat-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
}

.kbsa-stat-label {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 8px;
}

.kbsa-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
}

.kbsa-table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.kbsa-report-table-wrap {
  border-radius: 0px;
  background: #ffffff;
}

.kbsa-report-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.kbsa-report-links-table {
  table-layout: fixed;
}

.kbsa-report-table th,
.kbsa-report-table td {
  box-sizing: border-box;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
  border-bottom: 1px solid #e5e7eb;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kbsa-report-table th {
  background: #f9fafb;
  font-weight: 700;
  white-space: normal;
}

.kbsa-report-table td {
  color: #111827;
  background: #ffffff;
}

.kbsa-report-table tbody tr:last-child td {
  border-bottom: 0;
}

.kbsa-col-created {
  width: 130px;
  min-width: 130px;
}

.kbsa-col-short-url {
  width: 220px;
  min-width: 220px;
}

.kbsa-col-short-url a {
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}

.kbsa-col-item-name {
  width: 280px;
  min-width: 280px;
}

.kbsa-col-order-id {
  width: 150px;
  min-width: 150px;
}

.kbsa-col-order-status {
  width: 170px;
  min-width: 170px;
}

.kbsa-col-money {
  width: 110px;
  min-width: 110px;
}

.kbsa-item-name,
.kbsa-cell-text {
  display: block;
  max-width: 100%;
  word-break: break-word;
}

.kbsa-order-code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f3f4f6;
  word-break: break-all;
}

.kbsa-empty-cell {
  text-align: center;
  color: #6b7280;
}

.kbsa-header h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.kbsa-header p {
  margin: 0 0 20px;
  color: #4b5563;
}

.kbsa-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kbsa-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.kbsa-input,
.kbsa-text,
.kbsa-output {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  box-sizing: border-box;
}

.kbsa-text {
  min-height: 48px;
}

.kbsa-input {
  min-height: 110px;
  resize: vertical;
}

.kbsa-url-input {
  min-height: 84px;
}

.kbsa-refund-note {
  margin: -2px 0 2px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.kbsa-bank-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.kbsa-bank-section h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.kbsa-bank-section p {
  margin: 0 0 16px;
  color: #4b5563;
}

.kbsa-bank-section-inline {
  margin-top: 4px;
  padding-top: 0;
  border-top: 0;
}

.kbsa-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kbsa-refund-grid {
  margin-top: 4px;
}

.kbsa-button,
.kbsa-copy,
.kbsa-open {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.kbsa-button {
  background: #ee4d2d;
  color: #fff;
  align-self: flex-start;
}

.kbsa-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.kbsa-copy {
  background: #111827;
  color: #fff;
  white-space: nowrap;
}

.kbsa-open {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  white-space: nowrap;
}

.kbsa-result {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e5e7eb;
}

.kbsa-result-block + .kbsa-result-block {
  margin-top: 16px;
}

.kbsa-result-label {
  font-weight: 700;
  margin-bottom: 8px;
}

.kbsa-output-row {
  display: flex;
  gap: 10px;
}

.kbsa-meta-output {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: #374151;
}

.kbsa-message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
}

.kbsa-success {
  background: #ecfdf5;
  color: #047857;
}

.kbsa-error {
  background: #fef2f2;
  color: #b91c1c;
}

.kbsa-info {
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 768px) {
  .kbsa-meta-grid {
    grid-template-columns: 1fr;
  }

  .kbsa-output-row {
    flex-direction: column;
  }

  .kbsa-stats-grid,
  .kbsa-stats-grid-six,
  .kbsa-stats-grid-seven {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kbsa-stats-grid-six .kbsa-stat-box:nth-child(5),
  .kbsa-stats-grid-six .kbsa-stat-box:nth-child(6) {
    grid-column: auto;
  }

  .kbsa-report-table {
    min-width: 920px;
  }

  .kbsa-col-created {
    width: 130px;
    min-width: 130px;
  }

  .kbsa-col-short-url {
    width: 180px;
    min-width: 180px;
  }

  .kbsa-col-item-name {
    width: 220px;
    min-width: 220px;
  }

  .kbsa-col-order-id {
    width: 120px;
    min-width: 120px;
  }

  .kbsa-col-order-status {
    width: 150px;
    min-width: 150px;
  }

  .kbsa-col-money {
    width: 100px;
    min-width: 100px;
  }

  .kbsa-cta-actions {
    flex-direction: column;
  }

  .kbsa-register-grid {
    grid-template-columns: 1fr;
  }

  .kbsa-button,
  .kbsa-copy,
  .kbsa-open,
  .kbsa-button-secondary {
    width: 100%;
  }
}

.kbsa-payment-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kbsa-stats-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.kbsa-stats-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
}


.kbsa-bank-save-wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.kbsa-bank-save-button {
  width: 100%;
  margin-top: auto;
}

.kbsa-label-hidden {
  visibility: hidden;
}

/* v5.17.2: Bank info save button placement */
.kbsa-refund-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.kbsa-bank-save-wrap {
  align-self: end;
}

.kbsa-bank-save-button {
  width: auto;
  min-width: 86px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .kbsa-refund-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kbsa-bank-save-wrap {
    margin-top: 4px;
  }

  .kbsa-bank-save-wrap .kbsa-label-hidden {
    display: none;
  }

  .kbsa-bank-save-button {
    width: 100%;
  }
}
