:root {
  color-scheme: light;
  --bg-app: #f9fafb;
  --bg-soft: #f3f8f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f3f4f6;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --primary: #14b8a6;
  --primary-strong: #0d9488;
  --primary-soft: #f0fdfa;
  --blue: #3b82f6;
  --blue-soft: #dbeafe;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --purple: #9333ea;
  --purple-soft: #f3e8ff;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-panel: 0 18px 42px rgba(15, 23, 42, 0.12);
  --focus: 0 0 0 3px rgba(20, 184, 166, 0.18);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 0;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(240, 253, 250, 0.7), transparent 300px),
    var(--bg-app);
  color: var(--text);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  font-weight: 760;
  line-height: 1.28;
}

h3 {
  font-size: 14px;
  font-weight: 720;
  line-height: 1.35;
}

code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.app-shell {
  min-height: 100dvh;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 650;
}

.login-view {
  display: grid;
  min-height: 100dvh;
  align-items: start;
  justify-items: center;
  overflow-x: hidden;
  padding: clamp(22px, 5.2vh, 56px) 24px 24px;
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.45) 1px, transparent 1px),
    linear-gradient(180deg, rgba(226, 232, 240, 0.42) 1px, transparent 1px),
    linear-gradient(135deg, transparent 0%, transparent 68%, rgba(20, 184, 166, 0.18) 100%),
    linear-gradient(315deg, rgba(20, 184, 166, 0.12) 0%, transparent 30%),
    linear-gradient(180deg, rgba(236, 254, 255, 0.78), rgba(248, 250, 252, 0.36) 340px),
    var(--bg-app);
  background-size: 88px 88px, 88px 88px, auto, auto, auto, auto;
}

.login-shell {
  display: grid;
  width: min(520px, 100%);
  justify-items: center;
  gap: clamp(14px, 2.4vh, 24px);
}

.login-language-switch {
  display: inline-flex;
  justify-self: end;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  padding: 3px;
}

.login-language-switch button {
  min-width: 54px;
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 750;
}

.login-language-switch button.is-active {
  background: var(--primary);
  color: #ffffff;
}

.login-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.login-hero-logo {
  width: clamp(52px, 8vh, 68px);
  height: clamp(52px, 8vh, 68px);
  border: 1px solid rgba(20, 184, 166, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.15);
  object-fit: contain;
}

.login-hero strong {
  color: var(--primary-strong);
  font-size: clamp(26px, 4vh, 32px);
  font-weight: 820;
  line-height: 1;
}

.login-hero span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 650;
}

.login-card {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: clamp(10px, 1.5vh, 14px);
  border: 1px solid rgba(226, 232, 240, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: clamp(24px, 4.2vh, 36px);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.08);
  animation: login-card-enter 420ms ease-out both;
}

.login-form-head {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 2px;
  text-align: center;
}

.login-form-head h1 {
  color: #0f172a;
  font-size: clamp(22px, 3.4vh, 26px);
  line-height: 1.2;
}

.login-form-head p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.login-field > span:not(.login-input-shell),
.login-field > label {
  color: #374151;
  font-size: 12px;
  font-weight: 650;
}

.login-input-shell {
  position: relative;
  display: grid;
  min-width: 0;
  align-items: center;
}

.login-input-shell input {
  height: clamp(44px, 6.4vh, 50px);
  border-radius: 13px;
  padding: 10px 48px;
  font-size: 15px;
}

.login-input-icon {
  position: absolute;
  left: 18px;
  z-index: 1;
  width: 22px;
  height: 22px;
  color: #94a3b8;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-password-field input {
  padding-right: 72px;
}

.login-form-links {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  margin-top: -6px;
}

.login-link-action {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--primary-strong);
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.login-link-action:hover {
  background: var(--primary-soft);
}

.login-submit {
  min-height: clamp(44px, 6.2vh, 50px);
  margin-top: 4px;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: 0 12px 22px rgba(20, 184, 166, 0.2);
}

.submit-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-left: 0;
  border-radius: 3px;
}

.submit-icon::before {
  position: absolute;
  left: -7px;
  top: 6px;
  width: 9px;
  height: 2px;
  background: currentColor;
  content: "";
}

.submit-icon::after {
  position: absolute;
  left: -1px;
  top: 3px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(-45deg);
}

.login-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-terms-row input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.login-terms-row a {
  color: var(--primary-strong);
  font-weight: 650;
  text-decoration: none;
}

.login-terms-row a:hover {
  text-decoration: underline;
}

.login-register-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
  margin-top: 0;
  padding-top: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-footer {
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.login-gateway-url {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--text-faint);
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.16);
}

.status-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}

.error-text {
  min-height: 18px;
  color: var(--red);
  font-size: 12px;
}

@keyframes login-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-height: 900px) and (min-width: 641px) {
  .login-view {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .login-shell {
    gap: 12px;
  }

  .login-language-switch button {
    min-height: 26px;
    font-size: 11px;
  }

  .login-hero {
    gap: 5px;
  }

  .login-hero-logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    box-shadow: 0 10px 22px rgba(20, 184, 166, 0.12);
  }

  .login-hero strong {
    font-size: 24px;
  }

  .login-hero span {
    font-size: 13px;
  }

  .login-card {
    gap: 10px;
    padding: 22px 32px;
  }

  .login-form-head h1 {
    font-size: 22px;
  }

  .login-input-shell input {
    height: 44px;
  }

  .login-submit {
    min-height: 44px;
  }

  .login-terms-row {
    font-size: 12px;
    line-height: 1.35;
  }
}

.dashboard-view,
.control-shell {
  min-height: 100dvh;
}

.control-shell {
  background: var(--bg-app);
}

.control-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: 256px;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 12px;
}

.control-sidebar::before {
  display: none;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 6px 14px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.78);
  border-radius: 15px;
  background: #ffffff;
  box-shadow:
    0 8px 18px rgba(59, 130, 246, 0.14),
    0 0 0 3px rgba(239, 246, 255, 0.9);
}

