.page {
  background: #f3f6fb;
}

.page-wrapper {
  background:
    linear-gradient(180deg, rgba(31, 76, 130, 0.06), rgba(31, 76, 130, 0) 220px),
    #f3f6fb;
}

.navbar-vertical {
  background: #182433;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-vertical .navbar-brand {
  padding: 1.15rem 1rem 0.85rem;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: normal;
}

.brand-mark {
  display: inline-grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #182433;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-title,
.brand-subtitle {
  display: block;
}

.brand-title {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.15;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.73rem;
  font-weight: 500;
}

.navbar-vertical .nav-link {
  margin: 0.1rem 0.65rem;
  border-radius: 0.45rem;
}

.navbar-vertical .nav-link.active {
  background: rgba(255, 255, 255, 0.1);
}

.topbar-context {
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #dde5ef;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #40566f;
  font-size: 0.78rem;
  font-weight: 600;
}

.page-body {
  padding-top: 1.4rem;
}

.page-header {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dce4ee;
}

.page-title {
  color: #172231;
  font-weight: 800;
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #dce4ee;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(24, 36, 51, 0.05);
}

.ops-item {
  min-width: 0;
  padding: 0.9rem 1rem;
  border-right: 1px solid #e7edf4;
}

.ops-item:last-child {
  border-right: 0;
}

.ops-item span,
.ops-item strong {
  display: block;
}

.ops-item span {
  margin-bottom: 0.2rem;
  color: #66758a;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ops-item strong {
  color: #172231;
  font-size: 0.88rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.card {
  border-color: #dce4ee;
  border-radius: 0.5rem;
  box-shadow: 0 10px 26px rgba(24, 36, 51, 0.055);
}

.card-header {
  background: #ffffff;
  border-bottom-color: #e5ebf3;
}

.card-title {
  color: #172231;
  font-weight: 800;
}

.card-sm .avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.table {
  --tblr-table-hover-bg: #f7f9fc;
}

.table thead th {
  color: #5d6e83;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.table td {
  vertical-align: middle;
}

.btn {
  border-radius: 0.45rem;
  font-weight: 650;
}

.btn-primary {
  box-shadow: 0 8px 18px rgba(32, 107, 196, 0.18);
}

.modal-content {
  border: 1px solid #dce4ee;
  border-radius: 0.55rem;
  box-shadow: 0 24px 80px rgba(24, 36, 51, 0.24);
}

.modal-header,
.modal-footer {
  background: #fbfcfe;
}

.modal-title {
  font-weight: 800;
}

.form-control,
.form-select {
  border-radius: 0.42rem;
}

.field-help,
.select-guide {
  margin-top: 0.35rem;
  color: #66758a;
  font-size: 0.76rem;
  line-height: 1.35;
}

.field-help code,
.select-guide code {
  font-size: 0.72rem;
}

.select-guide {
  padding: 0.55rem 0.65rem;
  border-left: 3px solid #b7c7dc;
  border-radius: 0.35rem;
  background: #f7f9fc;
}

.select-guide strong {
  color: #40566f;
}

.commercial-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #d7e2ef;
  border-radius: 0.55rem;
  background:
    linear-gradient(90deg, rgba(32, 107, 196, 0.08), rgba(47, 179, 68, 0.06)),
    #ffffff;
  box-shadow: 0 10px 26px rgba(24, 36, 51, 0.055);
}

.commercial-kicker {
  display: block;
  margin-bottom: 0.25rem;
  color: #206bc4;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.commercial-strip strong {
  display: block;
  color: #172231;
  font-size: 1rem;
  font-weight: 850;
}

.commercial-strip p {
  max-width: 58rem;
  margin: 0.35rem 0 0;
  color: #40566f;
}

.commercial-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 1fr));
  gap: 0.45rem;
}

.commercial-checks span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #dce7f4;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.78);
  color: #2f4056;
  font-size: 0.78rem;
  font-weight: 750;
}

.commercial-checks i {
  color: #206bc4;
}

.metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #edf1f6;
}

.metric-line:last-child {
  border-bottom: 0;
}

