.history-grid {
  margin-bottom: 22px;
}

.overview-page {
  display: grid;
  gap: 22px;
}

.overview-page > article,
.overview-grid article {
  margin-bottom: 0;
}

.overview-head,
.overview-quick-actions,
.overview-call,
.overview-access > div {
  display: flex;
  align-items: center;
}

.overview-head {
  justify-content: space-between;
  gap: 24px;
}

.overview-head h1 {
  margin-bottom: 0;
}

.overview-quick-actions {
  gap: 10px;
}

.overview-quick-actions a {
  padding: 11px 16px;
  border-radius: 9px;
  background: var(--accent);
  color: #062018;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.overview-quick-actions a.secondary-button {
  background: #1a2a34;
  color: var(--text);
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.overview-metrics > div {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, #15232c, #101920);
}

.overview-metrics span,
.overview-metrics small {
  display: block;
  color: var(--muted);
}

.overview-metrics b {
  display: block;
  margin: 8px 0 4px;
  color: var(--accent);
  font-size: 1.45rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 22px;
}

.overview-access > div {
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.access-state.allowed {
  color: var(--accent);
}

.access-state.blocked {
  color: var(--danger);
}

.overview-call {
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.overview-call > div {
  min-width: 0;
  flex: 1;
}

.overview-call b,
.overview-call small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-grid article {
  margin-bottom: 0;
}

.history-row {
  align-items: flex-start;
}

.money.credit {
  color: var(--accent);
}

.money.debit,
.danger-text {
  color: var(--danger);
}

.service-actions {
  text-align: right;
}

.danger-link {
  color: var(--danger);
}

.call-table {
  overflow-x: auto;
}

.call-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b151c;
}

.call-filters label {
  margin: 0;
  font-size: .8rem;
}

.call-filter-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
}

.call-row {
  display: grid;
  grid-template-columns: 105px minmax(130px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) 155px 75px 120px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.call-header {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  padding-top: 0;
}

.call-row > :last-child {
  text-align: right;
}

.call-direction {
  font-size: .82rem;
  font-weight: 750;
}

.call-direction.inbound {
  color: var(--accent);
}

.call-result {
  font-size: .84rem;
  font-weight: 750;
}

.call-result.answered {
  color: var(--accent);
}

.call-result.failed,
.call-result.missed {
  color: var(--danger);
}

.call-response {
  max-width: 180px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sip-page {
  margin-bottom: 22px;
}

.sip-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.sip-page-head h1,
.sip-trunk-head h2,
.sip-setting h3 {
  margin-bottom: 0;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sip-card-list {
  display: grid;
  gap: 22px;
}

.sip-trunk-card {
  padding: 0;
  overflow: hidden;
}

.sip-trunk-head,
.sip-trunk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
}

.sip-trunk-head {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #18313b66, transparent);
}

.sip-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.sip-facts > div {
  min-width: 0;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.sip-facts > div:last-child {
  border-right: 0;
}

.sip-facts span,
.sip-trunk-footer span {
  display: block;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: 7px;
}

.sip-facts b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sip-facts small,
.sip-trunk-footer small {
  color: var(--muted);
}

.sip-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.sip-setting {
  min-width: 0;
  padding: 24px;
  background: #101a21;
}

.sip-setting > .muted {
  min-height: 42px;
  margin: 8px 0 18px;
}

.trunk-default-cli {
  display: flex;
  align-items: end;
  gap: 10px;
}

.trunk-default-cli label {
  flex: 1;
  margin: 0;
}

.trunk-default-cli select {
  margin-top: 5px;
}

.trunk-default-cli button {
  margin-bottom: 1px;
  white-space: nowrap;
}

.trunk-auth {
  display: grid;
  gap: 12px;
}

.trunk-auth label {
  display: grid;
  gap: 6px;
}

.trunk-auth select,
.trunk-auth textarea {
  width: 100%;
}

.trunk-auth textarea {
  min-height: 76px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #1a2a34;
  color: var(--text);
}

.tariff-details summary {
  display: inline-block;
  padding: 11px 0;
  font-weight: 700;
}

.tariff-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px 16px;
  padding: 14px 0;
  overflow-x: auto;
}

.sip-trunk-footer {
  background: #0c151b;
}

.empty-state {
  text-align: center;
}

.numbers-page > .card {
  margin-bottom: 22px;
}

.numbers-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.numbers-page-head h1,
.service-card h3 {
  margin-bottom: 0;
}

.service-card-list {
  display: grid;
  gap: 14px;
}

.service-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0d171e;
  overflow: hidden;
}

.service-card > header,
.service-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.service-card > header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #18313b55, transparent);
}

.service-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.service-facts > div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.service-facts > div:last-child {
  border-right: 0;
}

.service-facts span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .78rem;
}

.service-facts b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-card > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #0a1319;
}

.service-warning {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid #7c6428;
  background: #3f3417;
  color: #ffe49b;
}

.action-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}

.action-dialog form {
  padding: 24px;
}

.dialog-head,
.dialog-actions,
.order-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog-close {
  padding: 3px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
  line-height: 1;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.order-number {
  margin-top: 20px;
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 800;
}

.order-price {
  align-items: stretch;
  margin-top: 14px;
}

.order-price span {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
}

.order-price b {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

.warning-box {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #70464b;
  border-radius: 10px;
  background: #331e22;
}

.warning-box p {
  margin-bottom: 0;
  color: #e9bdc1;
}

.danger-button {
  background: var(--danger);
  color: #2b0808;
}

@media (max-width: 720px) {
  .sip-page-head,
  .sip-trunk-footer,
  .numbers-page-head,
  .service-card > header,
  .service-card > footer,
  .dialog-actions,
  .order-price,
  .overview-head,
  .overview-quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sip-facts,
  .sip-settings-grid,
  .service-facts,
  .overview-metrics,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .sip-facts > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sip-facts > div:last-child {
    border-bottom: 0;
  }

  .service-facts > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .service-facts > div:last-child {
    border-bottom: 0;
  }

  .trunk-default-cli {
    align-items: stretch;
    flex-direction: column;
  }

  .call-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }

  .call-filters {
    grid-template-columns: 1fr;
  }

  .call-header {
    display: none;
  }

  .call-row > [data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
  }

  .call-row > :last-child {
    text-align: left;
  }

}