.brand-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.sidebar-brand h1 {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand .eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  color: var(--text-faint);
}

.section-nav {
  display: grid;
  gap: 4px;
  padding: 4px 0 12px;
  scrollbar-width: thin;
}

.nav-group-label {
  margin: 14px 10px 7px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 650;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #4b5563;
  padding: 10px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 560;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.nav-item > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--primary);
}

.nav-item:hover {
  background: #f3f4f6;
  color: var(--text);
}

.nav-item.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-icon,
.button-icon,
.metric-icon {
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.nav-icon svg,
.button-icon svg,
.metric-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-insights,
.sidebar-panel {
  display: none;
}

.sidebar-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 14px 6px 2px;
}

.sidebar-session span {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 650;
}

.sidebar-session strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 720;
}

.workspace-shell {
  min-width: 0;
  min-height: 100dvh;
  margin-left: 256px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.82), transparent 240px),
    var(--bg-app);
  scroll-behavior: smooth;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.75);
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 28px;
  backdrop-filter: blur(16px);
}

.workspace-header h2 {
  font-size: 20px;
}

.workspace-header > div > .eyebrow {
  display: none;
}

.workspace-header > div > .muted {
  margin-top: 2px;
}

.workspace-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.status {
  min-height: 34px;
  max-width: 360px;
  overflow: hidden;
  border-radius: 10px;
  color: var(--text-muted);
  padding: 8px 10px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status:empty {
  display: none;
}

.status.success {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.status.error {
  background: var(--red-soft);
  color: var(--red);
}

.ops-strip,
.workspace-section {
  margin-right: 28px;
  margin-left: 28px;
}

.ops-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.ops-strip article,
.metric-card,
.summary-panel,
.content-band,
.distribution-card,
.usage-stat,
.billing-stat,
.preview-panel,
.stack-form,
.model-form,
.detail-dialog,
.command-dialog {
  border: 2px solid var(--border-soft);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.ops-strip article {
  min-width: 0;
  padding: 16px;
}

.ops-strip span,
.ops-strip small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.ops-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
}

.ops-strip code,
.ops-strip small {
  margin-top: 4px;
}

.workspace-section {
  scroll-margin-top: 84px;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.96);
  border-radius: 18px;
  background: var(--surface);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 18px 44px rgba(15, 23, 42, 0.06);
}

.workspace-section[hidden] + .workspace-section {
  margin-top: 0;
}

.workspace-section + .workspace-section {
  margin-top: 24px;
}

.workspace-section:not(.content-band) > .metrics-grid,
.workspace-section:not(.content-band) > .overview-panels {
  margin: 18px 20px 0;
}

.workspace-section:not(.content-band) > .overview-panels {
  margin-bottom: 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
}

.ops-monitor-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 20px 0;
}

.metric-card {
  position: relative;
  min-height: 96px;
  padding: 16px 16px 16px 64px;
}

.metric-card::before {
  display: none;
}

.metric-card::after {
  display: none;
}

.metric-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border-radius: 11px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 8px;
}

.metric-card[data-tone="credit"] .metric-icon,
.metric-card[data-tone="billing"] .metric-icon,
.metric-card[data-tone="margin"] .metric-icon {
  background: var(--green-soft);
  color: var(--green);
}

.metric-card[data-tone="usage"] .metric-icon,
.metric-card[data-tone="cost"] .metric-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-card[data-tone="risk"] .metric-icon {
  background: var(--red-soft);
  color: var(--red);
}

.metric-card > span:not(.metric-icon),
.usage-stat span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 780;
  line-height: 1.15;
}

.metric-card em {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.overview-panels,
.usage-distribution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.overview-panels {
  margin-top: 16px;
}

.summary-panel {
  min-width: 0;
  padding: 16px;
}

.endpoint-card,
.policy-list {
  display: grid;
  gap: 10px;
}

.ops-command-center {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.ops-command-center .ops-monitor-grid {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.ops-command-center .metric-card {
  min-height: 74px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 2px 12px 2px 46px;
  box-shadow: none;
}

.ops-command-center .metric-card + .metric-card {
  border-left: 1px solid var(--border-soft);
}

.ops-command-center .metric-icon {
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.ops-command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 14px;
}

.ops-command-head h3,
.ops-section-title h3 {
  font-size: 15px;
}

.ops-action-grid {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.ops-endpoint-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(240px, 0.9fr);
  gap: 12px;
}

.ops-endpoint-row > div {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0;
}

.ops-endpoint-row span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.ops-endpoint-row code,
.ops-endpoint-row strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.ops-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
}

.ops-workbench-section {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 16px 0 0;
}

.ops-workbench-section-main,
.ops-workbench-section-events {
  grid-row: span 2;
}

.ops-workbench-section-events {
  max-height: 520px;
  overflow: auto;
  scrollbar-width: thin;
}

.ops-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ops-workbench-section .table-wrap {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ops-workbench-section .timeline-list {
  gap: 10px;
}

.ops-workbench-section .timeline-item {
  border-radius: 12px;
  box-shadow: none;
}

.endpoint-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 14px;
}

.endpoint-card span,
.policy-list span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.endpoint-card code,
.endpoint-card strong {
  display: block;
  border-radius: 11px;
  background: #ffffff;
  padding: 10px 12px;
}

.desktop-preview-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff, var(--primary-soft));
  padding: 16px;
}

.preview-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.preview-title-row strong {
  font-size: 15px;
}

.desktop-preview-card p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.desktop-preview-card small {
  color: var(--text-muted);
  font-size: 12px;
}

.policy-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.policy-preview-grid div {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 11px;
}

.policy-preview-grid span,
.resource-preview > div > span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.policy-preview-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.feature-preview-list,
.resource-preview > div > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-chip,
.resource-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 680;
}