.metric-line span {
  color: #66758a;
  font-size: 0.82rem;
  font-weight: 650;
}

.metric-line strong {
  color: #172231;
  font-weight: 800;
}

.chart-list {
  min-height: 190px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(6rem, 1.4fr) 4.6rem;
  align-items: center;
  gap: 0.65rem;
  min-height: 2rem;
  font-size: 0.78rem;
}

.chart-row-label {
  min-width: 0;
  overflow: hidden;
  color: #40566f;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-row-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eff6;
}

.chart-row-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #206bc4;
}

.chart-row-value {
  color: #172231;
  font-weight: 800;
  text-align: right;
}

.provider-tabs-shell {
  border: 1px solid #dce4ee;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(24, 36, 51, 0.055);
}

.provider-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.55rem;
  border-bottom: 1px solid #e5ebf3;
}

.provider-tab {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.45rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: #40566f;
  font-weight: 750;
}

.provider-tab.active {
  border-color: #cdd9e8;
  background: #f4f7fb;
  color: #172231;
}

.provider-default-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #2fb344;
}

.provider-panel {
  padding: 1.1rem;
}

.provider-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #edf1f6;
}

.provider-panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  color: #172231;
  font-size: 1.1rem;
  font-weight: 850;
}

.provider-panel-header p {
  max-width: 58rem;
  margin: 0;
  color: #66758a;
}

.provider-kicker {
  margin-bottom: 0.3rem;
  color: #206bc4;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.provider-info-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid #e2e9f2;
  border-radius: 0.45rem;
  background: #fbfcfe;
}

.provider-info-card span,
.provider-info-card strong {
  display: block;
}

.provider-info-card span {
  margin-bottom: 0.25rem;
  color: #66758a;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-info-card strong {
  color: #172231;
  font-size: 0.9rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.provider-guidance,
.openrouter-management {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e2e9f2;
  border-radius: 0.45rem;
  background: #ffffff;
}

.provider-guidance h4,
.openrouter-management h4 {
  color: #172231;
  font-weight: 850;
}

.decision-callout {
  padding: 0.95rem;
  border: 1px solid #cde5d3;
  border-radius: 0.45rem;
  background: #f2fbf4;
}

.decision-callout + .decision-callout {
  margin-top: 0.8rem;
}

.decision-callout.muted {
  border-color: #dde5ef;
  background: #f7f9fc;
}

.decision-callout strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #172231;
  font-weight: 850;
}

.decision-callout p {
  margin: 0;
  color: #40566f;
}

.key-created-box {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  border: 1px solid #f0c36d;
  border-radius: 0.45rem;
  background: #fff8e8;
}

.key-created-box code {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.empty-table-state {
  display: grid;
  gap: 0.25rem;
  padding: 1.2rem 0.5rem;
  color: #66758a;
}

.empty-table-state strong {
  color: #172231;
  font-weight: 850;
}

.empty-table-state span {
  max-width: 48rem;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.cursor-pointer {
  cursor: pointer;
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

pre.payload-output {
  max-height: 60vh;
  overflow: auto;
  background: #101824;
  color: #e6edf3;
  border: 1px solid #273447;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 0.8125rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.badge-role-admin { background-color: var(--tblr-red); }
.badge-role-operator { background-color: var(--tblr-blue); }
.badge-role-viewer { background-color: var(--tblr-secondary); }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
}

@media (max-width: 991.98px) {
  .ops-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-item:nth-child(2n) {
    border-right: 0;
  }

  .provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-panel-header {
    flex-direction: column;
  }

  .commercial-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .page-header.d-flex {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 0.8rem;
  }

  .page-header .btn {
    width: 100%;
  }

  .ops-strip {
    grid-template-columns: 1fr;
  }

  .ops-item {
    border-right: 0;
    border-bottom: 1px solid #e7edf4;
  }

  .ops-item:last-child {
    border-bottom: 0;
  }

  .provider-grid,
  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-row-value {
    text-align: left;
  }

  .commercial-checks {
    grid-template-columns: 1fr;
  }
}
