.webhook-history-drawer .modal-container {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.webhook-history-drawer .modal-content {
  width: min(780px, 100vw);
  height: 100vh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
  transform: translateX(100%);
  transition-property: transform;
}

.webhook-history-drawer.modal-transition-entered .modal-content,
.webhook-history-drawer.modal-transition-entering .modal-content {
  transform: translateX(0);
}

.webhook-history-drawer .modal-body {
  height: 100%;
  padding: 0;
}

.webhook-history-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: #172033;
  background: #f6f8fc;
}

.webhook-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 28px 32px 24px;
  color: #fff;
  background: linear-gradient(135deg, #111827 0%, #26375a 100%);
}

.webhook-history-header h2 {
  margin: 4px 0 5px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.webhook-history-header p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
}

.webhook-history-eyebrow {
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}

.webhook-history-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-size: 25px;
  line-height: 28px;
  cursor: pointer;
}

.webhook-history-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

.webhook-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.webhook-summary-card {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #e5eaf2;
  border-top: 3px solid #64748b;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,.04);
}

.webhook-summary-card span {
  display: block;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}

.webhook-summary-card.success { border-top-color: #10b981; }
.webhook-summary-card.failed { border-top-color: #ef4444; }
.webhook-summary-card.resubmission { border-top-color: #8b5cf6; }
.webhook-summary-card.retry { border-top-color: #f59e0b; }

.webhook-chart,
.webhook-records-section {
  padding: 20px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(15,23,42,.04);
}

.webhook-chart { margin-bottom: 18px; }

.webhook-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.webhook-section-heading h3 {
  margin: 0;
  color: #172033;
  font-size: 15px;
  font-weight: 700;
}

.webhook-section-heading > span {
  color: #94a3b8;
  font-size: 11px;
}

.webhook-chart-bars {
  display: grid;
  gap: 11px;
}

.webhook-chart-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 11px;
}

.webhook-chart-label strong { color: #334155; }

.webhook-chart-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.webhook-chart-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #64748b;
  transition: width .25s ease;
}

.webhook-chart-fill.success { background: #10b981; }
.webhook-chart-fill.failed { background: #ef4444; }
.webhook-chart-fill.resubmission { background: #8b5cf6; }
.webhook-chart-fill.retry { background: #f59e0b; }

.webhook-history-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 12px;
}

.webhook-refresh-button,
.webhook-replay-button {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #3b4cca;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.webhook-refresh-button { padding: 7px 11px; }
.webhook-replay-button { padding: 8px 11px; }

.webhook-refresh-button:hover,
.webhook-replay-button:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
}

.webhook-refresh-button:disabled,
.webhook-replay-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.webhook-record-list {
  display: grid;
  gap: 10px;
}

.webhook-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e7ebf2;
  border-radius: 11px;
  background: #fbfcfe;
}

.webhook-record-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}

.webhook-record-title time {
  margin-left: auto;
  color: #94a3b8;
  font-size: 10px;
}

.webhook-status,
.webhook-kind {
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.webhook-status.success { color: #047857; background: #d1fae5; }
.webhook-status.failed { color: #b91c1c; background: #fee2e2; }
.webhook-status.pending { color: #92400e; background: #fef3c7; }
.webhook-kind { color: #6d28d9; background: #ede9fe; }

.webhook-record-meta {
  overflow: hidden;
  color: #475569;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.webhook-record-id {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 10px;
}

.webhook-record-id code { color: #64748b; }

.webhook-record-details {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid #edf0f5;
  color: #64748b;
  font-size: 11px;
}

.webhook-record-details summary { cursor: pointer; }

.webhook-record-details pre {
  max-height: 130px;
  margin: 8px 0 0;
  overflow: auto;
  border-radius: 7px;
  padding: 10px;
  color: #cbd5e1;
  background: #172033;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.webhook-history-empty {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px dashed #dbe3ef;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.webhook-history-empty strong { color: #475569; }

@media (max-width: 720px) {
  .webhook-history-drawer .modal-content { border-radius: 0; }
  .webhook-history-header { padding: 22px 20px 20px; }
  .webhook-history-scroll { padding: 18px 16px 30px; }
  .webhook-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .webhook-record { grid-template-columns: 1fr; }
  .webhook-record-title time { display: none; }
  .webhook-replay-button { width: 100%; }
}
