.qbc-cd-overlay {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
}

.qbc-cd-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1120px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: #f8fafc;
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.36);
}

.qbc-cd-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(120deg, #312e81 0%, #4338ca 52%, #7c3aed 100%);
  color: #ffffff;
}

.qbc-cd-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.qbc-cd-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 15px;
}

.qbc-cd-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.qbc-cd-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.qbc-cd-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px 20px;
  overflow: auto;
}

.qbc-cd-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #3730a3;
  background: #eef2ff;
  font-size: 12.5px;
}

.qbc-cd-status.is-success {
  color: #166534;
  background: #dcfce7;
}

.qbc-cd-status.is-error {
  color: #991b1b;
  background: #fee2e2;
}

.qbc-cd-section {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

.qbc-cd-section-title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.qbc-cd-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.qbc-cd-field {
  display: grid;
  gap: 6px;
}

.qbc-cd-label {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.qbc-cd-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #0f172a;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.qbc-cd-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(199, 210, 254, 0.8);
}

.qbc-cd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qbc-cd-button {
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  color: #334155;
  background: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.qbc-cd-button.is-primary {
  color: #ffffff;
  background: #4f46e5;
}

.qbc-cd-button.is-ghost {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.qbc-cd-button:hover {
  filter: brightness(0.97);
}

.qbc-cd-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.qbc-cd-hint {
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.qbc-cd-table-wrap {
  overflow-x: auto;
}

.qbc-cd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.qbc-cd-table th,
.qbc-cd-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.qbc-cd-table th {
  color: #64748b;
  font-weight: 600;
  background: #f8fafc;
}

.qbc-cd-row.is-voided td,
.qbc-cd-row.is-expired td {
  color: #94a3b8;
}

.qbc-cd-code {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #312e81;
  background: #eef2ff;
  font: 600 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.qbc-cd-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.qbc-cd-pill.is-pending {
  color: #92400e;
  background: #fef3c7;
}

.qbc-cd-pill.is-claimed {
  color: #166534;
  background: #dcfce7;
}

.qbc-cd-pill.is-voided,
.qbc-cd-pill.is-expired {
  color: #475569;
  background: #e2e8f0;
}

.qbc-cd-cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qbc-cd-mini {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
}

.qbc-cd-mini.is-primary {
  border-color: #4f46e5;
  color: #ffffff;
  background: #4f46e5;
}

.qbc-cd-mini.is-danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.qbc-cd-mini:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.qbc-cd-detail td {
  background: #f8fafc;
  white-space: normal;
}

.qbc-cd-code-list {
  display: grid;
  gap: 6px;
}

.qbc-cd-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 2px;
}

.qbc-cd-code-head-title {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.qbc-cd-code-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qbc-cd-code-line code {
  flex: 0 1 auto;
  padding: 3px 8px;
  border-radius: 8px;
  background: #eef2ff;
  color: #312e81;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

.qbc-cd-tag {
  padding: 1px 7px;
  border-radius: 999px;
  color: #64748b;
  background: #e2e8f0;
  font-size: 11px;
}

.qbc-cd-empty {
  padding: 14px 4px;
  color: #94a3b8;
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 820px) {
  .qbc-cd-grid {
    grid-template-columns: 1fr;
  }

  .qbc-cd-modal {
    max-height: calc(100vh - 12px);
    border-radius: 16px;
  }

  .qbc-cd-body {
    padding: 12px;
  }

  .qbc-cd-section {
    padding: 12px;
  }
}

.qbc-cd-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qbc-cd-header-button {
  min-height: 32px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
}

.qbc-cd-header-button:hover,
.qbc-cd-header-button.is-active {
  background: rgba(255, 255, 255, 0.3);
}

.qbc-cd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.qbc-cd-stat {
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.qbc-cd-stat-value {
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.qbc-cd-stat-label {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.qbc-cd-stat.is-pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.qbc-cd-stat.is-claimed {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.qbc-cd-stat.is-expired {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.qbc-cd-stat.is-voided {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.qbc-cd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.qbc-cd-search {
  width: 220px;
  min-height: 32px;
  padding: 6px 10px;
}

.qbc-cd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.qbc-cd-tab {
  padding: 5px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.qbc-cd-tab.is-active {
  border-color: #4f46e5;
  color: #ffffff;
  background: #4f46e5;
}

.qbc-cd-settings {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.qbc-cd-check {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
}

.qbc-cd-check input {
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
}

.qbc-cd-field-wide {
  margin-top: 12px;
}

.qbc-cd-textarea {
  min-height: 66px;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.6;
}

.qbc-cd-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
}

.qbc-cd-detail-item {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.qbc-cd-detail-label {
  flex: 0 0 62px;
  color: #94a3b8;
}

.qbc-cd-detail-value {
  flex: 1 1 auto;
  color: #334155;
  word-break: break-all;
}

@media (max-width: 820px) {
  .qbc-cd-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qbc-cd-detail-grid {
    grid-template-columns: 1fr;
  }

  .qbc-cd-search {
    width: 100%;
  }
}
