.records-view {
  --records-blue: #2f6fed;
  --records-ink: #18263a;
  scroll-margin-top: 82px;
}

.records-hero {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
  border: 1px solid #d7e3f4;
  border-radius: 14px;
  padding: 20px 22px;
  background:
    radial-gradient(circle at 90% 0, #66c6ef2e, transparent 30%),
    linear-gradient(125deg, #f8fbff, #eef5ff 62%, #f2fbfb);
  box-shadow: 0 10px 30px #1b4f8a10;
}

.records-hero small {
  color: #2a6ddd;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.records-hero h2 {
  margin: 5px 0;
  color: var(--records-ink);
  font-size: 19px;
}

.records-hero p {
  margin: 0;
  color: #65758a;
  font-size: 11px;
}

.records-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 15px;
}

.records-metrics article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: #fff;
  box-shadow: 0 5px 18px #16365f0a;
}

.records-metrics span,
.records-metrics small {
  display: block;
  color: #788699;
  font-size: 10px;
}

.records-metrics strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--records-ink);
  font-size: 25px;
}

.records-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 180px auto;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #e5ebf2;
  padding: 14px 16px;
}

.records-toolbar input,
.records-toolbar select {
  height: 36px;
  border: 1px solid #d8e1ec;
  border-radius: 8px;
  padding: 0 11px;
  outline: none;
  background: #fbfcfe;
  color: #34445a;
  font-size: 10px;
}

.records-toolbar input:focus,
.records-toolbar select:focus {
  border-color: #76a7e9;
  box-shadow: 0 0 0 3px #2f6fed12;
}

.records-live {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-self: end;
  color: #66768b;
  font-size: 10px;
}

.records-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #13a471;
  box-shadow: 0 0 0 4px #13a47118;
}

.records-table-wrap {
  max-height: 520px;
  overflow: auto;
}

.records-table td {
  vertical-align: middle;
}

.records-identity,
.records-link {
  display: grid;
  gap: 4px;
}

.records-identity b,
.records-link b {
  color: #25344a;
  font-size: 11px;
}

.records-identity small,
.records-link small,
.records-provider {
  color: #7c8999;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.records-direction,
.records-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef3f8;
  color: #52657b;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.records-direction.inbound {
  background: #e8f7f1;
  color: #087d56;
}

.records-status.delivered,
.records-status.sent,
.records-status.accepted {
  background: #e8f7f1;
  color: #087d56;
}

.records-status.unknown,
.records-status.needs_review {
  background: #fff4df;
  color: #a76500;
}

.records-status.failed,
.records-status.rejected {
  background: #fdecec;
  color: #bd3d3d;
}

.records-detail-button {
  border: 1px solid #cbdcf2;
  border-radius: 7px;
  padding: 7px 10px;
  background: #f3f8ff;
  color: #2865c4;
  font-size: 10px;
  font-weight: 750;
}

.records-empty {
  padding: 52px 20px !important;
  color: #7c8999 !important;
  text-align: center;
}

.records-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-top: 1px solid #e5ebf2;
  padding: 10px 16px;
  color: #7c8999;
  font-size: 10px;
}

.records-detail {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  width: min(520px, 92vw);
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #d9e2ed;
  background: #fff;
  box-shadow: -18px 0 50px #16365f24;
}

.records-detail[hidden] {
  display: none;
}

.records-detail > header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e4eaf1;
  padding: 18px 20px;
  background: #fff;
}

.records-detail header small {
  color: #2f6fed;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.records-detail header h2 {
  margin: 4px 0 0;
  font-size: 17px;
}

.records-detail-body {
  display: grid;
  gap: 14px;
  padding: 18px 20px 36px;
}

.records-summary,
.records-trace-block {
  border: 1px solid #e0e7f0;
  border-radius: 11px;
  padding: 15px;
  background: #fbfcfe;
}

.records-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.records-summary span {
  min-width: 0;
}

.records-summary small,
.records-trace-block > small {
  display: block;
  color: #7d8a9b;
  font-size: 9px;
}

.records-summary b {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: #26364c;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-trace-block h3 {
  margin: 0 0 12px;
  color: #26364c;
  font-size: 12px;
}

.records-trace-entry {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 9px 0;
  border-top: 1px solid #e7ecf2;
}

.records-trace-entry i {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 50%;
  background: #2f6fed;
  box-shadow: 0 0 0 4px #2f6fed12;
}

.records-trace-entry b,
.records-trace-entry small {
  display: block;
}

.records-trace-entry b {
  color: #34445a;
  font-size: 10px;
}

.records-trace-entry small,
.records-trace-entry time {
  margin-top: 3px;
  color: #8390a0;
  font-size: 9px;
}

@media (max-width: 900px) {
  .records-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .records-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .records-toolbar input {
    grid-column: 1 / -1;
  }
}