.feature-chip.active,
.resource-chip.active {
  border-color: rgba(20, 184, 166, 0.26);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.feature-chip.disabled,
.resource-chip.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.resource-preview {
  display: grid;
  gap: 14px;
}

.resource-preview > div {
  display: grid;
  gap: 8px;
}

.resource-chip small {
  max-width: 180px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#api-key-secret {
  min-height: 42px;
  overflow-wrap: anywhere;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 760;
}

.policy-list span {
  position: relative;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 9px 12px 9px 32px;
}

.policy-list span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 12px;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.panel-head,
.section-head,
.dialog-head,
.command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head {
  margin-bottom: 14px;
}

.summary-list {
  display: grid;
  gap: 8px;
}

.production-panel {
  margin: 18px 20px 0;
  border-color: rgba(20, 184, 166, 0.22);
  background: linear-gradient(180deg, #ffffff, rgba(240, 253, 250, 0.64));
}

.readiness-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.readiness-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.readiness-row.is-blocked {
  border-color: rgba(220, 38, 38, 0.22);
  background: linear-gradient(180deg, #ffffff, rgba(254, 242, 242, 0.62));
}

.readiness-row strong,
.readiness-row p {
  display: block;
}

.readiness-row strong {
  color: var(--text);
  font-size: 13px;
}

.readiness-row p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.readiness-row em {
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  padding: 2px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  text-transform: uppercase;
}

.count-pill.is-ready {
  border-color: rgba(22, 163, 74, 0.28);
  background: var(--green-soft);
  color: var(--green);
}

.count-pill.is-blocked {
  border-color: rgba(220, 38, 38, 0.28);
  background: var(--red-soft);
  color: var(--red);
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 10px 0 0;
}

.summary-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.summary-row strong {
  display: block;
  font-size: 13px;
}

.summary-row span {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.summary-row em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.summary-row i {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.summary-row i::before {
  content: "";
  display: block;
  width: var(--bar-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.model-summary-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.content-band {
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.content-band > .section-head {
  border-bottom: 0;
  background: transparent;
  padding: 0 0 14px;
}

.content-band > .split-layout,
.content-band > .settings-grid,
.content-band > .module-workbench,
.content-band > .usage-strip,
.content-band > .usage-distribution-grid,
.content-band > .billing-overview {
  margin: 18px 20px 0;
  border-bottom: 0;
  background: transparent;
  padding: 0;
}

.content-band > .filter-bar {
  margin: 18px 20px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.content-band > .table-wrap {
  width: auto;
  margin: 18px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}

.content-band > .module-workbench {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.section-head {
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.section-head.compact {
  border-bottom: 1px solid var(--border);
  padding: 18px 20px;
}

.section-head.compact h2 {
  display: block;
}

.section-head.compact .muted {
  display: block;
}

.count-pill,
.badge,
.plan-tag,
.mini-state {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.count-pill {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-muted);
}

.split-layout,
.filter-bar,
.usage-strip,
.settings-grid,
.billing-overview {
  border-bottom: 0;
  background: transparent;
  padding: 0;
}

.form-grid,
.two-col,
.settings-grid,
.switch-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two,
.two-col,
.switch-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  border-bottom: 0;
}

.stack-form,
.model-form,
.preview-panel {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.preview-panel {
  border-color: rgba(20, 184, 166, 0.2);
}

.models-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.span-all {
  grid-column: 1 / -1;
}

.model-form {
  margin: 18px 20px 20px 0;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(150px, 0.28fr));
  gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

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

.module-workbench {
  display: grid;
  min-width: 0;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.module-workbench > .split-layout,
.module-workbench > .settings-grid,
.module-workbench > .usage-strip,
.module-workbench > .usage-distribution-grid,
.module-workbench > .billing-overview,
.module-workbench > .filter-bar {
  margin: 0;
}

.module-workbench > .table-wrap {
  width: 100%;
  margin: 0;
}

.module-workbench .stack-form,
.module-workbench .model-form,
.module-workbench .preview-panel,
.module-workbench .summary-panel,
.module-workbench .distribution-card,
.module-workbench .table-wrap,
.module-workbench .filter-bar {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.module-workbench .stack-form,
.module-workbench .model-form,
.module-workbench .preview-panel,
.module-workbench .summary-panel,
.module-workbench .distribution-card {
  padding: 0;
}

.module-workbench .filter-bar {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

.editor-workbench,
.model-workbench {
  grid-column: 1 / -1;
}

.editor-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: start;
}

.editor-workbench > .table-wrap {
  grid-column: 1;
}

.editor-workbench > .model-form {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.model-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: start;
}

.model-workbench > .filter-bar,
.model-workbench > .summary-panel {
  grid-column: 1 / -1;
}

.model-workbench > .table-wrap {
  grid-column: 1;
}

.model-workbench > .model-form {
  grid-column: 2;
  grid-row: 3;
  margin: 0;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.settings-workbench {
  margin-bottom: 20px;
}

.usage-workbench .usage-strip,
.billing-workbench .billing-overview {
  padding: 0;
}

.module-workbench .split-layout,
.module-workbench .usage-distribution-grid,
.module-workbench .billing-overview {
  gap: 18px;
}

.module-workbench .split-layout > *,
.module-workbench .usage-distribution-grid > *,
.module-workbench .billing-overview > *,
.settings-workbench > * {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.module-workbench .split-layout > *:first-child,
.module-workbench .usage-distribution-grid > *:first-child,
.module-workbench .billing-overview > *:first-child,
.settings-workbench > *:first-child {
  border-top: 0;
  padding-top: 0;
}

.module-workbench > .table-wrap,
.module-workbench .distribution-table,
.module-workbench .permission-matrix-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.module-workbench .distribution-table {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.model-workbench > .summary-panel {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.settings-workbench {
  gap: 18px;
}

.settings-workbench .preview-panel {
  border-left: 1px solid rgba(20, 184, 166, 0.2);
  padding-left: 16px;
}

.billing-stat {
  min-width: 0;
  padding: 15px;
}

.billing-stat span,
.billing-stat small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.billing-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  font-weight: 780;
}

.billing-stat small {
  margin-top: 5px;
}

.filter-bar.span-all {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span:not(.password-field),
.field > label,
.check-row span,
.plan-checks legend {
  color: #374151;
  font-size: 12px;
  font-weight: 650;
}

.password-field {
  position: relative;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 10px 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

input,
select {
  height: 42px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

.password-field input {
  padding-right: 64px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--focus);
  outline: none;
}

.field-icon-button {
  position: absolute;
  top: 50%;
  right: 6px;
  min-height: 30px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
}

.field-icon-button:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.primary-action,
.secondary-action,
.ghost-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 120ms ease;
}

.button-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.primary-action {
  border: 1px solid var(--primary-strong);
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.22);
}

.primary-action:hover {
  filter: brightness(0.98);
}

.secondary-action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: #374151;
}

.ghost-action {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
}

.secondary-action:hover,
.ghost-action:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.primary-action:active,
.secondary-action:active,
.ghost-action:active,
.command-item:active {
  transform: scale(0.98);
}

.table-wrap {
  width: calc(100% - 40px);
  margin: 16px 20px 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 720;
}

td {
  color: var(--text);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(240, 253, 250, 0.42);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.compact-input {
  width: 118px;
}

.password-input {
  width: 142px;
}

.identity-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.identity-cell > div {
  min-width: 0;
}

.identity-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.identity-mark.model {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.identity-mark.team {
  background: var(--green-soft);
  color: var(--green);
}

.badge.active,
.badge.success,
.badge.paid,
.badge.issued,
.mini-state.active {
  background: var(--green-soft);
  color: var(--green);
}

.badge.suspended,
.badge.disabled,
.badge.revoked,
.badge.error,
.badge.timeout,
.badge.policy_blocked,
.badge.banned,
.badge.canceled,
.badge.refunded,
.mini-state.suspended {
  background: var(--red-soft);
  color: var(--red);
}

.badge.mock_fallback,
.badge.rate_limited,
.badge.pending,
.badge.past_due {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.role,
.plan-tag {
  background: #eef2ff;
  color: #4338ca;
}

.badge.role.admin {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.status-select.is-active {
  border-color: rgba(22, 163, 74, 0.35);
  color: var(--green);
}

.status-select.is-suspended {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--red);
}

.check-row,
.plan-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input,
.plan-checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.switch-row,
.plan-checks {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.plan-checks {
  display: grid;
  gap: 10px;
  margin: 0;
}

.plan-checks div {
  display: grid;
  gap: 7px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.usage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.usage-stat {
  min-width: 0;
  padding: 14px;
}

.usage-stat strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-stat small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.usage-distribution-grid {
  border-bottom: 0;
  background: transparent;
  padding: 0;
}

.distribution-card {
  min-width: 0;
  padding: 16px;
}

.distribution-card .panel-head {
  align-items: center;
}

.segment-group {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 2px;
}

.segment-group button {
  min-height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 650;
}

.segment-group button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.distribution-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut-chart {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background: conic-gradient(var(--blue) 0 72%, var(--primary) 72% 86%, var(--amber) 86% 96%, var(--green) 96% 100%);
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 42px;
  border-radius: inherit;
  background: var(--surface);
}

.distribution-table {
  margin: 0;
  width: 100%;
  border: 0;
  border-radius: 0;
}

.distribution-table table {
  min-width: 380px;
}

.permission-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.permission-matrix {
  min-width: 720px;
}

.permission-matrix th,
.permission-matrix td {
  text-align: center;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 220px;
  background: var(--surface-soft);
  text-align: left;
}

.permission-matrix td:first-child {
  background: var(--surface);
}

.matrix-toggle {
  display: inline-flex;
  min-width: 64px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 760;
}

.matrix-toggle.is-on {
  border-color: rgba(20, 184, 166, 0.34);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.matrix-toggle:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.matrix-toggle.is-on:hover {
  background: #ccfbf1;
}

.distribution-table th,
.distribution-table td {
  padding: 9px 10px;
  font-size: 12px;
}

.table-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border);
}

.table-tabs button {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 720;
}

.table-tabs button:hover {
  color: var(--text);
}

.table-tabs button.is-active {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.usage-page > .table-wrap table {
  min-width: 1460px;
}

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

.timeline-list.padded {
  padding: 16px 20px 20px;
}

.timeline-item {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.timeline-item.is-open {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(254, 243, 199, 0.36);
}

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

.timeline-item strong {
  font-size: 13px;
}

.timeline-item span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.timeline-item code {
  margin-top: 5px;
  color: var(--text-muted);
}

.detail-dialog,
.command-dialog {
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow-panel);
}

.detail-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  overflow: auto;
}

.command-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 28px));
  overflow: hidden;
}

.detail-dialog::backdrop,
.command-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.command-shell {
  display: grid;
  min-height: 260px;
  grid-template-rows: auto minmax(0, 1fr);
}

.dialog-head,
.command-head {
  border-bottom: 1px solid var(--border);
  padding: 16px;
}

.command-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.command-list {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  padding: 10px;
}

.command-item {
  display: grid;
  width: 100%;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 2px 12px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.command-item:hover,
.command-item:focus-visible {
  border-color: var(--border);
  background: var(--primary-soft);
}

.command-item span {
  grid-row: span 2;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 760;
}

.command-item strong,
.command-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-item strong {
  font-size: 13px;
}

.command-item em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

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

.detail-grid div,
.mini-list p {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.detail-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
}

.detail-editor,
.seat-overview {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, rgba(240, 253, 250, 0.72));
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.seat-overview span,
.seat-overview small {
  color: var(--text-muted);
  font-size: 12px;
}

.seat-meter {
  display: block;
  width: min(150px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.seat-meter.large {
  width: 100%;
  height: 10px;
}

.seat-meter i {
  display: block;
  width: var(--seat-value, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.member-list {
  display: grid;
  gap: 8px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.inline-action {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary-strong);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
}

.inline-action:hover {
  background: var(--primary-soft);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.detail-json {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
}

.mini-list {
  display: grid;
  gap: 6px;
}

.mini-list p {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.model-tags span {
  border: 1px solid #d7e5eb;
  border-radius: 999px;
  background: #f4fbfd;
  color: #256377;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 650;
}

.management-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%),
    var(--surface);
  padding: 14px 16px;
}

.management-title {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.management-title strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 760;
}

.management-title span {
  max-width: 66ch;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.management-controls {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.management-search,
.management-filter {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.management-search {
  flex: 1 1 260px;
}

.management-filter {
  flex: 0 1 150px;
}

.management-search span,
.management-filter span {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.management-search input,
.management-filter select {
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 11px;
}

.management-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.management-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #fbfdff;
  color: var(--text-muted);
  padding: 10px 14px;
  font-size: 12px;
}

.content-band > .section-head {
  margin: 0 20px;
}

.content-band > .module-workbench {
  overflow: hidden;
  border: 1px solid #dbe5ea;
  border-radius: 18px;
  background: #ffffff;
  padding: 0;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 34px rgba(15, 23, 42, 0.05);
}

.module-workbench .management-toolbar,
.module-workbench > .usage-strip,
.module-workbench > .usage-analysis-workbench,
.module-workbench > .usage-distribution-grid,
.module-workbench > .billing-overview,
.module-workbench > .summary-panel {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.module-workbench > .usage-strip,
.module-workbench > .billing-overview {
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  padding: 14px 16px;
}

.module-workbench > .usage-analysis-workbench,
.module-workbench > .usage-distribution-grid {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 16px;
}

.module-workbench > .summary-panel {
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 16px;
}

.module-workbench > .table-wrap,
.module-workbench .permission-matrix-wrap {
  width: 100%;
  margin: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.module-workbench > .table-wrap:last-child {
  border-bottom: 0;
}

.module-workbench .distribution-table {
  border: 1px solid var(--border);
  border-radius: 12px;
}

.module-workbench .table-wrap table {
  min-width: 1040px;
}

.module-workbench .table-wrap th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbfc;
}

.module-workbench .table-wrap th:last-child,
.module-workbench .table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 168px;
  background: inherit;
  box-shadow: -1px 0 0 var(--border);
}

.module-workbench .table-wrap th:last-child {
  background: #f8fbfc;
}

.module-workbench .table-wrap tbody tr:hover td:last-child {
  background: rgba(240, 253, 250, 0.96);
}

.table-actions {
  justify-content: flex-start;
}

.table-actions .primary-action,
.table-actions .secondary-action,
.table-actions .ghost-action {
  min-height: 30px;
  border-radius: 9px;
  padding: 5px 9px;
  font-size: 12px;
}

.identity-cell code {
  display: inline-block;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
}

.badge.admin,
.badge.owner,
.badge.manager,
.badge.user {
  background: var(--blue-soft);
  color: #1d4ed8;
}

.badge.banned,
.badge.suspended,
.badge.disabled,
.badge.revoked,
.badge.refunded,
.badge.canceled {
  background: var(--red-soft);
  color: var(--red);
}

.badge.pending,
.badge.trialing,
.badge.past_due {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.active,
.badge.paid,
.badge.issued,
.badge.enabled {
  background: var(--green-soft);
  color: var(--green);
}

.stack-form[data-parked="true"],
.model-form[data-parked="true"],
.summary-panel[data-parked="true"],
.filter-bar[data-parked="true"] {
  display: none;
}

.stack-form[data-in-drawer="true"],
.model-form[data-in-drawer="true"],
.summary-panel[data-in-drawer="true"] {
  display: grid;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.manage-drawer {
  width: min(520px, calc(100vw - 24px));
  max-width: none;
  max-height: none;
  height: 100dvh;
  margin: 0 0 0 auto;
  border: 0;
  border-left: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 0;
  box-shadow: -18px 0 42px rgba(15, 23, 42, 0.14);
}

.manage-drawer::backdrop {
  background: rgba(15, 23, 42, 0.28);
}

.drawer-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbfc);
  padding: 18px 20px;
}

.drawer-head h2 {
  font-size: 18px;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  padding: 18px 20px 24px;
}

.drawer-body .form-grid.two,
.drawer-body .two-col {
  grid-template-columns: 1fr;
}

.drawer-body .form-actions {
  position: sticky;
  bottom: -24px;
  margin: 4px -20px -24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 20px;
  backdrop-filter: blur(10px);
}

.drawer-body .endpoint-card {
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: 14px;
  background: var(--primary-soft);
  padding: 14px;
}

.transient-form {
  gap: 14px;
}

.user-command-sheet {
  display: grid;
  gap: 14px;
}

.user-profile-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.user-ops-editor {
  border-color: rgba(59, 130, 246, 0.22);
  background: linear-gradient(180deg, #ffffff, rgba(219, 234, 254, 0.38));
}

.sticky-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  margin-right: -20px;
  margin-left: -20px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.user-related-grid {
  display: grid;
  gap: 12px;
}

.user-related-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
}

.user-related-panel > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-related-panel > div:first-child strong {
  color: var(--text);
  font-size: 13px;
}

.user-related-panel > div:first-child span {
  color: var(--text-muted);
  font-size: 12px;
}

.settings-workbench {
  margin-bottom: 20px;
}

.config-management-summary {
  display: grid;
  gap: 14px;
  border-right: 0;
  border-bottom: 1px solid var(--border);
  border-left: 0;
  background: #ffffff;
  padding: 16px;
}

.config-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
}

.config-summary-grid article {
  min-width: 0;
  border-right: 1px solid var(--border);
  padding: 14px;
}

.config-summary-grid article:last-child {
  border-right: 0;
}

.config-summary-grid span,
.announcement-copy-board span,
.config-resource-board section > div:first-child span,
.resource-editor-head span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.config-summary-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
}

.config-resource-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.config-resource-board section,
.announcement-copy-board {
  display: grid;
  min-width: 0;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
}

.config-resource-board section > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.config-resource-board section > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.announcement-copy-board p {
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.settings-workbench[data-parked="true"] {
  display: none;
}

.settings-workbench[data-in-drawer="true"] {
  display: grid;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.drawer-body .settings-workbench {
  gap: 16px;
}

.drawer-body .settings-workbench > * {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.drawer-body .settings-workbench > *:first-child {
  border-top: 0;
  padding-top: 0;
}

.raw-resource-field {
  display: none;
}

.resource-editor-board {
  display: grid;
  gap: 14px;
}

.resource-editor {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.resource-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.resource-editor-head strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.resource-editor-table {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.resource-editor-table table {
  min-width: 520px;
}

.resource-editor-table th,
.resource-editor-table td {
  padding: 8px 10px;
}

.resource-editor-table input:not([type="checkbox"]) {
  height: 34px;
  border-radius: 9px;
  padding: 6px 9px;
}

.usage-workbench > .usage-distribution-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 0;
}

.usage-workbench .distribution-card {
  min-width: 220px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 14px;
  box-shadow: none;
}

.usage-workbench .distribution-card:last-child {
  border-right: 0;
}

.usage-workbench .distribution-card .panel-head {
  min-height: 58px;
  align-items: flex-start;
}

.usage-workbench .distribution-body {
  grid-template-columns: 82px minmax(180px, 1fr);
  gap: 12px;
}

.usage-workbench .donut-chart {
  width: 74px;
  height: 74px;
}

.usage-workbench .distribution-table {
  max-height: 170px;
  overflow: auto;
}

.billing-workbench > .billing-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  padding: 0;
}

.billing-workbench .billing-stat {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.billing-workbench .billing-stat:last-child {
  border-right: 0;
}

.ops-command-center {
  overflow: hidden;
  border: 1px solid #dbe5ea;
  border-radius: 18px;
  background: #ffffff;
  padding: 0;
}

.ops-command-center > .management-toolbar {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.ops-command-center .ops-monitor-grid {
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  padding: 14px 16px;
}

.ops-command-center .ops-command-head,
.ops-command-center .ops-endpoint-row,
.ops-command-center .ops-workbench-grid {
  margin: 0;
  padding: 14px 16px;
}

.ops-command-center .ops-command-head {
  border-bottom: 1px solid var(--border);
}

.ops-command-center .ops-endpoint-row {
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
}

.ops-workbench-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.ops-workbench-section {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 0 0 14px;
  box-shadow: none;
}

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

.ops-workbench-section-main,
.ops-workbench-section-events {
  grid-row: auto;
}

#overview-section {
  overflow: hidden;
}

#overview-section > .management-toolbar {
  margin: 18px 20px 0;
  border-radius: 16px 16px 0 0;
}

#overview-section .metrics-grid {
  grid-template-columns: repeat(10, minmax(138px, 1fr));
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #ffffff;
}

#overview-section .metric-card {
  min-width: 138px;
  min-height: 92px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 14px 12px 14px 48px;
  box-shadow: none;
}

#overview-section .metric-card:last-child {
  border-right: 0;
}

#overview-section .metric-icon {
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  padding: 6px;
}

#overview-section .metric-card strong {
  font-size: 18px;
}

#overview-section .overview-metrics-table {
  margin: 0 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: #ffffff;
}

#overview-section .overview-metrics-table table {
  min-width: 920px;
}

#overview-section .overview-metrics-table th,
#overview-section .overview-metrics-table td {
  padding: 11px 14px;
}

#overview-section .overview-metrics-table tbody tr:hover {
  background: #f8fbff;
}

#overview-section .overview-metrics-table strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

#overview-section .production-panel {
  margin: 16px 20px 0;
  border: 1px solid var(--border);
  box-shadow: none;
}

#overview-section .overview-panels {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

#overview-section .overview-panels .summary-panel {
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

#overview-section .overview-panels .summary-panel:last-child {
  border-right: 0;
}

.usage-workbench > .usage-strip {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 0;
  background: #f8fafc;
  padding: 0;
}

.usage-workbench .usage-stat {
  min-height: 78px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 14px;
  box-shadow: none;
}

.usage-workbench .usage-stat:last-child {
  border-right: 0;
}

.usage-workbench .usage-stat strong {
  font-size: 18px;
}

.usage-workbench .segment-group {
  display: none;
}

.usage-workbench .distribution-card .panel-head {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 10px;
}

.usage-workbench .distribution-card .panel-head p {
  display: none;
}

.usage-workbench .distribution-card h3 {
  font-size: 13px;
}

.usage-analysis-workbench {
  display: grid;
  gap: 14px;
}

.analysis-head,
.analysis-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analysis-head h3 {
  font-size: 15px;
}

.usage-analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.usage-analysis-grid section {
  display: grid;
  min-width: 240px;
  gap: 10px;
  border-right: 1px solid var(--border);
  padding: 14px;
}

.usage-analysis-grid section:last-child {
  border-right: 0;
}

.analysis-title strong {
  font-size: 13px;
}

.analysis-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--border);
}

.usage-analysis-grid .distribution-table {
  max-height: 170px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.usage-analysis-grid .distribution-table table {
  min-width: 0;
}

.usage-analysis-grid .distribution-table th,
.usage-analysis-grid .distribution-table td {
  padding: 8px 6px;
}

.ops-command-center .ops-monitor-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 0;
  padding: 0;
}

.ops-command-center .metric-card {
  min-height: 78px;
  border-right: 1px solid var(--border);
  padding: 14px 10px 14px 44px;
}

.ops-command-center .metric-card:last-child {
  border-right: 0;
}

.ops-command-center .metric-card + .metric-card {
  border-left: 0;
}

.ops-command-center .ops-kpi {
  min-height: 78px;
  border-right: 1px solid var(--border);
  padding: 14px 12px;
}

.ops-command-center .ops-kpi:last-child {
  border-right: 0;
}

.ops-kpi span,
.ops-kpi em {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.ops-kpi strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

.ops-kpi em {
  margin-top: 4px;
}

.audit-table-wrap table {
  min-width: 880px;
}

#risk-events code,
#audit-list code {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

/* Enterprise admin layout consolidation: one clear workbench per module. */
.workspace-header {
  min-height: 72px;
}

.workspace-section {
  margin-top: 26px;
}

.content-band > .section-head,
.workspace-section > .section-head {
  display: none;
}

.workspace-section:not(.content-band) > .section-head.compact {
  display: none;
}

.content-band > .module-workbench,
.ops-command-center {
  margin: 0 28px 28px;
}

.module-workbench {
  gap: 0;
}

.editor-workbench,
.model-workbench,
.billing-workbench,
.usage-workbench,
.audit-workbench {
  display: block;
}

.models-layout {
  display: block;
}

.module-workbench > .split-layout {
  display: none;
}

.module-workbench > .management-toolbar,
.ops-command-center > .management-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.74fr) minmax(0, 1.26fr);
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  padding: 18px 20px;
}

.management-title strong {
  font-size: 16px;
}

.management-title span {
  font-size: 13px;
}

.management-controls {
  align-items: center;
}

.module-workbench > .table-wrap,
.module-workbench .permission-matrix-wrap,
.audit-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.module-workbench .table-wrap table {
  min-width: 820px;
  table-layout: auto;
}

#plans-section .module-workbench .table-wrap table,
#payments-section .module-workbench .table-wrap table,
#audit-section .module-workbench .table-wrap table {
  min-width: 0;
}

#models-section .module-workbench > .table-wrap table {
  min-width: 980px;
}

#models-section .module-workbench > .table-wrap td:nth-child(2) code {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#usage-section .module-workbench > .table-wrap table {
  min-width: 1320px;
}

.module-workbench .permission-matrix-wrap table {
  min-width: 780px;
}

.module-workbench .table-wrap th,
.module-workbench .table-wrap td {
  height: auto;
  min-width: 0;
  padding: 13px 18px;
  white-space: normal;
}

.module-workbench .table-wrap th:last-child,
.module-workbench .table-wrap td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  min-width: 0;
  background: inherit;
  box-shadow: none;
}

.module-workbench .table-wrap th:last-child {
  background: #f8fbfc;
}

.module-workbench .table-wrap tbody tr:hover td:last-child {
  background: rgba(240, 253, 250, 0.42);
}

.table-actions {
  display: inline-flex;
  width: max-content;
  max-width: 260px;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions .primary-action,
.table-actions .secondary-action,
.table-actions .ghost-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

#users-section[data-active-view="users"] .module-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: start;
  gap: 0;
}

#users-section[data-active-view="users"] .module-workbench > .management-toolbar,
#users-section[data-active-view="users"] .module-workbench > .management-footer {
  grid-column: 1 / -1;
}

#users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"] {
  grid-column: 1;
  min-width: 0;
  max-height: calc(100dvh - 300px);
  overflow: auto;
  border-right: 1px solid var(--border);
  border-bottom: 0;
}

#users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"] table {
  min-width: 980px;
}

#users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"] tbody tr {
  cursor: pointer;
}

#users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"] tbody tr.is-selected td {
  background: #eef9fb;
}

#users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"] tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

.user-ops-panel {
  grid-column: 2;
  min-width: 0;
  align-self: stretch;
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
}

.user-ops-sticky {
  position: sticky;
  top: 0;
  display: grid;
  gap: 14px;
  max-height: calc(100dvh - 300px);
  overflow-y: auto;
  padding: 16px;
}

.user-ops-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.user-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-ops-grid > div,
.user-ops-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.user-ops-grid > div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.user-ops-grid span,
.user-ops-section-head,
.user-ops-section .muted {
  color: var(--text-muted);
  font-size: 12px;
}

.user-ops-grid strong {
  overflow: hidden;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-ops-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-ops-actions .primary-action,
.user-ops-actions .secondary-action,
.user-ops-actions .ghost-action {
  width: 100%;
  min-height: 34px;
  justify-content: center;
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 12px;
  white-space: normal;
}

.user-ops-actions .primary-action {
  grid-column: 1 / -1;
}

.user-ops-section {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.user-ops-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-ops-section-head strong {
  color: var(--text);
  font-size: 13px;
}

.user-ops-section p {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.user-ops-empty {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.user-ops-empty strong {
  font-size: 14px;
}

.plan-tag,
.mini-state,
.badge {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-workbench > .summary-panel {
  border-top: 0;
  padding: 18px 20px;
}

.model-workbench > .summary-panel .panel-head {
  margin-bottom: 16px;
}

.model-workbench > .table-wrap {
  border-top: 1px solid var(--border);
}

.model-workbench .permission-matrix th,
.model-workbench .permission-matrix td {
  text-align: center;
  white-space: nowrap;
}

.model-workbench .permission-matrix th:first-child,
.model-workbench .permission-matrix td:first-child {
  text-align: left;
  white-space: normal;
}

.billing-workbench > .billing-overview,
.usage-workbench > .usage-strip {
  display: grid;
  overflow: hidden;
}

.billing-workbench > .billing-overview {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.usage-workbench > .usage-strip {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
}

.usage-analysis-grid {
  grid-template-columns: repeat(4, minmax(260px, 1fr));
}

.usage-analysis-grid .distribution-table {
  max-height: none;
}

.usage-analysis-grid .distribution-table table {
  width: 100%;
  min-width: 0;
}

.usage-analysis-grid .distribution-table th,
.usage-analysis-grid .distribution-table td {
  white-space: normal;
}

.management-footer {
  clear: both;
  border-radius: 0;
  padding: 12px 18px;
}

.module-workbench > .management-footer:last-child,
.audit-workbench > .management-footer:last-child {
  border-radius: 0 0 18px 18px;
}

.audit-workbench > .management-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.audit-table-wrap table {
  width: 100%;
  min-width: 0;
}

.usage-workbench .usage-analysis-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.usage-workbench .usage-analysis-grid section {
  min-width: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.usage-workbench .usage-analysis-grid section:nth-child(2n) {
  border-right: 0;
}

.usage-workbench .usage-analysis-grid section:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.usage-workbench .usage-analysis-grid .distribution-table {
  overflow: hidden;
}

.usage-workbench .usage-analysis-grid .distribution-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.usage-workbench .usage-analysis-grid .distribution-table th,
.usage-workbench .usage-analysis-grid .distribution-table td {
  overflow-wrap: anywhere;
}

.compact-table {
  width: 100%;
  margin: 0;
}

.compact-table table {
  min-width: 420px;
}

.toast-viewport {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  box-shadow: var(--shadow-panel);
  font-size: 13px;
  line-height: 1.45;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.success {
  border-color: rgba(20, 184, 166, 0.4);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--red);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.danger-text {
  color: var(--red);
}

.error-text {
  min-height: 18px;
  color: var(--red);
  font-size: 13px;
}

.empty-summary,
.empty-row {
  color: var(--text-faint);
  text-align: center;
}

.empty-summary {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
}

[data-density="comfortable"] .workspace-section + .workspace-section,
[data-density="comfortable"] .ops-strip {
  margin-top: 28px;
}

[data-density="comfortable"] th,
[data-density="comfortable"] td {
  padding: 14px 16px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-strip,
  .ops-monitor-grid,
  .ops-endpoint-row,
  .ops-workbench-grid,
  .usage-strip,
  .billing-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-workbench-section-main,
  .ops-workbench-section-events {
    grid-row: auto;
  }

  .models-layout,
  .settings-grid,
  .split-layout,
  .editor-workbench,
  .model-workbench,
  .overview-panels,
  .usage-distribution-grid {
    grid-template-columns: 1fr;
  }

  .editor-workbench > .table-wrap,
  .editor-workbench > .model-form,
  .model-workbench > .filter-bar,
  .model-workbench > .summary-panel,
  .model-workbench > .table-wrap,
  .model-workbench > .model-form {
    grid-column: 1;
    grid-row: auto;
  }

  .editor-workbench > .model-form,
  .model-workbench > .model-form {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    padding-left: 0;
  }

  .model-form {
    margin: 0 20px 20px;
  }

  .module-workbench .model-form {
    margin: 0;
  }
}

@media (max-width: 920px) {
  .control-sidebar {
    position: static;
    width: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
  }

  .sidebar-brand {
    padding-bottom: 8px;
  }

  .section-nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 3px 0 5px;
  }

  .nav-group-label,
  .sidebar-session {
    display: none;
  }

  .nav-item {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
    gap: 8px;
    padding: 8px 10px;
  }

  .nav-item.is-active::before {
    display: none;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .workspace-shell {
    margin-left: 0;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 12px 16px;
  }

  .workspace-header .muted {
    display: none;
  }

  .workspace-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .workspace-actions > * {
    flex: 0 0 auto;
  }

  .status {
    max-width: 220px;
    min-height: 32px;
    padding: 7px 9px;
  }

  .ops-strip,
  .workspace-section {
    margin-right: 16px;
    margin-left: 16px;
  }

  .workspace-section + .workspace-section {
    margin-top: 16px;
  }

  .metrics-grid,
    .filter-bar,
    .management-toolbar,
    #users-section[data-active-view="users"] .module-workbench,
    .ops-monitor-grid,
    .ops-action-grid,
    .ops-endpoint-row,
    .ops-workbench-grid,
    .module-workbench,
    .editor-workbench,
    .model-workbench,
    .billing-overview,
    .policy-preview-grid,
    .form-grid.two,
    .two-col,
  .switch-grid,
  .detail-grid,
  .distribution-body {
    grid-template-columns: 1fr;
  }

  .donut-chart {
    margin: 0 auto;
  }

  .ops-command-head {
    flex-direction: column;
  }

  .ops-action-grid {
    width: 100%;
    justify-content: flex-start;
  }

  .management-controls {
    justify-content: flex-start;
  }

  .management-search,
  .management-filter,
  .management-actions {
    width: 100%;
    flex-basis: 100%;
  }
}

@media (max-width: 640px) {
  .login-view {
    padding: 26px 12px 22px;
  }

  .login-shell {
    gap: 22px;
  }

  .login-hero-logo {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .login-hero strong {
    font-size: 28px;
  }

  .login-hero span {
    font-size: 14px;
  }

  .login-form-head h1 {
    font-size: 22px;
  }

  .login-card {
    gap: 13px;
    border-radius: 16px;
    padding: 24px 18px;
  }

  .login-submit {
    width: 100%;
  }

  .login-input-shell input {
    height: 48px;
  }

  .login-terms-row {
    font-size: 12px;
  }

  .metrics-grid,
  .ops-strip,
  .ops-monitor-grid,
  .ops-endpoint-row,
  .ops-workbench-grid,
  .usage-strip,
  .billing-overview {
    grid-template-columns: 1fr;
  }

  .ops-command-center {
    padding: 14px;
  }

  .ops-action-grid > * {
    flex: 1 1 100%;
  }

  .section-head,
  .panel-head {
    flex-direction: column;
  }

  .table-wrap {
    width: calc(100% - 32px);
    margin: 14px 16px 16px;
  }

  .module-workbench {
    margin-right: 16px;
    margin-left: 16px;
    padding: 14px;
  }

  .settings-workbench .preview-panel {
    border-left: 0;
    padding-left: 0;
  }

  .module-workbench > .table-wrap,
  .module-workbench .table-wrap {
    width: 100%;
    margin: 0;
  }

  .management-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .manage-drawer {
    width: 100vw;
  }

  #users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"],
  .user-ops-panel {
    grid-column: 1;
    border-right: 0;
  }

  #users-section[data-active-view="users"] .module-workbench > .table-wrap[data-workspace-view="users"],
  .user-ops-sticky {
    max-height: none;
  }

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